Makefile.include: Fix call to sed for FreeBSD#12435
Conversation
benpicco
left a comment
There was a problem hiding this comment.
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'ssedbut not by the one on FreeBSD. This PR changes the call tosedin 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
icommand:While GNU's
sedunder 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
sedonly 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.hhas not changed with and without the PR.Issues/PRs references
See #12348