yoavnir / specs2016

New version of the specs pipeline stage based on what's in current CMS pipelines
MIT License
1 stars 1 forks source link

The --shell option misbehaves if commands change the environment #206

Closed yoavnir closed 1 year ago

yoavnir commented 1 year ago

Will probably need better debugging in -v mode for -X

yoavnir commented 1 year ago

I would bet that either tar was not accessible, or the cd happened in a different context, so tar ran in the wrong directory and didn't do anything.

yoavnir commented 1 year ago

Simpler example. Input file "bat":

cd utils
ls

The following two commands behave very differently:

The reason is that the SHELL treats everything as a single script, while the -X (wrongly!) runs the commands one by one and so the ls command runs in the same directory as specs, not in the utils directory.

yoavnir commented 1 year ago

Commands are now collected into an std::ostringstream, and in the end, it is executed as one popen.