snapcraft fails in a directory with spaces
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snapcraft |
Fix Released
|
High
|
Unassigned |
Bug Description
Mark Lee found that snapcraft fails with a very very dark error when it is run in a directory with spaces.
To reproduce:
$ mkdir "with spaces"
$ cd "with spaces"
$ snapcraft init
$ snapcraft
$ snapcraft
Preparing to pull my-part
Pulling my-part
Preparing to build my-part
Building my-part
/tmp/tmpnwpk1s18: 3: export: spaces/
Full output: https:/
The problem here is that in snapcraft.
For example, this is the contents of the script in one of our tests:
export PATH="/root/Test App-linux-
export LD_LIBRARY_
export LD_LIBRARY_
export PATH="/root/Test App-linux-
export LDFLAGS="$LDFLAGS -L/root/Test App-linux-
export PKG_CONFIG_
export PERL5LIB=/root/Test App-linux-
export SNAPCRAFT_
export SNAPCRAFT_
export SNAPCRAFT_
export SNAPCRAFT_
export SNAPCRAFT_
export SNAPCRAFT_
The error comes from the PERL5LIB var, but all the ones after that one are not escaped.
Changed in snapcraft: | |
status: | In Progress → Fix Committed |
milestone: | none → 2.35 |
Changed in snapcraft: | |
status: | Fix Committed → Fix Released |
Setting priority to high because this will make many projects fail with a very bad error message. Not critical just because it has an (ugly) workaround: copy the files to a dir without a space in the name.