Skip to content

Commit 7afb336

Browse files
authored
Merge pull request #307 from lexming/modextrapaths
update documentation of EasyBuild 5.0 with revamp of modextrapaths
2 parents 162186a + 533dc25 commit 7afb336

File tree

3 files changed

+104
-0
lines changed

3 files changed

+104
-0
lines changed

docs/easybuild-v5/deprecated-functionality.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ Some functionality is being deprecated in EasyBuild v5.0, and will no longer be
1818
- [GC3Pie as job backend][gc3pie-job-backend]
1919
- [Using `optarch` value without leading dash][optarch-dash]
2020
- [`COMPILER*_FLAGS` attributes in `Compiler` class][compiler-constants]
21+
- [Easyconfig parameter `modextrapaths_append`][deprec_modextrapaths_append]
22+
- [Easyconfig parameter `allow_append_abs_path`][deprec_allow_append_abs]
23+
- [Easyconfig parameter `allow_prepend_abs_path`][deprec_allow_prepend_abs]
2124

2225
If you trigger any deprecated functionality when using EasyBuild v5.0, a warning message will be printed.
2326

@@ -126,3 +129,49 @@ The following checksum types are deprecated and should no longer be used: `md5`,
126129
## `COMPILER*_FLAGS` attributes in `Compiler` class {: #compiler-constants }
127130

128131
*(replaced by `Compiler.COMPILER*_OPTIONS`, more info soon)*
132+
133+
---
134+
135+
## Easyconfig parameter `modextrapaths_append` {: #deprec_modextrapaths_append }
136+
137+
The functionality of `modextrapaths_append` is now implemented in
138+
`modextrapaths` through its `prepend` option:
139+
140+
```python
141+
modextrapaths = {
142+
'ENV_VAR_NAME': {
143+
'paths': 'path/to/extra/subdir',
144+
'prepend': False,
145+
},
146+
}
147+
```
148+
149+
---
150+
151+
## Easyconfig parameter `allow_append_abs_path` {: #deprec_allow_append_abs }
152+
153+
The functionality of `allow_append_abs_path` is now implemented in
154+
`modextrapaths`, which now accepts absolute paths by default and the position
155+
of paths can be controlled through its `prepend` option:
156+
157+
```python
158+
modextrapaths = {
159+
'ENV_VAR_NAME': {
160+
'paths': '/absolute/path/to/extra/subdir',
161+
'prepend': False,
162+
},
163+
}
164+
```
165+
166+
---
167+
168+
## Easyconfig parameter `allow_prepend_abs_path` {: #deprec_allow_prepend_abs }
169+
170+
The functionality of `allow_prepend_abs_path` is now implemented in
171+
`modextrapaths`, which now accepts absolute paths by default:
172+
173+
```python
174+
modextrapaths = {
175+
'ENV_VAR_NAME': '/absolute/path/to/extra/subdir',
176+
}
177+
```

docs/easybuild-v5/enhancements.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Various significant enhancements are included in EasyBuild v5.0, including:
2020
- [Provide control over how EasyBuild specifies path to header files during installation (via `--search-path-cpp-headers`)][search-path-cpp-headers]
2121
- [Provide control over how EasyBuild specifies path to libraries during installation (via `--search-path-linker`)][search-path-linker]
2222
- [Support not using `$PYTHONPATH` to specify the location of installed Python packages (via `--prefer-python-search-path`)][PYTHONPATH-vs-EBPYTHONPREFIXES]
23+
- [Revamp of easyconfig parameter `modextrapaths`][modextrapaths-revamp]
2324
- [Detect Fortran `.mod` files in `GCCcore` installations][mod-files]
2425
- [Let `ConfigureMake` generic easyblock error out on unknown `configure` options][configuremake-unknown-configure-options]
2526

@@ -292,6 +293,56 @@ This option is also available as easyconfig parameter
292293

293294
---
294295

