Skip to content

Commit

Permalink
Bump lockfile version
Browse files Browse the repository at this point in the history
  • Loading branch information
fmeum committed Feb 8, 2024
1 parent 4b39195 commit 446d866
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 7 deletions.
8 changes: 4 additions & 4 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions scripts/bootstrap/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,10 @@ EOF
link_file "${PWD}/src/MODULE.tools" "${BAZEL_TOOLS_REPO}/MODULE.bazel"
new_hash=$(shasum -a 256 "${BAZEL_TOOLS_REPO}/MODULE.bazel" | awk '{print $1}')
sed -i.bak "/\"bazel_tools\":/s/\"[a-f0-9]*\"/\"$new_hash\"/" MODULE.bazel.lock
# TODO: Temporary hack for lockfile version mismatch, remove these lines after updating to 7.1.0
sed -i.bak 's/"lockFileVersion": 3/"lockFileVersion": 4/' MODULE.bazel.lock
# Replace canonical repository names and parts thereof of the form rules_foo~1.2.3 with rules_foo~
sed -i.bak -E 's/([a-z]([a-z0-9._-]*[a-z0-9]){0,1})~[a-zA-Z0-9.]{1,}(-[0-9.-]{1,}){0,1}(\+[0-9.-]{1,}){0,1}/\1/g' MODULE.bazel.lock
rm MODULE.bazel.lock.bak

mkdir -p "${BAZEL_TOOLS_REPO}/src/conditions"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
@GenerateTypeAdapter
public abstract class BazelLockFileValue implements SkyValue, Postable {

public static final int LOCK_FILE_VERSION = 3;
public static final int LOCK_FILE_VERSION = 4;

@SerializationConstant public static final SkyKey KEY = () -> SkyFunctions.BAZEL_LOCK_FILE;

Expand Down
4 changes: 4 additions & 0 deletions src/test/shell/bazel/bazel_determinism_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ function test_determinism() {
# Update the hash of bazel_tools in lockfile to avoid rerunning module resolution.
new_hash=$(shasum -a 256 "src/MODULE.tools" | awk '{print $1}')
sed -i.bak "/\"bazel_tools\":/s/\"[a-f0-9]*\"/\"$new_hash\"/" MODULE.bazel.lock
# TODO: Temporary hack for lockfile version mismatch, remove these lines after updating to 7.1.0
sed -i.bak 's/"lockFileVersion": 3/"lockFileVersion": 4/' MODULE.bazel.lock
# Replace canonical repository names and parts thereof of the form rules_foo~1.2.3 with rules_foo~
sed -i.bak -E 's/([a-z]([a-z0-9._-]*[a-z0-9]){0,1})~[a-zA-Z0-9.]{1,}(-[0-9.-]{1,}){0,1}(\+[0-9.-]{1,}){0,1}/\1/g' MODULE.bazel.lock
rm MODULE.bazel.lock.bak

# Use @bazel_tools//tools/python:autodetecting_toolchain to avoid
Expand Down
2 changes: 1 addition & 1 deletion src/test/tools/bzlmod/MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/tools/bzlmod/utils.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def parse_http_artifacts(ctx, lockfile_path, required_repos):

for extension_id, extension_entry in lockfile["moduleExtensions"].items():
if extension_id.startswith("@@"):
# @@rules_foo~1.2.3//:extensions.bzl%foo --> rules_foo~1.2.3
# @@rules_foo~//:extensions.bzl%foo --> rules_foo~
module_repo_name = extension_id.removeprefix("@@").partition("//")[0]
else:
# //:extensions.bzl%foo --> _main
Expand Down

0 comments on commit 446d866

Please sign in to comment.