Skip to content

Commit f5ad2fd

Browse files
authored
Merge pull request #288 from Flamefire/update-version-ec
Document how to update toolchains for existing easyconfigs
2 parents 360223a + 75dce11 commit f5ad2fd

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed

docs/writing-easyconfig-files.md

+74
Original file line numberDiff line numberDiff line change
@@ -940,6 +940,80 @@ Example:
940940
eb WRF-3.5.1-ictce-5.3.0-dmpar.eb --try-toolchain=intel,2014b -r
941941
```
942942

943+
## Updating existing easyconfigs for another toolchain
944+
945+
While `try-toolchain` is a convenient way of testing existing software versions with another toolchain
946+
you rarely want this behavior.
947+
Usually when using a newer toolchain you also want to use newer versions of (at least) the dependencies.
948+
Often there are already at least easyconfigs available for the dependencies in the new toolchain,
949+
and especially if those are already installed you should use those as dependencies for the updated easyconfig.
950+
951+
So the process of updating an easyconfig to a newer toolchain version could look like:
952+
953+
1. Copy the easyconfig and change the toolchain version
954+
1. Usually, especially when updating to the latest toolchain,
955+
you should search for the most recent version of the software too and use that.
956+
When you update the version, the checksum for the software sources will
957+
become incorrect and should be removed. You can automatically inject the
958+
checksums for the new sources with `eb --inject-checksums <easyconfig>`
959+
(see [checksums documentation](writing-easyconfig-files.md#common_easyconfig_param_sources_checksums)
960+
for more details).
961+
1. For each listed dependency find the easyconfig for the new toolchain version.
962+
Here you need to take [toolchain hierarchy](common-toolchains.md#toolchains_diagram) into account.
963+
I.e. a dependency of an easyconfig for the `foss` toolchain might use the `GCC` or `GCCcore` toolchain.
964+
Check the toolchain easyconfig file (e.g. `foss-2023b.eb`) to find the versions of the sub-toolchain.
965+
For very recent toolchains you can also check the `develop` branch of the [easyconfigs git repository](https://github.com/easybuilders/easybuild-easyconfigs) and open PRs.
966+
1. If an easyconfig for the listed dependency with the new toolchain already exists use its version in your new easyconfig.
967+
Otherwise, you need to create a new easyconfig for the listed dependency with the new toolchain version (based on that of another toolchain version).
968+
The steps are the same and also need to be repeated for each dependency of this dependency.
969+
1. Finally, build and test your easyconfig and consider [contributing](contributing.md#contributing-easyconfig-files--contributing_easyconfigs) it.
970+
971+
Especially when creating easyconfigs for dependencies it is a good idea to put all of them into a new folder.
972+
To allow EasyBuild to find these easyconfigs in your folder, pass its path via `eb --robot <path> ...`.
973+
974+
This manual process can be partially automated:
975+
976+
1. Create a new folder for the new easyconfig and its dependencies.
977+
1. Run `eb <current_easyconfig.eb> --try-toolchain-version=<new-version> --try-update-deps --experimental --copy-ec <folder>`.
978+
This will update the toolchain version, search for the versions of dependencies in the new toolchain and use them if available.
979+
If a dependency with the new toolchain is not available this will create a new easyconfig for this toolchain
980+
based on an existing one for another toolchain (version).
981+
All newly create easyconfigs will be copied to the specified folder.
982+
1. Optionally, but recommended, update the version of the software for each created easyconfig to the latest available one.
983+
1. **Important**: Verify the newly created easyconfigs by comparing each of them against the existing one for that software.
984+
Only the version of the software, toolchain and dependencies should have been changed. However, this approach
985+
can lead to unwanted changes to formatting as well as the replacement local variables or templates (such as `name`,
986+
`version` or `%(version)s`) by their *value* when updating easyconfigs.
987+
This is undesirable as the values might become out of sync with what they are supposed to be, e.g. when we update
988+
the `version` variable the old *value* may still exist elsewhere in the easyconfig.
989+
Depending on the situation, it might be easier to use the newly created easyconfigs just for getting the versions of
990+
each dependency required and still copy & update the easyconfigs from existing ones manually.
991+
992+
When updating a software version the patches in the easyconfig need to be checked too.
993+
If they don't apply they might not be required anymore, when the upstream software fixed the issue, and can be removed.
994+
Otherwise, they need to be adjusted for the changes in the source code.
995+
996+
For updates to easyconfigs containing Python packages (`PythonBundle`) you should check each of them if there is a newer version and if it is still required.
997+
The latest version of a single Python package can usually be found on [PyPI](https://pypi.org).
998+
To find the list of Python dependencies for another Python package to be installed by an easyconfig you can use the `findPythonDeps` script
999+
distributed with EasyBuild.
1000+
For a typical installation it can be run using `$(dirname $(which eb))/../easybuild/scripts/findPythonDeps.py` which automatically finds the standard path for it.
1001+
This will also output the latest, compatible version of the found packages.
1002+
A good approach is to start from an easyconfig just containing the dependency on Python but no Python packages and then run e.g. `findPythonDeps.py --ec foo-1.2.3.eb foo==1.2.3`.
1003+
For every Python package displayed by the script first search for a suitable easyconfig containing that package and add it as a dependency one by one.
1004+
That might require updating it from another toolchain.
1005+
Then run the script again to honor Python packages from that dependency and its dependencies.
1006+
Repeat until none of the remaining packages displayed are in any easyconfig and/or unique enough to the specific software that an own easyconfig would be useful.
1007+
Those can then be added to the `ext_list` of the easyconfig.
1008+
More information about that script can be found at the top of the script file and via `findPythonDeps.py --help`.
1009+
1010+
Also keep in mind that changing the version of the software and/or the toolchain might reveal new bugs or incompatibilities.
1011+
Some can be fixed or worked around by patches, often even with help from the maintainers of the software.
1012+
But some software is simply not compatible with specific versions of compilers or other software.
1013+
Feel free to ask for help in the [EasyBuild Slack channel](https://easybuild.io/join-slack).
1014+
Also filing an issue or bug report against the software in question helps in getting more information or the bug being fixed in later versions.
1015+
This fix can then also be applied to the earlier version of necessary.
1016+
9431017
## Dynamic values for easyconfig parameters {: #easyconfig_param_templates }
9441018
9451019
String templates are completed using the value of particular easyconfig

0 commit comments

Comments
 (0)