Skip to content

Commit

Permalink
Add snippet about environments to main spec doc
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Bottriell <ryan@bottriell.ca>
  • Loading branch information
rydrman committed Feb 18, 2022
1 parent 3692591 commit 0ff551e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,19 @@ Build requirements can also be updated in the command line: `spk install --save

The install configuration specifies the environment that your package needs when it is installed or included in an spk environment.

#### Environment Variables

Packages can append, prepend and set environment variables at runtime if needed. It's strongly encouraged to only modify variables that your package can reasonably take ownership for. For example, the `python` package should be the only one setting `PYTHON*` variables that affect the runtime of python. This is not an enforced rule, but if you find yourself setting `PYTHONPATH`, for example, then it might mean that you are installing to a non-standard location within spfs and breaking away from the intended consistency of spfs.

```yaml
install:
environment:
- set: MYPKG_VAR
value: hello, world
- append: PATH
value: /spfs/opt/mypkg/bin
```

#### Requirements

Packages often require other packages to be present at run-time. These requirements should be listed in the `install.requirements` section of the spec file, and follow the same semantics as build options above.
Expand Down

0 comments on commit 0ff551e

Please sign in to comment.