mapbox / mapbox/mason

sed: invalid option -- 'E'

Open
#266 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
258
Forks
68
PR merge metrics
No merged PRs in 30d

Description

On Sailfish SDK, I get an invalid usage error for sed (GNU sed version 4.1.5) when trying to build mapbox-gl-native.

Based on http://blog.dmitryleskov.com/small-hacks/mysterious-gnu-sed-option-e/ it looks like -r is equivalent to -E

Possible fix for /mapbox/mason/mason.sh:

if test | sed -E 's///g' 2>/dev/null; then
  SED_REGEX_ARG="E"
else
  SED_REGEX_ARG="r"
fi

...

 MASON_CONFIG_INCLUDE_DIRS=$(echo -n "${MASON_CONFIG_CFLAGS}" | sed -$SED_REGEX_ARG -n 's/^-(I|isystem) *([^ ]+)/\2/p' | uniq)
 MASON_CONFIG_DEFINITIONS=$(echo -n "${MASON_CONFIG_CFLAGS}" | sed -$SED_REGEX_ARG -n 's/^-(D) *([^ ]+)/\2/p')
 MASON_CONFIG_OPTIONS=$(echo -n "${MASON_CONFIG_CFLAGS}" | sed -$SED_REGEX_ARG -n '/^-(D|I|isystem) *([^ ]+)/!p')

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in /mapbox/mason/mason.sh and reproduce the sed -E check on the Sailfish SDK, comparing it with sed -r. Trace the three MASON_CONFIG parsing commands, then verify that the build succeeds and the include directories, definitions, and options are still extracted correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.