-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bzlmod: adding basic lock file support
Adding a very basic lock file support, we don't generate the lock file yet, this will come in the future. It allows reducing complexity from MODULE.bazel though
- Loading branch information
1 parent
7fce2de
commit 7917ec9
Showing
9 changed files
with
169 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Import Aspect bazelrc presets | ||
try-import %workspace%/../../.aspect/bazelrc/bazel7.bazelrc | ||
import %workspace%/../../.aspect/bazelrc/bazel6.bazelrc | ||
import %workspace%/../../.aspect/bazelrc/convenience.bazelrc | ||
import %workspace%/../../.aspect/bazelrc/correctness.bazelrc | ||
import %workspace%/../../.aspect/bazelrc/debug.bazelrc | ||
import %workspace%/../../.aspect/bazelrc/performance.bazelrc | ||
|
||
common --enable_bzlmod | ||
|
||
# Specific project flags go here if we have some | ||
|
||
# Load any settings & overrides specific to the current user from `.bazelrc.user`. | ||
# This file should appear in `.gitignore` so that settings are not shared with team members. This | ||
# should be last statement in this config so the user configuration is able to overwrite flags from | ||
# this file. See https://bazel.build/configure/best-practices#bazelrc-file. | ||
try-import %workspace%/../../.bazelrc.user |
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,37 @@ | ||
load("@bazeldnf//bazeldnf:defs.bzl", "bazeldnf", "rpmtree", "tar2files") | ||
load("@rules_pkg//pkg:tar.bzl", "pkg_tar") | ||
|
||
bazeldnf( | ||
name = "bazeldnf", | ||
) | ||
|
||
rpmtree( | ||
name = "something", | ||
rpms = [ | ||
"@bazeldnf-rpms//libvirt-libs", | ||
"@bazeldnf-rpms//libvirt-devel-6.1.0-2.fc32.x86_64.rpm", | ||
"@rpms-with-no-name-attribute//libvirt-libs-6.1.0-2.fc32.x86_64.rpm", | ||
], | ||
) | ||
|
||
tar2files( | ||
name = "something_libs", | ||
files = { | ||
"/usr/lib64": [ | ||
"libvirt.so.0", | ||
"libvirt.so.0.6001.0", | ||
], | ||
}, | ||
tar = ":something", | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
pkg_tar( | ||
name = "whatever", | ||
deps = [":something"], | ||
) | ||
|
||
cc_library( | ||
name = "bar", | ||
srcs = ["//:something_libs/usr/lib64"], | ||
) |
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,20 @@ | ||
"example MODULE.bazel to test bzlmod integration for bazeldnf with a prebuilt toolchain" | ||
|
||
module(name = "example-bazeldnf-with-bzlmod-lock-file") | ||
|
||
bazel_dep(name = "bazeldnf") | ||
local_path_override( | ||
module_name = "bazeldnf", | ||
path = "../..", | ||
) | ||
|
||
bazel_dep(name = "rules_pkg", version = "1.0.1") | ||
|
||
bazeldnf = use_extension("@bazeldnf//bazeldnf:extensions.bzl", "bazeldnf") | ||
bazeldnf.config(lock_file = "//:rpms.json") | ||
bazeldnf.config(lock_file = "//:rpms-with-no-name-attribute.json") | ||
use_repo( | ||
bazeldnf, | ||
"bazeldnf-rpms", | ||
"rpms-with-no-name-attribute", | ||
) |
Empty file.
12 changes: 12 additions & 0 deletions
12
e2e/bazel-bzlmod-lock-file/rpms-with-no-name-attribute.json
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,12 @@ | ||
{ | ||
"rpms": [ | ||
{ | ||
"sha256": "3a0a3d88c6cb90008fbe49fe05e7025056fb9fa3a887c4a78f79e63f8745c845", | ||
"urls": [ | ||
"https://download-ib01.fedoraproject.org/pub/fedora/linux/releases/32/Everything/x86_64/os/Packages/l/libvirt-libs-6.1.0-2.fc32.x86_64.rpm", | ||
"https://storage.googleapis.com/builddeps/3a0a3d88c6cb90008fbe49fe05e7025056fb9fa3a887c4a78f79e63f8745c845" | ||
] | ||
|
||
} | ||
] | ||
} |
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,21 @@ | ||
{ | ||
"name": "bazeldnf-rpms", | ||
"rpms": [ | ||
{ | ||
"name": "libvirt-libs", | ||
"sha256": "3a0a3d88c6cb90008fbe49fe05e7025056fb9fa3a887c4a78f79e63f8745c845", | ||
"urls": [ | ||
"https://download-ib01.fedoraproject.org/pub/fedora/linux/releases/32/Everything/x86_64/os/Packages/l/libvirt-libs-6.1.0-2.fc32.x86_64.rpm", | ||
"https://storage.googleapis.com/builddeps/3a0a3d88c6cb90008fbe49fe05e7025056fb9fa3a887c4a78f79e63f8745c845" | ||
] | ||
|
||
}, | ||
{ | ||
"sha256": "2ebb715341b57a74759aff415e0ff53df528c49abaa7ba5b794b4047461fa8d6", | ||
"urls": [ | ||
"https://download-ib01.fedoraproject.org/pub/fedora/linux/releases/32/Everything/x86_64/os/Packages/l/libvirt-devel-6.1.0-2.fc32.x86_64.rpm", | ||
"https://storage.googleapis.com/builddeps/2ebb715341b57a74759aff415e0ff53df528c49abaa7ba5b794b4047461fa8d6" | ||
] | ||
} | ||
] | ||
} |