-
-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: use hermetic tar #385
Conversation
eb2ccf0
to
e1a871e
Compare
hitting a bug in bazel-lib, sent bazel-contrib/bazel-lib#574 |
17ac718
to
85e619c
Compare
85e619c
to
c532892
Compare
79f65ad
to
57c697a
Compare
Thanks @alexeagle , I checked the latest version, works good for my usecase. |
Are there any automated tests that could be extended with checks for this new feature (e.g. gid, uid, time)? |
7383f9f
to
8036ab1
Compare
Looks like |
Forcing users to upgrade to bazel-lib 2.0 is a breaking change, so we're planning to start a 2.x branch here where this can land. |
When using this branch, it fails with this kind of error:
It started happening just recently. It seems there is a new version for this deb... And there is a newer version of bazel-lib (2.5.0), which makes it work. |
Workaround for https://github.com/sourcegraph/devx-support/issues/622. This is portable between both bsdtar and gnutar. On gnutar, this is the default, so this changes nothing for CI builds. This only changes behaviour in macOS with bsdtar. It is unclear to me where a final solution will exist: - An issue was opened upstream in docker/moby, but the latest opinion is that this is an issue with rules_oci _technically_ emitting docker-compatible formats that are incompatible with docker (Im not 100% sure yet that docker itself cant create a tarball that would fail to `docker load`, but I dont want to subject Christoph to more experiments lol) moby/moby#47517 - A PR exists in rules_oci to use a hermetic BSD tar instead of system tar (doesnt work on nixos though coz dynamic libraries :sadge:). It uses `mtree` format to add files, I don't know yet if that works around xattr issue without also passing `--no-xattr` (my current belief is that it does not) bazel-contrib/rules_oci#385 ## Test plan Had Christoph run `bazel run //cmd/batcheshelper:image_tarball`, which succeeded with this patch
Fixes #328 fix: supply mtree file for determinism fix: set tar content times to beginning of this year avoids some tools thinking that 1970 is 'too old' refactor: extract function for mtree lines refactor: cleanup STAGING_DIR chore: bump to bazel-lib 2.0rc chore: remove bazel 5 workaround Bazel-lib 2.0 doesn't include this anymore chore: upgrade stardoc to match bzlmod version ci: test on bazel 7 rather than 5
ebf4b0b
to
d204496
Compare
d204496
to
3f0ee64
Compare
Partial back-port of #385 from the 2.x branch
Partial back-port of #385 from the 2.x branch
Note, this shouldn't land until bazel-lib 2.0 is stable (RC or ideally final)