Skip to content
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

zip: command not found failing tests #24056

Closed
freeform-andre opened this issue Oct 22, 2024 · 6 comments
Closed

zip: command not found failing tests #24056

freeform-andre opened this issue Oct 22, 2024 · 6 comments
Labels
team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website type: bug untriaged

Comments

@freeform-andre
Copy link

freeform-andre commented Oct 22, 2024

Description of the bug:

Tests which use TEST_UNDECLARED_OUTPUTS_DIR are failing with the following after upgrading to Bazel 7.4.0

external/bazel_tools/tools/test/test-setup.sh: line 428: zip: command not found

Which category does this issue belong to?

No response

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Uninstall the zip program from your linux worker and run a test which uses TEST_UNDECLARED_OUTPUTS_DIR.

Which operating system are you running Bazel on?

linux

What is the output of bazel info release?

release 7.4.0

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse HEAD ?

No response

If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.

Tests pass in 7.3.2

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

No response

@satyanandak satyanandak added the team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website label Oct 23, 2024
@freeform-andre freeform-andre changed the title zip: command not found zip: command not found failing tests Oct 23, 2024
@fmeum
Copy link
Collaborator

fmeum commented Oct 23, 2024

Did you upgrade from 7.3.2? The only change to the script since then seems to be 7a18311, which can't really be the cause of the regression.

Since zipping up the outputs has always required zip, are you disabling zipping in your .bazelrc?

@fmeum
Copy link
Collaborator

fmeum commented Oct 23, 2024

@iancha1992

@freeform-andre
Copy link
Author

Did you upgrade from 7.3.2?

Yeah

Since zipping up the outputs has always required zip, are you disabling zipping in your .bazelrc?

Users will occasionally use --nozip_undeclared_test_outputs but otherwise the the default is being used.

@tjgq
Copy link
Contributor

tjgq commented Oct 23, 2024

I consider this WAI: as Fabian said, it has always been the case that an external zip tool must be available in the PATH when using --zip_undeclared_outputs. I don't have a theory for why it started failing in 7.4.0; you could run a bazelisk --bisect if you're curious enough to track it down. The default is going to change to no zipping in 8.0.0.

@jwnimmer-tri
Copy link
Contributor

jwnimmer-tri commented Oct 25, 2024

I don't have a theory for why it started failing in 7.4.0; ...

See #23479. In recent bazel versions < 7.4, when zip was missing, bazel did not report a failure to user but instead just deleted all of the undeclared outputs. (IIRC in 2023 and earlier, when zip was missing it just didn't zip, but did keep around the undeclared outputs, unzipped.)

In any case, it sounds like this will be moot for >= 8.

@tjgq
Copy link
Contributor

tjgq commented Oct 25, 2024

Thanks @jwnimmer-tri for identifying the cause! Somewhat embarrassingly, I was the one who fixed that issue, but had no memory of it :)

@tjgq tjgq closed this as not planned Won't fix, can't repro, duplicate, stale Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website type: bug untriaged
Projects
None yet
Development

No branches or pull requests

7 participants