-
Notifications
You must be signed in to change notification settings - Fork 3
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
Function remove_module_lines
can produce an invalid bash script
#249
Comments
I'm going to attempt to implement this, we'll see how I go. |
This change disables module commands that modify the environment via a wrapper when running a custom build script. This avoids preprocessing the custom build script for module statements which may produce an invalid bash script. This also allows for module commands that do not alter the environment to be executed as we only disable a subset of subcommands in the wrapper. Fixes #249
This change disables module commands that modify the environment via a wrapper when running a custom build script. This avoids preprocessing the custom build script for module statements which may produce an invalid bash script. This also allows for module commands that do not alter the environment to be executed as we only disable a subset of subcommands in the wrapper. Fixes #249
This change disables module commands that modify the environment via a wrapper when running a custom build script. This avoids preprocessing the custom build script for module statements which may produce an invalid bash script. This also allows for module commands that do not alter the environment to be executed as we only disable a subset of subcommands in the wrapper. Fixes #249
This change disables module commands that modify the environment via a wrapper when running a custom build script. This avoids preprocessing the custom build script for module statements which may produce an invalid bash script. This also allows for module commands that do not alter the environment to be executed as we only disable a subset of subcommands in the wrapper. Fixes #249
This change disables module commands that modify the environment via a wrapper when running a custom build script. This avoids preprocessing the custom build script for module statements which may produce an invalid bash script. This also allows for module commands that do not alter the environment to be executed as we only disable a subset of subcommands in the wrapper. Fixes #249
This change disables module commands that modify the environment via a wrapper when running a custom build script. This avoids preprocessing the custom build script for module statements which may produce an invalid bash script. This also allows for module commands that do not alter the environment to be executed as we only disable a subset of subcommands in the wrapper. Fixes #249
This change disables module commands that modify the environment via a wrapper when running a custom build script. This avoids preprocessing the custom build script for module statements which may produce an invalid bash script. This also allows for module commands that do not alter the environment to be executed as we only disable a subset of subcommands in the wrapper. Fixes #249
This change disables module commands that modify the environment via a wrapper when running a custom build script. This avoids preprocessing the custom build script for module statements which may produce an invalid bash script. This also allows for module commands that do not alter the environment to be executed as we only disable a subset of subcommands in the wrapper. Fixes #249
This change disables module commands that modify the environment via a wrapper when running a custom build script. This avoids preprocessing the custom build script for module statements which may produce an invalid bash script. This also allows for module commands that do not alter the environment to be executed as we only disable a subset of subcommands in the wrapper. Fixes #249
After discussing with @ccarouge, we have decided to add support for spack and to deprecate support for legacy CABLE build systems in benchcab. This adds the requirement that users will only be able to test benchcab on branches that can be built by spack. ACCESS-NRI will help with transitioning legacy build systems to use the latest build system compatible with spack. Moving to spack will solve existing issues around supporting bespoke build scripts (e.g. #244, #249). This is the best way forward considering support for legacy build systems is a temporary that will be deprecated sooner or later. Closing this issue. |
For compiling CABLE with a custom build script, benchcab will try to remove any lines that invoke the
module
command in the build script so that benchcab can load the modules specified in config.yaml when compiling the executables. This ensures that when we run CABLE we have the correct module dependencies loaded (see related issue: #94). This is done via theremove_module_lines
function:benchcab/benchcab/model.py
Lines 154 to 162 in dd9bc12
However, this approach of removing lines from the bash script is brittle and can easily produce a broken bash script. For example, a bash script snippet such as the following would break when applying the above function:
I think it is best to avoid modifying the build script as much as possible.
We could instead disable
module
invocations by creating a wrapper around themodule
command which prevents anymodule load
ormodule add
statements from being executed. To invoke the wrapper instead of the actual command when callingsubprocess.run
, we can prepend the path to the wrapper to thePATH
environment variable (see here for using python subprocess with a modified environment). This approach could be relevant for #244 if the user specifies a list of shell commands to compile CABLE instead of a build script path.The text was updated successfully, but these errors were encountered: