Sed: -e expression #1, char 1: unknown command: `''

Tags: #<Tag:0x00007f7f786b78b8> #<Tag:0x00007f7f786b76b0>

(Michael Wood-Vasey) #1

What’s going wrong in my following attempt to build? I can recreate this most trivially by trying to install lua. The error message is:

sed: -e expression #1, char 1: unknown command: `''

Is there something borked in my installation or eups that’s causing something to be empty that’s not supposed to be?

[Calm ~] rebuild -u lua
Could not import lsstcppimport; please ensure the base package has been built (not just setup).

                 lua:  ok (0.7 sec).
# BUILD ID: b2999
Could not import lsstcppimport; please ensure the base package has been built (not just setup).

                 lua: 5.1.4.lsst1-1-gfd327c6 ERROR (5 sec).
*** error building product lua.
*** exit code = 1
*** log is in /Users/wmwv/lsstsw/build/lua/_build.log
*** last few lines:
:::::  [2017-08-07T12:26:38.228666Z] + cd /Users/wmwv/lsstsw/build/lua
:::::  [2017-08-07T12:26:38.228681Z] + git reset --hard
:::::  [2017-08-07T12:26:38.232630Z] HEAD is now at fd327c6 Merge pull request #1 from lsst/tickets/DM-1731
:::::  [2017-08-07T12:26:38.233695Z] + git clean -d -f -q -x -e '_build.*'
:::::  [2017-08-07T12:26:38.248223Z] + eupspkg PRODUCT=lua VERSION=5.1.4.lsst1-1-gfd327c6 FLAVOR=generic prep
:::::  [2017-08-07T12:26:39.571840Z] + cat
:::::  [2017-08-07T12:26:39.587158Z] + set +x
:::::  [2017-08-07T12:26:39.587254Z] Setting up environment with EUPS
:::::  [2017-08-07T12:26:40.227774Z] + eupspkg PRODUCT=lua VERSION=5.1.4.lsst1-1-gfd327c6 FLAVOR=generic config
:::::  [2017-08-07T12:26:41.229304Z] sed: -e expression #1, char 1: unknown command: `''

(John Swinbank) #2

Theory: you are using GNU sed, but running on a macOS system. Could you give us a $ uname && sed --version please?

(Robert Lupton) #3

Or cd into that directory and take a look at the sed command that’s actually failing (ideally by doing a setup and running that eupspkg command with -v set)

(John Swinbank) #4

I am way ahead of you. I bet he’s getting this:

sed -i '.prev' s,#define LUA_ROOT\t"/usr/local/",#define LUA_ROOT\t"/Users/jds/Projects/Astronomy/LSST/stack/DarwinX86/lua/5.1.4.lsst1-1-gfd327c6/", src/luaconf.h
sed: -e expression #1, char 1: unknown command: `''

Offending logic is here:

(Mario Juric) #5

Agreed (and mea culpa). Should be testing for gnu vs. BSD sed here (basically, check whether sed -i fails w/o an argument).

That said, @mwv, I suspect other software could get tripped up on this too – it’s risky to be shadowing Mac’s BSD utils with GNU equivalents (macports?).

(Mario Juric) #6

(Michael Wood-Vasey) #7

Got it in one.

[Calm ~] which sed
[Calm ~] uname && sed --version
sed (GNU sed) 4.2.2
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Jay Fenlason, Tom Lord, Ken Pizzini,
and Paolo Bonzini.
GNU sed home page: <>.
General help using GNU software: <>.
E-mail bug reports to: <>.
Be sure to include the word ``sed'' somewhere in the ``Subject:'' field.

Yes, I use Fink as the package manager on my laptop. In a few more years that will qualify as “retro hip”.

(John Swinbank) #8

This issue has been fixed on DM-11507.