deb: keep '/var/lib/apt/lists/' to allow building for Debian unstable#219
Merged
Conversation
This was referenced Feb 19, 2021
tianon
reviewed
Feb 19, 2021
| # and copy the artifacts out), keeping some of the cache files should not be a problem. | ||
| RUN apt-get update -q \ | ||
| && mk-build-deps -t "apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends -y" -i debian/control \ | ||
| && apt-get clean \ |
Contributor
There was a problem hiding this comment.
👀 this is a no-op for sure:
Suggested change
| && apt-get clean \ |
tianon
reviewed
Feb 19, 2021
| && mk-build-deps -t "apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends -y" -i debian/control \ | ||
| && apt-get clean \ | ||
| && rm -rf /var/cache/apt /var/lib/apt/lists/* | ||
| && rm -rf /var/cache/apt |
Contributor
There was a problem hiding this comment.
... which means this is a no-op too (and redundant with apt-get clean in a normal install anyhow)
b46a1bb to
b05a6c3
Compare
tianon
previously approved these changes
Feb 19, 2021
Contributor
tianon
left a comment
There was a problem hiding this comment.
I guess #220 (review) means I give this a transitive LGTM 😅
tianon
reviewed
Feb 19, 2021
Member
Author
|
I'll take your LGTM (CI is 💚) |
b05a6c3 to
e856b50
Compare
Debian "unstable" releases use apt caching information to get the codename see discussion on https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=845651: > That's all to say that this bug is (to my belief) actually expected behaviour; > and fixing it through forcing the codename to be interpreted as "stretch" when > apt-cache information is unavailable would be wrong. When /etc/debian_version > contains "potato/sid", the codename is either potato xor sid, and only apt- > cache can discriminate a testing host from a sid host. Therefore, in such a > situation, the correct answer is actually "I can't tell", aka "n/a". From testing, it reads the information from these files: - /var/lib/apt/lists/deb.debian.org_debian_dists_bullseye_InRelease - /var/lib/apt/lists/deb.debian.org_debian_dists_bullseye_main_binary-amd64_Packages.lz4 Removing these files (`rm -rf /var/lib/apt/lists/*`) causes 'lsb_release -sc` to print 'n/a'. While we could use '/etc/debian_version' as a fallback for our own scripts (stripping everything after '/' (e.g. bullseye/sid -> bullseye), dpkg-buildpackage will still depend on this information to be present, and if not present, renames packages to use 'n/a' in their path: dpkg-buildpackage: info: full upload; Debian-native package (full source is included) renamed '../containerd.io-dbgsym_0.20210219.014044~e58be59-1_amd64.deb' -> '/build/debian/n/a/amd64/containerd.io-dbgsym_0.20210219.014044~e58be59-1_amd64.deb' renamed '../containerd.io_0.20210219.014044~e58be59-1_amd64.deb' -> '/build/debian/n/a/amd64/containerd.io_0.20210219.014044~e58be59-1_amd64.deb' Given that we don't need the final image (as we only use it as a build environment and copy the artifacts out), keeping some of the cache files should not be a problem. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
e856b50 to
726a928
Compare
tiborvass
approved these changes
Feb 22, 2021
This was referenced Feb 22, 2021
thaJeztah
added a commit
to thaJeztah/docker-ce-packaging
that referenced
this pull request
May 19, 2022
Debian "sid" is not an actual distro version. Sid represents the "unstable"
channel ("next stable in-progress"). Currently, it is equivalent to "bullseye",
but once "bullseye" is stable, it becomes "bookworm", "trixy", etc (see the
list of Debian releases at https://wiki.debian.org/DebianReleases).
We should fix this hard-coded override, and instead try to get this name from
information in /var/lib/apt/lists/.
Also see docker/containerd-packaging#219 for details.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
relates to #213 (comment)
Debian "unstable" releases use apt caching information to get the codename
see discussion on https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=845651:
From testing, it reads the information from these files:
Removing these files (
rm -rf /var/lib/apt/lists/*) causes 'lsb_release -sc`to print 'n/a'. While we could use '/etc/debian_version' as a fallback for our
own scripts (stripping everything after '/' (e.g. bullseye/sid -> bullseye),
dpkg-buildpackage will still depend on this information to be present, and
if not present, renames packages to use 'n/a' in their path:
Given that we don't need the final image (as we only use it as a build environment
and copy the artifacts out), keeping some of the cache files should not be a problem.