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

Allow crates_vendor to read the CARGO_BAZEL_DEBUG env var #2862

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

UebelAndre
Copy link
Collaborator

Previously the environment variable was discarded. Now users can see debug info about how crates are being rendered.

@UebelAndre UebelAndre added this pull request to the merge queue Sep 13, 2024
Merged via the queue into bazelbuild:main with commit 07dc023 Sep 13, 2024
4 checks passed
exec env - BAZEL_REAL="${{BAZEL_REAL}}" BUILD_WORKSPACE_DIRECTORY="${{BUILD_WORKSPACE_DIRECTORY}}" PATH="${{PATH}}" {env} \\
"{bin}" {args} "$@"
exec env - \\
${{_ENVIRON[@]}} \\
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this array expansion need to be quoted in order to properly handle paths that contain spaces.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be happy to review a pull-request!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

github-merge-queue bot pushed a commit that referenced this pull request Dec 10, 2024
Slight tweak to the logic in
#2862 (cc: @UebelAndre)

My `$PATH` variable has spaces in it and I hit an error like
```
env: Support/JetBrains/Toolbox/scripts:/Users/ryanpbrewster/.bin:/Users/ryanpbrewster/config/bin:/Users/ryanpbrewster/.local/bin:/Applications/Visual: No such file or directory                                                                     
```

If I manually modify `bazel-bin/rust/crates_vendor.sh` to modify
```
exec env - \
${_ENVIRON[@]} \
```
into
```
exec env - \
"${_ENVIRON[@]}" \
```
it starts working.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants