Skip to content

Commit b096367

Browse files
Update build configuration to bazel 6
1 parent 4055ed9 commit b096367

File tree

13 files changed

+80
-72
lines changed

13 files changed

+80
-72
lines changed

.bazelrc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
build --host_javabase=@local_jdk//:jdk
21
build --host_platform=@io_tweag_rules_nixpkgs//nixpkgs/platforms:host
32
build --compilation_mode opt
43
run --compilation_mode opt
4+
5+
build --java_runtime_version=11
6+
build --java_language_version=11
7+
build --tool_java_language_version=11
8+
build --tool_java_runtime_version=11
9+
build --experimental_strict_java_deps=off
10+
511
#build --build_tag_filters=-only_with_ghc_9_0_1
612
#build --test_tag_filters=-only_with_ghc_9_0_1
713

WORKSPACE

Lines changed: 60 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,61 @@ workspace(name = "io_tweag_inline_java")
22

33
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
44

5+
56
http_archive(
67
name = "rules_haskell",
7-
sha256 = "2b36e26fde296dc9fbaeed087c898fdce23af0247592e897c317d19345b0e259",
8-
strip_prefix = "rules_haskell-7a7f8545789dc4f3bc0780d5725e1337bb494ea6",
9-
urls = ["https://github.com/tweag/rules_haskell/archive/7a7f8545789dc4f3bc0780d5725e1337bb494ea6.zip"],
8+
sha256 = "4cae22bc84f327bf3cb7605021c3663160ff6bc8a0b7b6266062366bcbd19e79",
9+
strip_prefix = "rules_haskell-1.0",
10+
urls = ["https://github.com/tweag/rules_haskell/releases/download/v1.0/rules_haskell-1.0.tar.gz"],
1011
)
1112

1213
load("@rules_haskell//haskell:repositories.bzl", "rules_haskell_dependencies")
1314
rules_haskell_dependencies()
1415

15-
load(
16-
"@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl",
17-
"nixpkgs_local_repository",
18-
"nixpkgs_package",
19-
"nixpkgs_python_configure",
16+
17+
18+
http_archive(
19+
name = "io_tweag_rules_nixpkgs",
20+
sha256 = "30271f7bd380e4e20e4d7132c324946c4fdbc31ebe0bbb6638a0f61a37e74397",
21+
strip_prefix = "rules_nixpkgs-0.13.0",
22+
urls = ["https://github.com/tweag/rules_nixpkgs/releases/download/v0.13.0/rules_nixpkgs-0.13.0.tar.gz"],
23+
)
24+
25+
http_archive(
26+
name = "rules_nixpkgs_core",
27+
sha256 = "30271f7bd380e4e20e4d7132c324946c4fdbc31ebe0bbb6638a0f61a37e74397",
28+
strip_prefix = "rules_nixpkgs-0.13.0/core",
29+
urls = ["https://github.com/tweag/rules_nixpkgs/releases/download/v0.13.0/rules_nixpkgs-0.13.0.tar.gz"],
2030
)
2131

32+
33+
[
34+
http_archive(
35+
name = "rules_nixpkgs_" + toolchain,
36+
sha256 = "30271f7bd380e4e20e4d7132c324946c4fdbc31ebe0bbb6638a0f61a37e74397",
37+
strip_prefix = "rules_nixpkgs-0.13.0/toolchains/" + toolchain,
38+
urls = ["https://github.com/tweag/rules_nixpkgs/releases/download/v0.13.0/rules_nixpkgs-0.13.0.tar.gz"],
39+
)
40+
for toolchain in [
41+
"go",
42+
]
43+
]
44+
45+
46+
load("@rules_nixpkgs_core//:nixpkgs.bzl", "nixpkgs_local_repository")
47+
2248
nixpkgs_local_repository(
2349
name = "nixpkgs",
2450
nix_file = "//:nixpkgs.nix",
2551
)
2652

27-
nixpkgs_python_configure(repository = "@nixpkgs")
28-
29-
nixpkgs_package(
30-
name = "alex",
31-
attribute_path = "haskellPackages.alex",
32-
repository = "@nixpkgs",
53+
load(
54+
"@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl",
55+
"nixpkgs_package",
56+
"nixpkgs_python_configure",
3357
)
3458

35-
#nixpkgs_package(
36-
# name = "stack_ignore_global_hints",
37-
# attribute_path = "stack_ignore_global_hints",
38-
# repository = "@nixpkgs",
39-
#)
40-
#
41-
#load("//:config_settings/setup.bzl", "config_settings")
42-
#config_settings(name = "config_settings")
43-
#load("@config_settings//:info.bzl", "ghc_version")
59+
nixpkgs_python_configure(repository = "@nixpkgs")
4460

4561
load("@rules_haskell//haskell:cabal.bzl", "stack_snapshot")
4662

@@ -144,7 +160,7 @@ haskell_register_ghc_nixpkgs(
144160
locale_archive = "@glibc_locales//:locale-archive",
145161
repositories = {"nixpkgs": "@nixpkgs"},
146162
version = "9.0.2",
147-
compiler_flags = [
163+
ghcopts = [
148164
"-Werror",
149165
"-Wall",
150166
"-Wcompat",
@@ -256,49 +272,44 @@ maven_install(
256272

257273
# gazelle setup
258274

259-
http_archive(
260-
name = "rules_nixpkgs_go",
261-
sha256 = "30271f7bd380e4e20e4d7132c324946c4fdbc31ebe0bbb6638a0f61a37e74397",
262-
strip_prefix = "rules_nixpkgs-0.13.0/toolchains/go",
263-
urls = ["https://github.com/tweag/rules_nixpkgs/releases/download/v0.13.0/rules_nixpkgs-0.13.0.tar.gz"],
264-
)
265-
266275
http_archive(
267276
name = "io_bazel_rules_go",
268-
sha256 = "f2dcd210c7095febe54b804bb1cd3a58fe8435a909db2ec04e31542631cf715c",
277+
sha256 = "130739704540caa14e77c54810b9f01d6d9ae897d53eedceb40fd6b75efc3c23",
269278
urls = [
270-
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.31.0/rules_go-v0.31.0.zip",
271-
"https://github.com/bazelbuild/rules_go/releases/download/v0.31.0/rules_go-v0.31.0.zip",
279+
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.54.1/rules_go-v0.54.1.zip",
280+
"https://github.com/bazelbuild/rules_go/releases/download/v0.54.1/rules_go-v0.54.1.zip",
272281
],
273282
)
274283

284+
load("@rules_nixpkgs_go//:go.bzl", "nixpkgs_go_configure")
285+
286+
nixpkgs_go_configure(repository = "@nixpkgs")
287+
288+
275289
http_archive(
276290
name = "bazel_gazelle",
277-
sha256 = "de69a09dc70417580aabf20a28619bb3ef60d038470c7cf8442fafcf627c21cb",
291+
sha256 = "49b14c691ceec841f445f8642d28336e99457d1db162092fd5082351ea302f1d",
278292
urls = [
279-
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz",
280-
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz",
293+
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.44.0/bazel-gazelle-v0.44.0.tar.gz",
294+
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.44.0/bazel-gazelle-v0.44.0.tar.gz",
281295
],
282296
)
283297

284298
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")
285299

286-
############################################################
287-
# Define your own dependencies here using go_repository.
288-
# Else, dependencies declared by rules_go/gazelle will be used.
289-
# The first declaration of an external repository "wins".
290-
############################################################
291-
292-
load("@rules_nixpkgs_go//:go.bzl", "nixpkgs_go_configure")
293-
294-
nixpkgs_go_configure(
295-
repository = "@nixpkgs",
296-
)
297-
298300
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
299301

300302
go_rules_dependencies()
301303

304+
305+
# go_repository added due to: https://github.com/bazelbuild/bazel-gazelle/issues/1217
306+
go_repository(
307+
name = "org_golang_x_xerrors",
308+
importpath = "golang.org/x/xerrors",
309+
sum = "h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=",
310+
version = "v0.0.0-20200804184101-5ec99f83aff1",
311+
)
312+
302313
gazelle_dependencies()
303314

304315

@@ -313,9 +324,3 @@ load("@rules_haskell//haskell:cabal.bzl", "stack_snapshot")
313324
load("@io_tweag_gazelle_cabal//:defs.bzl", "gazelle_cabal_dependencies")
314325
gazelle_cabal_dependencies()
315326

316-
go_repository(
317-
name = "org_golang_x_xerrors",
318-
importpath = "golang.org/x/xerrors",
319-
sum = "h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=",
320-
version = "v0.0.0-20200804184101-5ec99f83aff1",
321-
)

benchmarks/wizzardo-http/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ haskell_binary(
2828
name = "wizzardo-http-benchmark",
2929
srcs = glob(['src/main/**/*.hs']),
3030
extra_srcs = ["@openjdk//:rpath"],
31-
compiler_flags = [
31+
ghcopts = [
3232
"-optl-Wl,@$(location @openjdk//:rpath)",
3333
"-threaded",
3434
"-rtsopts",

examples/classpath/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ haskell_binary(
1818
name = "classpath",
1919
srcs = ['Main.hs'],
2020
extra_srcs = ["@openjdk//:rpath"],
21-
compiler_flags = [
21+
ghcopts = [
2222
"-optl-Wl,@$(location @openjdk//:rpath)",
2323
"-threaded",
2424
],

examples/directory-server/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ haskell_binary(
77
name = "directory-server",
88
srcs = glob(['src/**/*.hs']),
99
extra_srcs = ["@openjdk//:rpath"],
10-
compiler_flags = [
10+
ghcopts = [
1111
"-optl-Wl,@$(location @openjdk//:rpath)",
1212
"-threaded",
1313
],

examples/hello/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ haskell_binary(
77
name = "hello-java",
88
srcs = ['hello-java.hs'],
99
extra_srcs = ["@openjdk//:rpath"],
10-
compiler_flags = [
10+
ghcopts = [
1111
"-optl-Wl,@$(location @openjdk//:rpath)",
1212
"-threaded",
1313
],

jvm-batching/benchmarks/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ haskell_binary(
77
name = "bench",
88
srcs = glob(['**/*.hs']),
99
extra_srcs = ["@openjdk//:rpath"],
10-
compiler_flags = [
10+
ghcopts = [
1111
"-optl-Wl,@$(location @openjdk//:rpath)",
1212
"-threaded",
1313
],

jvm-batching/src/test/haskell/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ haskell_test(
77
name = "spec",
88
srcs = glob(["**/*.hs"]),
99
extra_srcs = ["@openjdk//:rpath"],
10-
compiler_flags = [
10+
ghcopts = [
1111
"-optl-Wl,@$(location @openjdk//:rpath)",
1212
"-DHSPEC_DISCOVER=$(location @hspec-discover//:bin)",
1313
"-threaded",

jvm-streaming/benchmarks/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ haskell_binary(
88
srcs = glob(['**/*.hs'], exclude = ["Main.hs"]),
99
main_file = "MainBazel.hs",
1010
extra_srcs = ["@openjdk//:rpath"],
11-
compiler_flags = [
11+
ghcopts = [
1212
"-optl-Wl,@$(location @openjdk//:rpath)",
1313
"-threaded",
1414
],

jvm-streaming/src/test/haskell/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ haskell_test(
88
srcs = glob(["**/*.hs"], exclude = ["Main.hs"]),
99
main_file = "MainBazel.hs",
1010
extra_srcs = ["@openjdk//:rpath"],
11-
compiler_flags = [
11+
ghcopts = [
1212
"-optl-Wl,@$(location @openjdk//:rpath)",
1313
"-DHSPEC_DISCOVER=$(location @hspec-discover//:bin)",
1414
"-threaded",

0 commit comments

Comments
 (0)