-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Makefile.include: Fix call to sed for FreeBSD #12435
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still builds fine on Linux, but fixes a build bug on FreeBSD and OS X.
Can you please provide a backport?
(Basically, submit the same PR again but with the 2019.10-branch
branch as a target instead of the master
branch, you should reference this PR.)
(you also can just use |
I opened #12591 and tested building the hello-world app on the I opened the PR manually as I saw your comment too late, I hope it's still correct this way. |
@roberthartung which operating system is your colleague using? |
As I said, I tested only on FreeBSD, because #12348 broke the build process there with the built-in version of However, in contrast to the behavior on OSX mentioned in the referenced comment, on FreeBSD, riotbuild.h was created and populated with the same content that it contains on a Linux host. So this may be two different problems. |
@miri64 I'm using MacOs 10.15.1 and it fails with |
From that, I'd assume that ...
… which would make it hard to solve independent of the platform. Maybe the following alternative from the PR description would have been the better solution, as it does not require an
|
Contribution description
Disclaimer: I'm not an expert on FreeBSD, but only stumbled upon this while using it to test another PR on a non-Linux platform and wanted to let you know.
If I didn't miss something, it looks like merging PR #12348 has broken the build on FreeBSD, as it uses
sed
's insert functionality with a syntax that is tolerated by GNU'ssed
but not by the one on FreeBSD. This PR changes the call tosed
in a way that works on both platforms.The call in question is:
From sed's manpage, we see that a backslash followed by a new line is required for the
i
command:While GNU's
sed
under Linux accepts the syntax used in PR #12348, the build with FreeBSD fails (master was on cce1438 for my tests, I also tried 3bfe30a in isolation):Using commit 3f0dfc1 (immediately before the PR was merged) was still successful on FreeBSD:
The formatting of the fix is not very nice, but using an actual line break was the only solution that allowed staying with
sed
only and worked for me independently of the host platform and shell. Something likeecho '/* ... */' | cat - $< | sed ... > $@
could be an alternative.Testing procedure
To verify that this issue exists, checkout the current master on FreeBSD, try to build an application (e.g. examples/hello_world), and see that the aforementioned error occurs:
After applying this change, the error should be gone. Also verify that the content of
<appdir>/bin/native/riotbuild/riotbuild.h
has not changed with and without the PR.Issues/PRs references
See #12348