-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #320 from tweag/bzlmod-java
Separate toolchains/java tests and run with bzlmod enabled
- Loading branch information
Showing
26 changed files
with
176 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
build:bzlmod --enable_bzlmod | ||
|
||
build --host_platform=@rules_nixpkgs_core//platforms:host | ||
|
||
# User Configuration | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Local Bazel Registry for rules\_nixpkgs modules | ||
|
||
This [local Bazel registry][registry] is only intended for testing and local | ||
development purposes. The rules\_nixpkgs repository is split into multiple | ||
Bazel modules that may depend on each other. Unfortunately, overrides such as | ||
`local_path_override` are only allowed in the main module, and command-line | ||
configuration like `--override_module` is difficult to configure correctly | ||
since it does not support relative paths. Instead, we use a local registry. | ||
|
||
[registry]: https://bazel.build/external/registry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"mirrors": [], | ||
"module_base_path": ".." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../core/MODULE.bazel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"type": "local_path", | ||
"path": "core" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"homepage": "", | ||
"maintainers": [], | ||
"versions": ["0.9.0"], | ||
"yanked_versions": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../.bazelrc |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
module(name = "rules_nixpkgs_java_testing") | ||
|
||
bazel_dep(name = "rules_nixpkgs_java") | ||
local_path_override( | ||
module_name = "rules_nixpkgs_java", | ||
path = "../../toolchains/java", | ||
) | ||
|
||
bazel_dep(name = "rules_nixpkgs_core") | ||
local_path_override( | ||
module_name = "rules_nixpkgs_core", | ||
path = "../../core", | ||
) | ||
|
||
bazel_dep(name = "bazel_skylib", version = "1.0.3") | ||
|
||
# TODO[AH] Remove these transitive dependencies once nixpkgs_java_configure has | ||
# become a module extension in rules_nixpkgs_java. | ||
bazel_dep(name = "platforms", version = "0.0.4") | ||
bazel_dep(name = "rules_java", version = "4.0.0") | ||
|
||
java_toolchains = use_extension("@rules_java//java:extensions.bzl", "toolchains") | ||
use_repo(java_toolchains, "remote_java_tools") | ||
|
||
non_module_deps = use_extension("//:non_module_deps.bzl", "non_module_deps") | ||
use_repo(non_module_deps, "nixpkgs") | ||
use_repo(non_module_deps, "nixpkgs_java_runtime") | ||
use_repo(non_module_deps, "nixpkgs_java_runtime_toolchain") | ||
register_toolchains("@nixpkgs_java_runtime_toolchain//:all") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
workspace(name = "rules_nixpkgs_java_testing") | ||
|
||
local_repository( | ||
name = "rules_nixpkgs_java", | ||
path = "../../toolchains/java", | ||
) | ||
|
||
local_repository( | ||
name = "rules_nixpkgs_core", | ||
path = "../../core", | ||
) | ||
|
||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
|
||
http_archive( | ||
name = "bazel_skylib", | ||
sha256 = "f24ab666394232f834f74d19e2ff142b0af17466ea0c69a3f4c276ee75f6efce", | ||
urls = [ | ||
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.4.0/bazel-skylib-1.4.0.tar.gz", | ||
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.4.0/bazel-skylib-1.4.0.tar.gz", | ||
], | ||
) | ||
|
||
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") | ||
|
||
bazel_skylib_workspace() | ||
|
||
load( | ||
"//tests:nixpkgs_repositories.bzl", | ||
"nixpkgs_repositories", | ||
) | ||
|
||
nixpkgs_repositories(bzlmod = False) |
Empty file.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../docs/nixpkgs.nix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
load( | ||
"//tests:nixpkgs_repositories.bzl", | ||
"nixpkgs_repositories", | ||
) | ||
|
||
def _non_module_deps_impl(ctx): | ||
nixpkgs_repositories(bzlmod = True) | ||
|
||
non_module_deps = module_extension( | ||
implementation = _non_module_deps_impl, | ||
) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
load("@rules_nixpkgs_core//:nixpkgs.bzl", "nixpkgs_local_repository") | ||
load("@rules_nixpkgs_java//:java.bzl", "nixpkgs_java_configure") | ||
|
||
def nixpkgs_repositories(*, bzlmod): | ||
nixpkgs_local_repository( | ||
name = "nixpkgs", | ||
nix_file = "//:nixpkgs.nix", | ||
nix_file_deps = ["//:flake.lock"], | ||
) | ||
|
||
nixpkgs_java_configure( | ||
name = "nixpkgs_java_runtime", | ||
attribute_path = "jdk11.home", | ||
repository = "@nixpkgs", | ||
toolchain = True, | ||
register = not bzlmod, | ||
toolchain_name = "nixpkgs_java", | ||
toolchain_version = "11", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters