GUL14 migration: Preserve gul14/catch.h includes#34
Conversation
[why] GUL17 does not bundle a header-only Catch2 include file anymore, so some manual work is required to migrate a project to Catch2v3. This is out of the scope of the GUL14 migration script. The best way of dealing with this is, arguably, to keep including the header that is bundled with GUL14. Signed-off-by: Lars Froehlich <lars.froehlich@desy.de>
There was a problem hiding this comment.
Pull Request Overview
Adds a special-case sed rule in the GUL14→GUL17 migration script to preserve the legacy Catch2 header.
- Inserts a pattern to rewrite
#include <gul17/catch.h>back togul14/catch.h - Keeps existing namespace and header migrations intact
Comments suppressed due to low confidence (3)
tools/migrate_gul14_to_gul17.bash:53
- [nitpick] Add a comment above this line explaining that GUL17 no longer bundles the Catch2 header, so we intentionally reroute includes back to gul14/catch.h.
- -e 's/(#include\s*["<])gul17\/catch.h([">])/\1gul14\/catch.h\2/g' \
tools/migrate_gul14_to_gul17.bash:53
- [nitpick] Anchor the regex to the start of the line (e.g.,
^) so only actual include directives are matched and you avoid unintended replacements in other contexts.
- -e 's/(#include\s*["<])gul17\/catch.h([">])/\1gul14\/catch.h\2/g' \
tools/migrate_gul14_to_gul17.bash:53
- [nitpick] Consider adding or updating a test case in the migration script's suite to verify that
#include <gul17/catch.h>is correctly rewritten togul14/catch.h.
- -e 's/(#include\s*["<])gul17\/catch.h([">])/\1gul14\/catch.h\2/g' \
[why] To reflect that the script should be called on the main directory of a project. Signed-off-by: Lars Froehlich <lars.froehlich@desy.de>
Signed-off-by: Lars Froehlich <lars.froehlich@desy.de>
|
Since this is still open, I have added two more commits to
|
|
If we keep the handle_gitlab_ci_file() {
sed -i -E -e 's/dev-doocs-libgul14/gul17-dev/g' "$1"
}Maybe it should then just add the This new substitution line is it to revert previous autoconversions? |
|
Hmm, neither client nor serverlib install GUL in the Gitlab-ci (they fall back to selfbuild HEAD), and servers usually install the latest serverlib package/release, is there even someone who installs GUL manually? |
Olaf asked if we could do that for the CI files. Apparently it is used in several libraries. |
In the same sed command, we first replace |
Yes, maybe. But honestly, I do not care too much. People should migrate to Catch2v3 anyhow, maybe we do not have to cover each and every corner case with this script. 🤷 |
|
Thanks, @Finii! |
GUL17 does not bundle a header-only Catch2 include file anymore, so some manual work is required to migrate a project to Catch2v3. This is out of the scope of the GUL14 migration script. The best way of dealing with this is, arguably, to keep including the header that is bundled with GUL14.