-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
fix(python): Set envvar for runfiles manifest, not runfiles dir, when using a manifest #17722
Conversation
@rickeylev Could you review? |
@bazel-io flag |
Can we add a test for this? In src/test/shell/integration/python_stub_test.sh, we can easily plug in a no-op interpreter that just prints env, then grep for the RUNFILES_MANIFEST_FILE. I think we just need to set |
@rickeylev Started working on the test, but I can't figure out how to build an input but not an output manifest. |
Hmm....yeah I don't see a way to generate only one and not the other. Maybe it's specific to certain platforms? Or maybe if...ah, what if it's running from a zip file? CreateModuleSpace() will unzip to a temp directory. The zip will contain MANIFEST, but the temp directory won't have .runfiles_manifest In the original issue description, they manually copy the runfiles tree elsewhere and run, which is approximately the same as unzipping elsewhere. I also think it'd be fine to just delete the .runfiles_manifest manually. It's effectively the same as the other two approaches, just with less copy+pasting of things around. Let's just put a comment in the test about the case we're trying to reproduce; it'll look pretty funny deleting files from the output tree like that. |
@bazel-io fork 6.2.0 |
@rickeylev I tried to get this to work but noticed that I can't come up with a scenario in which the change becomes relevant: In ZIP-based builds the incorrect branch isn't reached since |
Ah darn. Ok, well, lets just go back to the other ideas:
If none of that works, well, lets just omit the tests, because we can't figure out a way to test it, which is fine. That line of code is obviously wrong. |
Hi @fmeum @rickeylev we're planning to start creating RCs for 6.2.0 on 4/24. Checking if we still want to include this? |
@rickeylev I couldn't figure out how to reproduce this situation in tests, even with these ideas. I added the returns comment and your suggestions. |
re: LocalDiffAwarenessIntegrationTest failure -- no idea what that is or why it would fail. Looking at the test, I don't see any mention of Python in it. I'm guessing its flaky mac test. I pressed retry. In any case, I'd say this is fine to begin importing. Our internal test infrastructure will handle flaky tests better. |
… using a manifest (#18133) Unfortunately, we weren't able to find a way to reproduce the reported bug in a test environment, but the line of code in question is obviously wrong, so we'll just omit a test to cover this. Fixes #17675 Closes #17722. PiperOrigin-RevId: 525044539 Change-Id: I7e1eaa14eac1d4dabcdcf93d92720c41977b1fe2 Co-authored-by: Fabian Meumertzheim <fabian@meumertzhe.im>
… using a manifest Unfortunately, we weren't able to find a way to reproduce the reported bug in a test environment, but the line of code in question is obviously wrong, so we'll just omit a test to cover this. Fixes bazelbuild#17675 Closes bazelbuild#17722. PiperOrigin-RevId: 525044539 Change-Id: I7e1eaa14eac1d4dabcdcf93d92720c41977b1fe2
Fixes #17675