Skip to content
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

Use sed in a more POSIX compliant way #113

Merged
merged 1 commit into from
Mar 21, 2024
Merged

Conversation

mkrzewic
Copy link
Contributor

Fixes #112

@mpatrascoiu
Copy link
Contributor

Thanks! I don't see the need for gcc --> cc change.

Davix is officially supported on gcc. By changing it to cc, I don't want to raise hopes for other non-gcc compilers. Those are simply untested by us.

@mkrzewic
Copy link
Contributor Author

removed the gcc->cc thing. it does seem to work fine with llvm though :)

@mkrzewic
Copy link
Contributor Author

the problem I'm trying to solve is building as an automatic dependency of root on FreeBSD. gcc is not always there (can be installed, but it is a rather large dependency), llvm is the default. Davix and the rest can be built via the ports tree where these issues can be patched, but it would be nice if root could be built from source with as little effort as possible, just relying on roots own build system.

@mpatrascoiu
Copy link
Contributor

Hello,

Yes, but we shouldn't change things in Davix to non-supported configurations just for the purpose of having Root build 🙂
I'm merging the sed change.

Thanks!

@mpatrascoiu mpatrascoiu merged commit 4dcb5ed into cern-fts:devel Mar 21, 2024
@hahnjo
Copy link

hahnjo commented Oct 31, 2024

Note that this PR is not fully correct since POSIX sed doesn't actually have any switch for in-place edits. The problem comes from how GNU sed and BSD sed accept different arguments for their respective -i switches. In fact, I think this PR breaks the script with GNU sed, see this reproducer:

$ sed -i "" "s/a/b/g" test.txt 
sed: can't read s/a/b/g: No such file or directory

The correct incarnation would be sed -i"" "s/a/b/g" test.txt, but I think that doesn't work on BSD sed... From what I remember, there actually is no invocation that works for both implementation (or it is so obscure that I didn't find it back then).

More generally, the script talks about SLC6 and CC7 which are both EOL. Is it maybe time to just remove this script?

hahnjo added a commit to hahnjo/root that referenced this pull request Oct 31, 2024
The build fix for FreeBSD is included already since DAVIX 0.8.6, so
the PATCH_COMMAND is not needed (it was merged because the PR was
older, opened in February, than the upgrade of the builtin in May).
In fact the command breaks builtin_davix on Linux systems because
`sed -i` is not portable between GNU sed and BSD sed.
(Note that the same is true for the patch itself, see my comment in
cern-fts/davix#113 (comment)
.)
hahnjo added a commit to root-project/root that referenced this pull request Nov 4, 2024
The build fix for FreeBSD is included already since DAVIX 0.8.6, so
the PATCH_COMMAND is not needed (it was merged because the PR was
older, opened in February, than the upgrade of the builtin in May).
In fact the command breaks builtin_davix on Linux systems because
`sed -i` is not portable between GNU sed and BSD sed.
(Note that the same is true for the patch itself, see my comment in
cern-fts/davix#113 (comment)
.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FreeBSD] Davix build fails on FreeBSD
3 participants