-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Store different extensions in lockfile if the extension depends on os…
… and arch Updated the logic to save and fetch module extensions from the lockfile depending on their os and arch dependency. fixes #19154 PiperOrigin-RevId: 564707355 Change-Id: Ib48d7590e6d35397471a4ff46c58226eecf339c2 # Conflicts: # scripts/bootstrap/compile.sh # src/test/py/bazel/bzlmod/bazel_lockfile_test.py # src/test/shell/bazel/bazel_determinism_test.sh
- Loading branch information
Showing
11 changed files
with
347 additions
and
57 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
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
45 changes: 45 additions & 0 deletions
45
src/main/java/com/google/devtools/build/lib/bazel/bzlmod/ModuleExtensionEvalFactors.java
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,45 @@ | ||
// Copyright 2023 The Bazel Authors. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package com.google.devtools.build.lib.bazel.bzlmod; | ||
|
||
import com.google.auto.value.AutoValue; | ||
import com.ryanharter.auto.value.gson.GenerateTypeAdapter; | ||
|
||
/** | ||
* This object holds the evaluation factors for module extensions in the lockfile, such as the | ||
* operating system and architecture it depends on. If an extension has no dependencies in this | ||
* regard, the object remains empty | ||
*/ | ||
@AutoValue | ||
@GenerateTypeAdapter | ||
public abstract class ModuleExtensionEvalFactors { | ||
|
||
/** Returns the OS this extension is evaluated on, or empty if it doesn't depend on the os */ | ||
public abstract String getOs(); | ||
|
||
/** | ||
* Returns the architecture this extension is evaluated on, or empty if it doesn't depend on the | ||
* architecture | ||
*/ | ||
public abstract String getArch(); | ||
|
||
public boolean isEmpty() { | ||
return getOs().isEmpty() && getArch().isEmpty(); | ||
} | ||
|
||
public static ModuleExtensionEvalFactors create(String os, String arch) { | ||
return new AutoValue_ModuleExtensionEvalFactors(os, arch); | ||
} | ||
} |
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
Oops, something went wrong.