Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support for view and module loading by start and run commands (#31)
This PR implements support for loading views and making modules available inside an environment via command line arguments to `start` and `run` commands. ```bash # start with the view named develop loaded uenv start --view=develop myenv # start with modules available uenv start --modules myenv # run a command with modules available uenv run --modules myenv -- bash -c "module load cray-mpich; mpicc test.c" # run a command with a view loaded uenv run --view=develop myenv -- mpicc test.c ``` * add `lib/envvars.py` that implements classes that support setting and modifying environment variables. * support for `scalar` variables that take a single value and `list` variables (e.g. `PATH`) that are assembled by setting, appending and prepending paths. * support for accumulating operations on collections environment variables * support * instead of sourcing `activate.sh` when loading a view, the script is parsed and `export` commands is generated based its contents * this allows us to perform operations like overriding or preserving existing list variables * in the future this can be used to generate information required to deactivate a view * changed the behavior of `uenv view` to preserve existing values of variables like `PATH`, `LD_LIBRARY_PATH`, etc * add unit tests for the new environment variable code
- Loading branch information