-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bundler: Fix for prefetching of dependencies
Some dependencies contain architecture-specific components. Their name and location differ from standard Ruby-only dependencies. As a result prior to this commit such dependencies would be skipped during prefetch. This, in turn, failed hermetic builds because a dependency would end up missing. Corresponding upstream issue: #672 This commit fixes the issue and adds e2e tests. Signed-off-by: Alexey Ovchinnikov <[email protected]>
- Loading branch information
1 parent
93915e7
commit ca5d99c
Showing
11 changed files
with
317 additions
and
14 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
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
25 changes: 25 additions & 0 deletions
25
tests/integration/test_data/bundler_everything_present/container/Containerfile
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,25 @@ | ||
FROM docker.io/ruby:3.3 | ||
|
||
# Test disabled network access | ||
RUN if curl -IsS www.google.com; then echo "Has network access!"; exit 1; fi | ||
|
||
# Print cachi2 env vars file | ||
RUN cat /tmp/cachi2.env | ||
|
||
# Check bundler deps | ||
RUN ls /tmp/bundler_everything_present-output/deps/bundler | ||
|
||
# Check content of source repository folder | ||
RUN ls /tmp/bundler_everything_present-source/ | ||
|
||
# This should be a COPY, but the source code and Containerfile are in different directories | ||
RUN cp -r /tmp/bundler_everything_present-source /src | ||
|
||
WORKDIR /src | ||
# Bundler would try and install whichever version was used to generate | ||
# This will cause bundler to attempt to download an earlier version even if | ||
# just microversions diverged. This, int turn, would cause a build to fail. | ||
# Running 'bundle _<version>_ install' is supposed to attempt to run installation | ||
# with this specific version. The extra code below ensures that any present | ||
# version is used: | ||
RUN . /tmp/cachi2.env && bundle --version | cut -d ' ' -f3- | xargs -I {} bundle _{}_ install |
25 changes: 25 additions & 0 deletions
25
...s/integration/test_data/bundler_everything_present_except_gemspec/container/Containerfile
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,25 @@ | ||
FROM docker.io/ruby:3.3 | ||
|
||
# Test disabled network access | ||
RUN if curl -IsS www.google.com; then echo "Has network access!"; exit 1; fi | ||
|
||
# Print cachi2 env vars file | ||
RUN cat /tmp/cachi2.env | ||
|
||
# Check bundler deps | ||
RUN ls /tmp/bundler_everything_present_except_gemspec-output/deps/bundler | ||
|
||
# Check content of source repository folder | ||
RUN ls /tmp/bundler_everything_present_except_gemspec-source/ | ||
|
||
# This should be a COPY, but the source code and Containerfile are in different directories | ||
RUN cp -r /tmp/bundler_everything_present_except_gemspec-source /src | ||
|
||
WORKDIR /src | ||
# Bundler would try and install whichever version was used to generate | ||
# This will cause bundler to attempt to download an earlier version even if | ||
# just microversions diverged. This, int turn, would cause a build to fail. | ||
# Running 'bundle _<version>_ install' is supposed to attempt to run installation | ||
# with this specific version. The extra code below ensures that any present | ||
# version is used: | ||
RUN . /tmp/cachi2.env && bundle --version | cut -d ' ' -f3- | xargs -I {} bundle _{}_ install |
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.