Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency bazel to v7 - abandoned #2166

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
11c58c6
Update GHC versions and repin
avdv Dec 4, 2024
28ead19
Fix nixpkgs GHC version
avdv Dec 5, 2024
fe1aa99
Update expected test values
avdv Dec 5, 2024
6a4fb94
Fix check for cabal setup_dep
avdv Dec 5, 2024
75c6a5c
Disable pkg-config flag for zlib in ghcide snapshot
avdv Dec 5, 2024
9c18125
Downgrade happy for stackage nightly on GHC 9.8.2
avdv Dec 12, 2024
163122c
Skip `//tests/haskell_module/dep-narrowing-th:lib` on Darwin with GHC…
avdv Dec 13, 2024
fc59d63
Update dependency bazel to v7
renovate[bot] Nov 18, 2024
2b7a43a
Use Bazel version 7.1.0 by default
avdv Nov 18, 2024
02b9559
Disable sandboxed exclusive tests
avdv Nov 19, 2024
4f082da
Set `requires_nix` tag on //tests/ghcWithPackages_2097:ghc_with_packa…
avdv Nov 19, 2024
b0e6522
Allow passing environment variables to `rules_haskell_integration_test`
avdv Nov 19, 2024
18ed57c
Pass `BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1` to ghc_with_packages_test
avdv Nov 19, 2024
590225b
Make .ghcide script compatible with Bazel 7
avdv Nov 19, 2024
d031e68
Work around invalid path problem on Windows
avdv Nov 22, 2024
4b5f99c
Add patch to rules_nixpkgs_core module
avdv Nov 22, 2024
7504573
Apply patch to rules_nixpkgs_core
avdv Nov 22, 2024
86d6868
fixup
avdv Nov 22, 2024
c198159
fixup
avdv Nov 22, 2024
89eff51
fixup add patch to distribution
avdv Nov 22, 2024
8c93a9d
Keep LF line endings in patch files
avdv Dec 3, 2024
9eb1e46
Add bazelignore patch for rules_nixpkgs_nodejs
avdv Dec 3, 2024
ddca565
Apply bazelignore patch to rules_nipxkgs_nodejs
avdv Dec 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .bazelrc.common
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.5.0
7.1.0
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Prevent git from automatically introducing \r characters in .sha256 files.
# Otherwise msys sha256sum fails.
*.sha256 binary

# keep LF line endings in patch files to keep hash the same
registry/**/*.patch text eol=lf
16 changes: 8 additions & 8 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,16 @@ jobs:
module: [rules_haskell, rules_haskell_nix, rules_haskell_tests]
bzlmod: [true, false]
ghc:
- 9.4.6
- 9.4.8
- 9.6.5
- 9.8.1
- 9.8.2
exclude:
- module: rules_haskell_nix

