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] For Visual Studio, pass some values of settings.compiler.toolset to B2 #5119

Merged
merged 4 commits into from
Oct 9, 2021
Merged

[boost] For Visual Studio, pass some values of settings.compiler.toolset to B2 #5119

merged 4 commits into from
Oct 9, 2021

Conversation

datalogics-kam
Copy link
Contributor

@datalogics-kam datalogics-kam commented Apr 2, 2021

Specify library name and version: conan/1.75.0

This fixes a problem we had where compiler.version=16 and compiler.toolset=v141, but B2 was still using the v142 compiler.

  • If compiler.toolset is set, use that rather than inferring the toolset from the compiler.version.
  • If the toolset is specified, don't also use tools.vcvars(). Doing so seems to cause B2 to build Boost with the wrong toolset, even though it says it chose the desired compiler.

I implemented this for compiler.toolset that is in the form vNNN. I'm unsure of how the other values from `settings.yml' work. I would expect that people that use those toolsets could extend this work.


  • 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.

@datalogics-kam datalogics-kam changed the title [boost] For Visual Studio, pass some vailues settings.compiler.toolset to B2 [boost] For Visual Studio, pass some values of settings.compiler.toolset to B2 Apr 2, 2021
@ghost
Copy link

ghost commented Apr 2, 2021

@conan-center-bot

This comment has been minimized.

@datalogics-kam
Copy link
Contributor Author

The failure was:

MSBUILD : error MSB4166: Child node "5" exited prematurely. Shutting down.

It's a problem we run into a lot when there are multiple parallel builds running on the same machine.

The failure can probably be avoided globally for all jobs by setting the environment variable MSBUILDDISABLENODEREUSE=1, see here.

@ghost ghost mentioned this pull request Apr 13, 2021
4 tasks
@conan-center-bot

This comment has been minimized.

@datalogics-kam
Copy link
Contributor Author

I rebased this to get it onto the latest master branch and to run the tests again. It's still getting this.

MSBUILD : error MSB4166: Child node "2" exited prematurely.

As mentioned above, that's not related to the code but to a well-known problem with MSBuild.

How can we resolve this? We've had the same problem at our company, and we solved it by telling MSBuild to not reuse nodes.

@stale
Copy link

stale bot commented Jun 25, 2021

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.

@@ -1189,9 +1193,20 @@ def create_library_config(deps_name, name):
filename = "%s/user-config.jam" % folder
tools.save(filename, contents)

@property
def _msvc_toolset(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@prince-chrismc
Copy link
Contributor

👋 @uilianries @SSE4 @madebr @SpaceIm This is an old PR that seems to fix how settings are passed.

It looks correct to me but I am not sure what the implications might be, if you have a chance please review 👀

@conan-center-bot

This comment has been minimized.

@datalogics-kam
Copy link
Contributor Author

I'm confused about some of the failures, because

conan create recipes/boost/all boost/1.70.0@kam/testing -s arch=armv8 --build missing

...is working for me, with a configuration of:

Configuration:
[settings]
arch=armv8
arch_build=x86_64
build_type=Release
compiler=apple-clang
compiler.libcxx=libc++
compiler.version=12.0
os=Macos
os_build=Macos
[options]
[build_requires]
[env]

Xcode 12.4 and CMake 3.19.1.

Recommendations?

@prince-chrismc
Copy link
Contributor

👋 @jgsogo @SpaceIm Boost is failing on the new Mac M1 profile... I've never worked on it so hopefully you guys can take a peak and help us 🙏

@prince-chrismc
Copy link
Contributor

Ohh I found this in another PR #6929 (comment)

@datalogics-kam
Copy link
Contributor Author

@prince-chrismc @SpaceIm @jgsogo I just realized that my attempts to use boost/1.77 in some new work may be failing because I'm using the CCI recipe for that, and I think I need these changes (to use VS 2019 with toolset 141).

What can we do to resurrect this PR?

@prince-chrismc
Copy link
Contributor

Rebase and let's see if the build passes!

Translates settings.compiler.toolset settings in the form vNNN to
a toolset version, overriding the use of the settings.compiler.version.

This allows building with Visual Studio 2019 while using older toolsets.
It appears that if the environment variables are set, B2 will use the
compiler set by tools.vcvars() despite the toolset setting.

Even without tools.vcvars(), B2 seems to find the compiler and other
tools.
Eliminate all the guessing of version numbers and use the calculations and
defaults in tools.msvs_toolset()

Retain the conversion of the version number to what B2 wants: v141 -> 14.1 for
instance.
Use tools.vcvars() unless the user specified a toolset manually.
@conan-center-bot
Copy link
Collaborator

All green in build 7 (747d9a65e7589369534d72664ad5637ce02a6adc):

  • boost/1.69.0@:
    All packages built successfully! (All logs)

  • boost/1.70.0@:
    All packages built successfully! (All logs)

  • boost/1.74.0@:
    All packages built successfully! (All logs)

  • boost/1.71.0@:
    All packages built successfully! (All logs)

  • boost/1.72.0@:
    All packages built successfully! (All logs)

  • boost/1.77.0@:
    All packages built successfully! (All logs)

  • boost/1.73.0@:
    All packages built successfully! (All logs)

  • boost/1.75.0@:
    All packages built successfully! (All logs)

  • boost/1.76.0@:
    All packages built successfully! (All logs)

@conan-center-bot conan-center-bot merged commit f7e314e into conan-io:master Oct 9, 2021
@prince-chrismc
Copy link
Contributor

Magic! 🧙

@datalogics-kam
Copy link
Contributor Author

🥳 Thanks, everyone!

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.

6 participants