diff --git a/.bazelrc.common b/.bazelrc.common index 96e8793f2..1fe555b99 100644 --- a/.bazelrc.common +++ b/.bazelrc.common @@ -18,6 +18,10 @@ common --incompatible_require_linker_input_cc_api common --incompatible_disallow_empty_glob=true common --experimental_cc_shared_library +# 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/MODULE.bazel b/MODULE.bazel index 1c5882959..0fa180063 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -9,7 +9,7 @@ bazel_dep( ) bazel_dep( name = "rules_java", - version = "6.1.0", + version = "7.3.1", ) bazel_dep( name = "rules_license", diff --git a/haskell/private/workspace_utils.bzl b/haskell/private/workspace_utils.bzl index 663e98147..7f1df95f4 100644 --- a/haskell/private/workspace_utils.bzl +++ b/haskell/private/workspace_utils.bzl @@ -25,7 +25,7 @@ def execute_or_fail_loudly( ) if exec_result.return_code != 0: arguments = [_as_string(x) for x in arguments] - fail("\n".join(["Command failed: " + " ".join(arguments), exec_result.stderr])) + fail("\n".join(["Command failed: " + " ".join(arguments), "-- STDOUT --", exec_result.stdout, "-- STDERR --", exec_result.stderr])) return exec_result def _as_string(v): diff --git a/haskell/repositories.bzl b/haskell/repositories.bzl index 55c0858c0..d378bd194 100644 --- a/haskell/repositories.bzl +++ b/haskell/repositories.bzl @@ -76,10 +76,10 @@ def rules_haskell_dependencies(): maybe( http_archive, name = "rules_java", - sha256 = "29ba147c583aaf5d211686029842c5278e12aaea86f66bd4a9eb5e525b7f2701", urls = [ - "https://github.com/bazelbuild/rules_java/releases/download/6.3.0/rules_java-6.3.0.tar.gz", + "https://github.com/bazelbuild/rules_java/releases/download/7.3.1/rules_java-7.3.1.tar.gz", ], + integrity = "sha256-QBjpfJP5doDxZQ/9KnUwJFuGSsVD/ST66MArpEfLKGQ=", ) maybe( 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 2af31061e..9e4bf1de8 100644 --- a/rules_haskell_tests/tests/ghcWithPackages_2097/BUILD.bazel +++ b/rules_haskell_tests/tests/ghcWithPackages_2097/BUILD.bazel @@ -5,6 +5,9 @@ rules_haskell_integration_test( srcs = ["Test.hs"], # this test is only useful with a nixpkgs based ghc toolchain target_compatible_with = ["@rules_nixpkgs_core//constraints:support_nix"], + env = { + "BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN": "1", + }, 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 ff07ac97b..e6de61735 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, target_compatible_with = [], @@ -34,7 +35,7 @@ def rules_haskell_integration_test( name = "%s_nixpkgs" % name, srcs = srcs, deps = deps, - env = { + env = env | { "NIXPKGS": "1", }, bazel_binaries = nixpkgs_bazel_binaries, @@ -51,6 +52,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.