bzlmod: false
# TODO: in a MODULE.bazel file we declare version specific dependencies, would need to use stack snapshot json
# and stack config per GHC version
- ghc: 9.8.1
- ghc: 9.8.2
bzlmod: true
- ghc: 9.6.5
bzlmod: true
Expand Down Expand Up @@ -143,20 +143,20 @@ jobs:
module: [rules_haskell, rules_haskell_tests]
bzlmod: [true, false]
ghc:
- 9.4.6
- 9.4.8
- 9.6.5
- 9.8.1
- 9.8.2
exclude:
# TODO: in a MODULE.bazel file we declare version specific dependencies, would need to use stack snapshot json
# and stack config per GHC version
- ghc: 9.8.1
- ghc: 9.8.2
bzlmod: true
- ghc: 9.6.5
bzlmod: true
# currently proto-lens-protoc fails with an access violation on Windows
# currently proto-lens-protoc (read: protoc-gen-haskell) fails with an access violation on Windows
- ghc: 9.6.5
os: windows-latest
- ghc: 9.8.1
- ghc: 9.8.2
os: windows-latest
env:
GHC_VERSION: ${{ matrix.ghc }}
Expand Down
1 change: 1 addition & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ filegroup(
"BUILD.bazel",
"WORKSPACE",
"constants.bzl",
"rules_nixpkgs_core_bazelignore.patch",
"stackage_snapshot.json",
"stackage_snapshot.yaml",
"//debug/linking_utils:all_files",
Expand Down
7 changes: 7 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,13 @@ bazel_dep(
version = "0.12.0",
dev_dependency = True,
)
single_version_override(
module_name = "rules_nixpkgs_nodejs",
patch_strip = 3,
patches = [
"rules_nixpkgs_nodejs-bazelignore.patch",
],
)

non_module_dev_deps = use_extension(
"//:non_module_dev_deps.bzl",
Expand Down
2 changes: 1 addition & 1 deletion constants.bzl
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
test_ghc_version = "9.4.6"
test_ghc_version = "9.4.8"
test_asterius_version = "0.0.1"
8 changes: 5 additions & 3 deletions examples/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,17 @@ rules_haskell_dependencies()

load("@rules_haskell//haskell:nixpkgs.bzl", "haskell_register_ghc_nixpkgs")

GHC_VERSION = "9.4.8"

haskell_register_ghc_nixpkgs(
attribute_path = "haskell.compiler.ghc946",
attribute_path = "haskell.compiler.ghc{}".format(GHC_VERSION.replace(".", "")),
repository = "@rules_haskell//nixpkgs:default.nix",
version = "9.4.6",
version = GHC_VERSION,
)

load("@rules_haskell//haskell:toolchain.bzl", "rules_haskell_toolchains")

rules_haskell_toolchains(version = "9.4.6")
rules_haskell_toolchains(version = GHC_VERSION)

load("@rules_nixpkgs_cc//:cc.bzl", "nixpkgs_cc_configure")
load("@rules_nixpkgs_python//:python.bzl", "nixpkgs_python_configure")
Expand Down
2 changes: 1 addition & 1 deletion haskell/ghc.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# (see stackage.org).

# Currently, we are using GHC 9.2.x as default.
DEFAULT_GHC_VERSION = "9.4.6"
DEFAULT_GHC_VERSION = "9.4.8"
3 changes: 3 additions & 0 deletions haskell/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ def rules_haskell_dependencies():
strip_prefix = strip_prefix + "/core",
urls = [rules_nixpkgs_url],
sha256 = _rules_nixpkgs_sha256,
# work around invalid path on Windows
patches = ["@rules_haskell//:rules_nixpkgs_core_bazelignore.patch"],
patch_args = ["-p1"],
)

for toolchain in ["cc", "java", "python", "go", "rust", "posix", "nodejs"]:
Expand Down
15 changes: 15 additions & 0 deletions registry/modules/rules_nixpkgs_core/0.12.0/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module(
name = "rules_nixpkgs_core",
version = "0.12.0",
)

bazel_dep(name = "platforms", version = "0.0.4")
bazel_dep(name = "bazel_skylib", version = "1.0.3")

nix_repo = use_extension("//extensions:repository.bzl", "nix_repo")
nix_repo.github(
name = "nixpkgs",
tag = "24.05",
sha256 = "911314b81780f26fdaf87e17174210bdbd40c86bac1795212f257cdc236a1e78",
)
use_repo(nix_repo, "nixpkgs")
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
diff --git a/.bazelignore b/.bazelignore
index a61f183..850ed9f 100644
--- a/.bazelignore
+++ b/.bazelignore
@@ -1,2 +1,2 @@
-bazel-*
+bazel-core
testing
9 changes: 9 additions & 0 deletions registry/modules/rules_nixpkgs_core/0.12.0/source.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"integrity": "sha256-GtsE3AQWkV/vQndX9CcsT32s7+zu78UPaDrsf36beHo=",
"strip_prefix": "rules_nixpkgs-0.12.0/core",
"url": "https://github.com/tweag/rules_nixpkgs/releases/download/v0.12.0/rules_nixpkgs-0.12.0.tar.gz",
"patch_strip": 1,
"patches": {
"bazelignore.patch": "sha256-ZfaE3Ej4NpUIV8jh/pOrZ5WIVPmYE7zrqIv7jGbxgYc="
}
}
17 changes: 17 additions & 0 deletions registry/modules/rules_nixpkgs_core/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"homepage": "",
"maintainers": [
{
"email": "[email protected] ",
"github": "benradf",
"name": "Benjamin Radford"
},
{
"email": "[email protected]",
"github": "aherrmann",
"name": "Andreas Herrmann"
}
],
"versions": ["0.12.0"],
"yanked_versions": []
}
6 changes: 4 additions & 2 deletions rules_haskell_nix/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@ nix_haskell_toolchains = use_extension(
"nix_haskell_toolchains",
)

GHC_VERSION = "9.4.8"

# Declare a default nix-based toolchain
nix_haskell_toolchains.new(
attribute_path = "",
nix_file_content = """with import <nixpkgs> {}; haskell.packages.ghc946.ghc""",
nix_file_content = "with import <nixpkgs> {{}}; haskell.packages.ghc{}.ghc".format(GHC_VERSION.replace(".", "")),
repository = "@nixpkgs_default",
version = "9.4.6",
version = GHC_VERSION,
)
use_repo(
nix_haskell_toolchains,
Expand Down
10 changes: 3 additions & 7 deletions rules_haskell_tests/.ghcide
Original file line number Diff line number Diff line change
@@ -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" "$@"
12 changes: 10 additions & 2 deletions rules_haskell_tests/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ bazel_dep(
name = "rules_nixpkgs_nodejs",
version = "0.12.0",
)
single_version_override(
module_name = "rules_nixpkgs_nodejs",
patch_strip = 3,
patches = [
"rules_nixpkgs_nodejs-bazelignore.patch",
],
)

bazel_dep(
name = "platforms",
version = "0.0.10",
Expand Down Expand Up @@ -257,7 +265,7 @@ haskell_toolchains = use_extension(
"haskell_toolchains",
)

test_ghc_version = "9.4.6"
test_ghc_version = "9.4.8"

test_ghcopts = [
"-XStandaloneDeriving", # Flag used at compile time
Expand Down Expand Up @@ -328,7 +336,7 @@ nix_haskell_toolchains.new(
cabalopts = test_cabalopts,
ghcopts = test_ghcopts,
haddock_flags = test_haddock_flags,
nix_file_content = """with import <nixpkgs> {}; haskell.packages.ghc946.ghc""",
nix_file_content = "with import <nixpkgs> {{}}; haskell.packages.ghc{}.ghc".format(test_ghc_version.replace(".", "")),
repl_ghci_args = test_repl_ghci_args,
repository = "@nixpkgs_default",
version = test_ghc_version,
Expand Down
Loading
Loading