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

new profile [runenv] section #12230

Merged
merged 4 commits into from
Oct 4, 2022

Conversation

memsharded
Copy link
Member

@memsharded memsharded commented Oct 2, 2022

Changelog: Feature: Implement a new [runenv] section in the Profile, to define the runtime environment.
Docs: conan-io/docs#2771

I hit this limitation while preparing docs for Windows-CLang integration:

  • When building for Msys2-Clang, I can add [buildenv]...<path/to/clang/bin> so the clang compiler is found
  • But when I am executing a test_package test() or something in the "run" scope, like self.run("myexe", env="conanrun") it will fail, because it cannot find the libc++.dll and libunwind.dll shared libs in the msys2 clang folder.

@memsharded memsharded added this to the 1.53 milestone Oct 2, 2022
@memsharded memsharded marked this pull request as ready for review October 2, 2022 23:16
Copy link
Contributor

@jcar87 jcar87 left a comment

Choose a reason for hiding this comment

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

Just a very minor comment.

But when I am executing a test_package test() or something in the "run" scope, like self.run("myexe", env="conanrun") it will fail, because it cannot find the libc++.dll and libunwind.dll shared libs in the msys2 clang folder.

Is this with a clang-cl.exe or clang++.exe that are not part of a "system" package or similar? Otherwise I'm surprised libc++.dll is not already found in the "default" search path in this environment (although I'm not very familiar with msys2)

conans/model/conan_file.py Outdated Show resolved Hide resolved
Co-authored-by: Luis Caro Campos <3535649+jcar87@users.noreply.github.com>
@memsharded
Copy link
Member Author

Is this with a clang-cl.exe or clang++.exe that are not part of a "system" package or similar? Otherwise I'm surprised libc++.dll is not already found in the "default" search path in this environment (although I'm not very familiar with msys2)

Yes, the msys2 clang++.exe can be installed in a custom location, like C:/msys2/clang64/bin/clang++.exe. This C:/msys2/clang64/bin folder can be indeed added to the system PATH and everything will work. But if this folder is not added, and it is defined in the Conan profile (which makes sense if we are dealing with multiple compilers and versions), then, the libc++.dll will not be in the path either.

This behavior is hidden because in test we add the pytest.mark.tool("msys2") to the test, which injects the path to msys2 during the whole test.

@memsharded memsharded requested a review from czoido October 4, 2022 07:49
@memsharded memsharded merged commit 0f05b1b into conan-io:develop Oct 4, 2022
@memsharded memsharded deleted the feature/profile_runenv branch October 4, 2022 09:54
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.

3 participants