diff --git a/.bazelrc.common b/.bazelrc.common index 6d8fa4fd1..9e23e5757 100644 --- a/.bazelrc.common +++ b/.bazelrc.common @@ -17,6 +17,10 @@ startup --host_jvm_args=-Djdk.tls.client.protocols=TLSv1.2 common --incompatible_require_linker_input_cc_api common --incompatible_disallow_empty_glob=true +# explicitly disable sandboxing exclusive tests (it was false in Bazel 6, but is true in Bazel 7+) +# (otherise this causes some integration tests to fail) +common --noincompatible_exclusive_test_sandboxed + # test environment does not propagate locales by default some tests reads files # written in UTF8, we need to propagate the correct environment variables, such # as LOCALE_ARCHIVE We also need to setup an utf8 locale diff --git a/.bazelversion b/.bazelversion index f22d756da..a3fcc7121 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -6.5.0 +7.1.0 diff --git a/rules_haskell_tests/.ghcide b/rules_haskell_tests/.ghcide index ceb0cd3de..c40d70560 100755 --- a/rules_haskell_tests/.ghcide +++ b/rules_haskell_tests/.ghcide @@ -1,13 +1,9 @@ #!/usr/bin/env bash set -euo pipefail build_ghcide() { - bazel build //tests/ghcide \ - --experimental_show_artifacts \ - 2>&1 \ - | awk ' - /^>>>/ { print substr($1, 4); next } - { print $0 > "/dev/stderr" } - ' + bazel build //tests/ghcide + outfile=$( bazel cquery --output=files //tests/ghcide ) + echo "$( bazel info execution_root)/${outfile}" } ghcide="$(build_ghcide)" "$ghcide" "$@" diff --git a/rules_haskell_tests/shell.nix b/rules_haskell_tests/shell.nix index 2bbf21c73..bcfa20b40 100644 --- a/rules_haskell_tests/shell.nix +++ b/rules_haskell_tests/shell.nix @@ -33,7 +33,7 @@ mkShell { file ] ++ lib.optionals docTools [ graphviz python3Packages.sphinx zip unzip ]; - packages = [ bazel_6 ]; + packages = [ bazel_7 ]; shellHook = '' # Add nix config flags to .bazelrc.local. diff --git a/rules_haskell_tests/tests/ghcWithPackages_2097/BUILD.bazel b/rules_haskell_tests/tests/ghcWithPackages_2097/BUILD.bazel index 99347f3ca..4e15d010b 100644 --- a/rules_haskell_tests/tests/ghcWithPackages_2097/BUILD.bazel +++ b/rules_haskell_tests/tests/ghcWithPackages_2097/BUILD.bazel @@ -3,6 +3,10 @@ load("//tests/integration_testing:rules_haskell_integration_test.bzl", "rules_ha rules_haskell_integration_test( name = "ghc_with_packages_test", srcs = ["Test.hs"], + env = { + "BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN": "1", + }, + tags = ["requires_nix"], workspace_path = "test", ) diff --git a/rules_haskell_tests/tests/integration_testing/rules_haskell_integration_test.bzl b/rules_haskell_tests/tests/integration_testing/rules_haskell_integration_test.bzl index 363990170..489b375cc 100644 --- a/rules_haskell_tests/tests/integration_testing/rules_haskell_integration_test.bzl +++ b/rules_haskell_tests/tests/integration_testing/rules_haskell_integration_test.bzl @@ -16,6 +16,7 @@ def rules_haskell_integration_test( workspace_path, srcs, deps = [], + env = {}, bindist_bazel_versions = SUPPORTED_BAZEL_VERSIONS, nixpkgs_bazel_packages = SUPPORTED_NIXPKGS_BAZEL_PACKAGES, **kwargs): @@ -33,7 +34,7 @@ def rules_haskell_integration_test( name = "%s_nixpkgs" % name, srcs = srcs, deps = deps, - env = { + env = env | { "NIXPKGS": "1", }, bazel_binaries = nixpkgs_bazel_binaries, @@ -50,6 +51,7 @@ def rules_haskell_integration_test( name = "%s_bindist" % name, srcs = srcs, deps = deps, + env = env, bazel_binaries = bindist_bazel_binaries, workspace_path = workspace_path, rule_files = ["@rules_haskell//:distribution"], diff --git a/shell.nix b/shell.nix index 1a44395fe..ad9cd863e 100644 --- a/shell.nix +++ b/shell.nix @@ -42,7 +42,7 @@ mkShell { ++ lib.optionals docTools [ graphviz python3Packages.sphinx zip unzip ] ++ lib.optional stdenv.isDarwin macOS-security; - packages = [ bazel_6 ]; + packages = [ bazel_7 ]; shellHook = '' # Add nix config flags to .bazelrc.local.