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

boost: no quotes around compiler (os.environ["CXX"]) #3362

Merged
merged 2 commits into from
Dec 22, 2020

Conversation

madebr
Copy link
Contributor

@madebr madebr commented Oct 30, 2020

Specify library name and version: boost/all

Fixes #2996

  • I've read the guidelines for contributing.
  • I've followed the PEP8 style guides for Python code in the recipes.
  • I've used the latest Conan client version.
  • I've tried at least one configuration locally with the
    conan-center hook activated.

@conan-center-bot
Copy link
Collaborator

All green in build 1 (a65e512bdec5e486cfddc7c22279e81e5c24b7e7)! 😊

@SSE4
Copy link
Contributor

SSE4 commented Oct 31, 2020

does it work with compiler wrappers (e.g. ccache, distcc)?

@madebr madebr changed the title boost: split CXX into CXX + CXXFLAGS boost: no quotes around compiler (os.environ["CXX"]) Oct 31, 2020
@madebr
Copy link
Contributor Author

madebr commented Oct 31, 2020

does it work with compiler wrappers (e.g. ccache, distcc)?

No, it didn't.
Removing the quotes obviates the need for shlex.split.
I tested this by setting CXX=ccache /usr/bin/g++ -fchar8_t -fpermissive in my profile.
(just added some random arguments to the compiler)

@SSE4
Copy link
Contributor

SSE4 commented Oct 31, 2020

okay, this might be tricky to get it working for all cases. I remember, for windows, quotes were needed, e.g. if CC points to the path with spaces, like C:\Program Files\LLVM\bin\clang-cl.exe.
that might be a situation fixing one thing, but breaking another, so please check it carefully.

@SSE4
Copy link
Contributor

SSE4 commented Oct 31, 2020

/cc @grafikrobot , he may provide his insight on when quotes might (or might not) be needed.

@SSE4 SSE4 requested review from jgsogo, uilianries and danimtb and removed request for uilianries October 31, 2020 17:48
@jgsogo
Copy link
Contributor

jgsogo commented Oct 31, 2020

I see one potential problem: what if the path to CXX contains blanks?

@madebr
Copy link
Contributor Author

madebr commented Oct 31, 2020

okay, this might be tricky to get it working for all cases. I remember, for windows, quotes were needed, e.g. if CC points to the path with spaces, like C:\Program Files\LLVM\bin\clang-cl.exe.
that might be a situation fixing one thing, but breaking another, so please check it carefully.

When not using quotes, there is no way to distinguish between a space in a path and spaces for arguments.
When there is a space in the compiler path, should the CXX environment variable contain double quotes?
Or is #2996 invalid and should CXX not contain any arguments and should they be put in CXXFLAGS/CPPFLAGS?

I've tested with the following (on Linux):

mkdir -p "/tmp/best compiler ever/compiler"
ln -s /usr/bin/g++ "/tmp/best compiler ever/compiler"

and putting CXX=ccache "/tmp/best compiler ever/compiler" -fchar8_t -fpermissive in my profile.

Building boost succeeds, but boost's test_package fails because cmake fails to recognize the compiler.

Setting CXX=""/tmp/best compiler ever/compiler" in the profile works btw.

@SSE4
Copy link
Contributor

SSE4 commented Oct 31, 2020

CXX usually works for multiple arguments, e.g. things like CXX=ccache g++ and CXX=g++ -m32 work out of the box, and it's pretty common use-case.
for instance, on Mac, you always can escape spaces with slashes and don't use quotes: CXX=/Library/Application\ Support/Android/ndk/bin/clang++ will work.
on other hand, on Windows, it's tricky, because there are different things involved:

  1. command line passed to the shell (cmd.exe/bash) or function like ShellExecute. in that case shell-specific things like quotes work.
  2. command line directly passed to the CreateProcess/exec function. this cannot handle shell-specific things, e.g. quotes, output redirection syntax, background syntax. probably, cmake works this way and doesn't like quotes in command line.

from the conan point of view, we don't know what's going to be done with CXX in the particular build system. puzzling...

@conan-center-bot
Copy link
Collaborator

All green in build 2 (e1c4084de20ef6fbacbadb85d130f0d0367364f4)! 😊

@stale
Copy link

stale bot commented Dec 17, 2020

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added stale and removed stale labels Dec 17, 2020
This was referenced Dec 19, 2020
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

Successfully merging this pull request may close these issues.

[package] boost/1.73.0: boost can not be crosscompiled when CXX contains sysroot
7 participants