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

Nar breaks if there is a space in the path to the source #225

Open
SteveSmith16384 opened this issue Apr 21, 2016 · 4 comments
Open

Nar breaks if there is a space in the path to the source #225

SteveSmith16384 opened this issue Apr 21, 2016 · 4 comments

Comments

@SteveSmith16384
Copy link

SteveSmith16384 commented Apr 21, 2016

If there is a space in the path to the source, then the build breaks quite soon with something like:-

[INFO] --- nar-maven-plugin:3.2.0:nar-gnu-configure (default-nar-gnu-configure) @ TCSFirmware ---
[INFO] Copying GNU sources
[INFO] Running GNU configure
[INFO] + chmod +x /media/stephen/SSD Drive/code/xia/firmware/target/nar/gnu/amd64-Linux-gpp/src/configure
[INFO] args: [/media/stephen/SSD Drive/code/xia/firmware/target/nar/gnu/amd64-Linux-gpp/src/configure, --prefix=/media/stephen/SSD Drive/code/xia/firmware/target/nar/gnu/amd64-Linux-gpp/target, --prefix=/media/stephen/SSD, Drive/code/xia/firmware/target/hex]
[INFO] + cd /media/stephen/SSD Drive/code/xia/firmware/target/nar/gnu/amd64-Linux-gpp/src
[INFO] + sh /media/stephen/SSD Drive/code/xia/firmware/target/nar/gnu/amd64-Linux-gpp/src/configure --prefix=/media/stephen/SSD Drive/code/xia/firmware/target/nar/gnu/amd64-Linux-gpp/target --prefix=/media/stephen/SSD Drive/code/xia/firmware/target/hex
[ERROR] /media/stephen/SSD Drive/code/xia/firmware/target/nar/gnu/amd64-Linux-gpp/src/configure: 12: test: x--prefix=/media/stephen/SSD: unexpected operator

.. which leads to lots of further errors. This seems to be cause by the function MakeExecutable() in NarUtils.jar (among other places) not wrapping the path in apostrophes when it runs the chmod command.

@ctrueden
Copy link
Contributor

Thanks for the report, @SteveSmith16384. Care to file a PR to address it? It would be super helpful.

@GregDomjan
Copy link
Member

It looks to me like chmod worked successfully. Otherwise should see NarUtil.makeExecutable raise
MojoExecutionException("Failed to execute 'chmod +x " + file.getPath() + "'" + " return code: \'" + result + "\'.");

This seems like it might be an issue in using "sh" (shell?) to call configure rather than calling configure directly. "sh" is used in body of NarGnuConfigureMojo.narExecute() and runAutogen

If it is the shell, does it really need to be involved? Including shell typically also includes per user environment making a build less stable/reproducible.

@SteveSmith16384
Copy link
Author

Yes, I think you're right Greg. I've just created a PR. Please note I rarely use nar or c/cpp, so I wouldn't know how to test my changes to destruction.

@ctrueden
Copy link
Contributor

For reference, the PR @SteveSmith16384 mentions above is #227, but it went stale waiting on feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants