Repository navigation
fix: non-cppflags version of adding the git version string to dart - #1187
hkershaw-brown wants to merge 1 commit into
Conversation
|
Note we cannot be more sensible about compiling without the other race condition (obs_def_mod, obs_kind_mod) when preprocess out-of-the-box in dart is writing the same file for all dart builds. |
mjs2369
left a comment
There was a problem hiding this comment.
Hi @hkershaw-brown I failed your challenge and could not break this code, so kudos
The value of git_version is now read as plain text with the printf and string format directive; this means it can't be read as a format string or interpreted as pure fortran code like in the issue share by our user.
And I think we are protected from edge cases in the git_version as well, since you replace all characters that aren't a letter, digit, or ., _, +,- with underscores; this command is also performed in posix so the character classification is in plain ASCII.
I also went ahead and did run_all quickbuilds on Derecho and the results were identical with those on main (10 FAILED for each compiler, except ifx which also fails for GSI2DART and therefore is 11)
I think this is ready to go!
P.S. I learned some cool things reviewing this PR
Buildfunction dartversion now writes the module with the dart version string. The cppdefs version string was not surviing certain mpiifort compiler wrappers. fixes #1164 temp file created with temp.$$ to avoid race condition creating the file (when multiple quickbuilds are run simultanously) stanitizing the string for funky characters. removes the -c from the mkmf calls
e5aa3be to
945e743
Compare
Description:
non-cppflags version of adding the git version string to dart
Buildfunction dartversion now writes the module with the dart version string. The cppdefs version string was not surviing certain mpiifort compiler wrappers. Rather than keep adding escapes \\, to get the string preprocessed, this pull request creates the version_mod.f90 file during the build.
temp file created with temp.$$ to avoid race condition creating the file (when multiple quickbuilds are run simultaneously)
Sanitizing the string for funky characters and trimming just incase people get creating with tags. Note I am in two minds about whether this should be bash substitution since we already use bash substitution elsewhere in the buildfunctions.
Currently checking whether the version has changed before overwriting version_mod.f90. Quickbuild.sh removes all .o and .mod so stuff gets rebuild anyway, but possibly at somepoint we may be more sensible about compiling.
removes the -c from the mkmf calls in the build functions.
Fixes issue
fixes #1164
Types of changes
Documentation changes needed?
Tests
Please describe any tests you ran to verify your changes.
I am testing the builds with CIRRUS on this pull request.
Still to test:
Checklist for merging
Checklist for release
Testing Datasets