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

add doc about activating a python env to bypass the set -e of the environment.sh script #10

Open
utke1 opened this issue Sep 23, 2024 · 2 comments

Comments

@utke1
Copy link
Contributor

utke1 commented Sep 23, 2024

https://github.com/bradbell/cmpad/blob/5b75a10efca647f7b827f5a214580d0c06005bd2/xrst/get_started.xrst#L75C1-L75C26

In the snippet above, the environtment.sh bootstraps the environment fine but shell opened after activation is exited after any command error because this script has set -e cf

set -e -u

So I get kicked out of the environment on any command line error I may make. I propose to add to the documentation that the already created environment should be activated e.g. with

source  build/release/bin/activate 

(or suitably adjusted for "build_type" ) which doesn't have the set -e and I won't get kicked out of the environment upon the first error.

@utke1 utke1 changed the title add doc about activating a python env and bypass the set -e of the environment.sh script add doc about activating a python env to bypass the set -e of the environment.sh script Sep 23, 2024
@bradbell
Copy link
Owner

bradbell commented Sep 24, 2024

By default, I always put an set -e -u at the beginning of my bash scripts. Perhaps when one is sourcing a file, instead of opening a new shell, this is not a good idea and we should remove it ? In other words, let the shell that is sourcing the file determine if it wants to have -e and -u set ?

Do you think this would solve your problem ?

@bradbell
Copy link
Owner

See the commit
e7ea791

Please close this issue if that fixes it for you.

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

No branches or pull requests

2 participants