-
Notifications
You must be signed in to change notification settings - Fork 437
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 bootstrap script for non (ba)sh script #759
Conversation
Force `opam env` to give a `bash` like output. This allows us to parse the environment variables correctly further down. `opam env` also has the option to export the environment as s-exp but I decided to not use it this time as I would realistically add another dependency to the script.
Hi @vthemelis! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
@vthemelis I try to improve this at #761 .Could you close this if you think #761 is better? |
Hi @WangGithubUser, Thanks for looking into this. Why do you think that we need the additional complexity? We don't capture the output of the other commands. Also, if the other commands have side effects these could now be wrong given that they could be executing |
We may use commands |
But why would you need to change them? There's a very specific reason we need this argument for the env command and this is because we know how to parse the bash-style output from Python. Ideally we would just get the output of the command as JSON or another serialisation format that's easily parsed from Python. I don't see why we need the to force the shell on any other case. |
@vthemelis I think, make all the commands outputs same in all cases is better for future. |
I think for now this minimal change makes sense. @WangGithubUser your change seems reasonable, but it still has some limitations because if new opam commands pop up the problem could reappear. So I think I'd like to try just setting the $SHELL env var instead as a longer-term fix; the opam docs say they will look at the SHELL var when no flag is passed |
@stroxler has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@grievejia has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@grievejia merged this pull request in b112c7c. |
Fixes #758
Pre-submission checklist
pip install -r requirements-dev.txt && pre-commit install
pre-commit run
Summary
Force
opam env
to give abash
like output.This allows us to parse the environment variables correctly further down.
opam env
also has the option to export the environment as s-exp but I decided to not use it this time as I would realistically add another dependency to the script.Test Plan
This allows me to run the bootstrap script from my fish session.