296+
## Revamp of easyconfig parameter `modextrapaths` { : #modextrapaths-revamp }
297+
298+
The easyconfig parameter `modextrapaths` has become in EasyBuild 5.0 the only
299+
tool needed in easyconfigs to add extra search paths into the generated module
300+
file. The environment variables targeted in `modextrapaths` now can also be
301+
defined with a dictionary of options to fully control how their extra search
302+
paths will be added into the environment.
303+
304+
```python
305+
modextrapaths = {
306+
'ENV_VAR_NAME': 'extra/subdir',
307+
'WEIRD_ENV_VAR': {
308+
'paths': ['another/subdir1', 'another/subdir2'],
309+
'delimiter': '+',
310+
'prepend': False,
311+
},
312+
}
313+
```
314+
315+
The example above shows the standard definition of an environment variable
316+
`$ENV_VAR_NAME` that will get an extra path prepended to it. So the result in
317+
the environment once the module file is loaded will look like `$ENV_VAR_NAME =
318+
"/path/to/softwareroot/extra/subdir:/existing/path"`. On the other hand, the
319+
environment variable `$WEIRD_ENV_VAR` uses a custom delimiter `+` and its paths
320+
will be appended. So we can expect as result an environment variable that looks
321+
like `$WEIRD_ENV_VAR = "/existing/path+/path/to/softwareroot/another/subdir1+/path/to/softwareroot/another/subdir2"`.
322+
323+
Complete list of options to `modextrapaths`:
324+
325+
- `paths`: string with a single path or list of strings with multiple paths.
326+
Paths are glob patterns and can be relative or absolute.
327+
- `delimiter`: character used as search path separator (default: `:`)
328+
- `prepend`: position of paths in the environment variable (default: `True`)
329+
- `var_type`: type of contents as defined in `easybuild.tools.modules.ModEnvVarType`
330+
(default:`ModEnvVarType.PATH_WITH_FILES`)
331+
332+
Another improvement in EasyBuild 5.0 is the addition of a global variable
333+
called `MODULE_LOAD_ENV_HEADERS` that can be used as a special key in
334+
`modextrapaths` to add extra search paths for headers according to [new option
335+
`--module-search-path-headers`][module-search-path-headers].
336+
337+
The revamp of `modextrapaths` renders several easyconfig parameters obsolete,
338+
which have become deprecated in EasyBuild 5.0:
339+
340+
- [`modextrapaths_append`][deprec_modextrapaths_append]
341+
- [`allow_append_abs_path`][deprec_allow_append_abs]
342+
- [`allow_prepend_abs_path`][deprec_allow_prepend_abs]
343+
344+
---
345+
295346
## Let `ConfigureMake` generic easyblock error out on unrecognized `configure` options { : #configuremake-unrecognized-configure-options }
296347

297348
*(more info soon)*

docs/easybuild-v5/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ Various significant enhancements are included in EasyBuild v5.0, including:
8181
- [Provide control over how EasyBuild specifies path to header files during installation (via `--search-path-cpp-headers`)](enhancements.md#search-path-cpp-headers)
8282
- [Provide control over how EasyBuild specifies path to libraries during installation (via `--search-path-linker`)](enhancements.md#search-path-linker)
8383
- [Support not using `$PYTHONPATH` to specify the location of installed Python packages (via `--prefer-python-search-path`)](enhancements.md#PYTHONPATH-vs-EBPYTHONPREFIXES)
84+
- [Revamp of easyconfig parameter `modextrapaths`](enhancements.md#modextrapaths-revamp)
8485
- [Detect Fortran `.mod` files in `GCCcore` installations](enhancements.md#mod-files)
8586
- [Let `ConfigureMake` generic easyblock error out on unrecognized `configure` options](enhancements.md#configuremake-unrecognized-configure-options)
8687

@@ -131,6 +132,9 @@ Some functionality is being deprecated in EasyBuild v5.0, and is scheduled to be
131132
- [GC3Pie as job backend](deprecated-functionality.md#gc3pie-job-backend)
132133
- [Using `optarch` value without leading dash](deprecated-functionality.md#optarch-dash)
133134
- [`COMPILER*_FLAGS` attributes in `Compiler` class](deprecated-functionality.md#compiler-constants) (replaced with `COMPILER*_OPTIONS`)
135+
- [Easyconfig parameter `modextrapaths_append`](deprecated-functionality.md#deprec_modextrapaths_append) (integrated in `modextrapaths`)
136+
- [Easyconfig parameter `allow_append_abs_path`](deprecated-functionality.md#deprec_allow_append_abs) (integrated in `modextrapaths`)
137+
- [Easyconfig parameter `allow_prepend_abs_path`](deprecated-functionality.md#deprec_allow_prepend_abs) (integrated in `modextrapaths`)
134138

135139
---
136140

0 commit comments

Comments
 (0)