-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
b2: Support CXX from a VirtualBuildEnv #17882
Conversation
🤖 Beep Boop! This pull request is making changes to 'recipes/b2//'. 👋 @grafikrobot you might be interested. 😉 |
To reproduce:
Without the first commit in this PR, |
@grafikrobot I'm not at all a b2 expert, so would appreciate your input :-). Is there a better way to do this? |
This comment has been minimized.
This comment has been minimized.
This ensures the b2 install command can find the correct compiler binary.
This comment has been minimized.
This comment has been minimized.
I detected other pull requests that are modifying b2/portable recipe: This message is automatically generated by https://github.com/ericLemanissier/conan-center-conflicting-prs so don't hesitate to report issues/improvements there. |
@grafikrobot this failed once, then passed when I reran it above. I've also just seen this error with a local build (but again, it usually passes). Any idea what the cause might be? Should I raise a separate issue? |
@PeteAudinate immediately I don't know why. I'd have to look at it in more detail to guess why. And I wont be able to look at all until after the 26th (I'm busy with the WG21 meeting and then out of contact on vacation). |
This comment has been minimized.
This comment has been minimized.
No idea why this got kicked off (or why it failed). It passed previously, and there have been no subsequent updates. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
def _write_project_config(self, cxx): | ||
with open(os.path.join(self.source_folder, "project-config.jam"), "w") as f: | ||
f.write( | ||
f"using {self.options.toolset} : : {cxx} ;\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this for debug or confirm it works?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's writing to a project config file to tell b2 where the compiler is located. I'm a b2 novice, but this seemed like the best way to configure the project to use the compiler path from the CXX env var.
Without this, the b2 install stage uses the wrong compiler path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am curious does this work with tools.build:cxx
in the conf?
Unfortunately not. The |
(that came out more passive-agressive than intended, I understand the demands on the team's time! 😄 ) |
Raised in #18776 |
That's perfectly fine! I was curious since you had a test vector it would be easy to check :) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Conan v1 pipeline ✔️All green in build 3 (
Conan v2 pipeline ✔️
All green in build 3 (
|
* Use environment from VirtualBuildEnv to get CXX/CXXFLAGS * Write a project-config.jam file containing the toolset from CXX This ensures the b2 install command can find the correct compiler binary. --------- Co-authored-by: Chris Mc <christopherm@jfrog.com>
Specify library name and version: b2/4.9.6
Parts of the b2 recipe read environment variables with
os.environ.get()
. This no longer works if the environment is provided from a VirtualBuildEnv.Also, the
b2 install
step requires the correct compiler to be present, and will fail if the compiler isn't on the PATH. This is likely to be the case if the CXX environment variable is being used to specify the compiler binary. The best way to indicate the toolchain path to b2 seems to be to create aproject-config.jam
file with the path to the compiler (from the CXX flag).