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

tests/unittests: Fix error due to macOS sed incompatibility #7780

Closed
wants to merge 1 commit into from

Conversation

x3ro
Copy link
Contributor

@x3ro x3ro commented Oct 20, 2017

Since most people™ seem to be developing on linux machines, they
commonly have gnu sed installed. In my experience with cross-platform
projects, it makes sense to require installation of gnu-sed on macOS
since dealing with the incompatibilites of sed is non-trivial.

This commit introduces such a check for the relic package.

For reference, the imcompatible sed call is located in
pkg/relic/fix-util_print_wo_args.sh (e.g. in 775e207)

This loosely relates to #6473.

Since most people™ seem to be developing on linux machines, they
commonly have gnu sed installed. In my experience with cross-platform
projects, it makes sense to require installation of gnu-sed on macOS
since dealing with the incompatibilites of sed is non-trivial.

This commit introduces such a check for the relic package.

For reference, the imcompatible sed call is located in
pkg/relic/fix-util_print_wo_args.sh (e.g. in 775e207)

This loosely relates to RIOT-OS#6473.
@x3ro x3ro added the OS: Mac OS X Host OS: This PR/issue concerns usage of RIOT with Mac OS X as a host system label Oct 20, 2017
@kYc0o
Copy link
Contributor

kYc0o commented Oct 20, 2017

Wow! I'm working exactly on the same thing. However, I'm looking for a "real" solution by making work OS X sed -i '' as it should. Did you try that?

@kYc0o
Copy link
Contributor

kYc0o commented Oct 20, 2017

I just found the problem. It's a locale thing, we need just to set LC_CTYPE=C in the os_util.sh script under pkg/relic.

@kYc0o
Copy link
Contributor

kYc0o commented Oct 20, 2017

Do you mind to change your commit or you prefer that I make another PR with this solution? (of course if this solution works for you as well). @smlng Can you check if my proposed solution doesn't break anything for you? IIRC you didn't have any problem with this package.

@jnohlgard
Copy link
Member

Is it possible to install the MacOS sed and other tools on Linux, to be able to test these kinds of things on Linux?
I mean is the source available somewhere?

@smlng
Copy link
Member

smlng commented Oct 20, 2017

I fixed that in the past #6105, did someone update relic and changed the usage of sed?

@smlng
Copy link
Member

smlng commented Oct 20, 2017

@gebart typically macOS uses non-gnu variant of command, maybe openbsd ships them?

@smlng
Copy link
Member

smlng commented Oct 20, 2017

I like #7785 better, way simpler.

@kYc0o
Copy link
Contributor

kYc0o commented Oct 21, 2017

I fixed that in the past #6105, did someone update relic and changed the usage of sed?

No, there was no change in the code, I think it just stop working on newer versions of OS X.

@smlng smlng added the Discussion: contested The item of discussion was contested label Oct 24, 2017
@smlng
Copy link
Member

smlng commented Oct 24, 2017

to fix relic I still prefer #7785.

We may think about fixing the general issue of incompatible (GNU vs. standard UNIX, like on macOS) shell commands in scripts used by RIOT on a higher level. However, that isn't solved here either.

What I mean is to check and verify commands like sed, readlink, etc where GNU variants have different or more parameters/options at the beginning (in some global Makefile) and check for alternative versions (like gsed on macOS), provide means to install them, or don't use such GNU specific parameters at all.

@jnohlgard
Copy link
Member

It seems less of a hassle for the user to merge #7785 instead of this. Can this be closed?

@x3ro
Copy link
Contributor Author

x3ro commented Oct 25, 2017

Yep, makes sense

@x3ro x3ro closed this Oct 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion: contested The item of discussion was contested OS: Mac OS X Host OS: This PR/issue concerns usage of RIOT with Mac OS X as a host system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants