Makefile.include: Fix call to sed for FreeBSD and OS X [backport 2019.10]#12591
Conversation
|
Also tested on OS X. |
I don't understand the link. It is leading to a PR only slightly related and the issue comment doesn't seem to be in that PR |
|
@javierfileiv deleted the comment I was linking to - looks like he has trouble reproducing it after all :\ It came up in this PR that he reported the build would fail on OS X due to the sed call. I suggested he should try this patch. |
|
The PR to master was tested, so no sense stalling this. If more issues are found, they need to be fixed in master first anyways |
|
Wasn't able to make it work using MAC-OS. As I said on #12183 (comment) |
Well ideally you should be able to build RIOT without any extra steps - do you see the issue on |
Backport of #12435
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