Force package download when packages are present on target container image #2267
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ensure that requested packages are downloaded, even if present on the build host. This enables the build rules to declare their necessary package dependencies without having the knowledge of whether they are present on the specific build host which is running the bazel command.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
When defining package dependencies, the generate downloads script fails if the requested packages are already present on the host docker image.
Issue Number: N/A
What is the new behavior?
Declared packages are always downloaded into the temporary Dir::Cache directory regardless of whether the binaries are present on the target machine or not.
Does this PR introduce a breaking change?
Other information
Sometimes these base docker images and the software installed into them are often maintained by different teams and when the download packages script fails due to dependencies already being present it requires coordination between both teams to ensure that a mutually exclusive set of dependencies is installed in the host env vs. declared in the package dependencies in the software system's bazel target.
New tests were not added, but I tested the behavior with this newly added --reinstall command line flag.