-
Notifications
You must be signed in to change notification settings - Fork 442
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
Pass HOME env var when fetching version #2698
Pass HOME env var when fetching version #2698
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
@illicitonion Can you provide some feedback on this, please? |
So, the issue seems to be the following: I build code in a container w/o user defined (hence, root). In a github action, I pass --user argument to the container. I think that cargo eventually resorts to read std::env::home that reads /etc/passwd and that fails in my case (as HOME env var is not routed). Hence, I kindly ask for this PR to be taken into consideration. @illicitonion @UebelAndre PTAL. |
Until bazelbuild/rules_rust#2698 is merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay here! Is #2662 (comment) not the root cause here? Does this fix the behavior inside your container?
@UebelAndre That's unfortunately not going to work. I removed user from my container, so dockerfile only has root. The thing is that the github action passes user (that's how I got github action working with my container). The action also passes HOME env var which is |
@illicitonion @UebelAndre PTAL. |
@illicitonion @UebelAndre PTAL. |
@krasimirgg @illicitonion @UebelAndre PTAL. Please let me know if I can help somehow to move this forward. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your patience and persistence! I've finally had mental bandwidth to dig into this and for just getting the version I think access to HOME
is not going to introduce much if any volatility. My original concern was that HOME
was gonna be set when doing splicing or something which could lead to configs sneaking into generated outputs.
Thank you so much!
Many thanks for the feedback and efforts. |
Fixes #2662.
So, in a github action https://github.com/mvukov/rules_ros2/blob/980afb82f4af92480815e723b47a0cde4bea63a7/.github/workflows/main.yml I use my custom build image https://github.com/mvukov/bazel_builder/blob/49178bdf9c151b1fdb1fb0bac580da5d53a990fd/Dockerfile, no user defined. The github action passes user and HOME folder. The home folder seems to be
/github/home
and fetching the version seems to have problems with this. Therefore, I just pass the HOME env var here.