-
Notifications
You must be signed in to change notification settings - Fork 1.1k
AutotoolsToolchain: curate paths coming from tools.build:compiler_executables on Windows before defining CC, CXX etc
#12194
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
Closed
Closed
Changes from 20 commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
43ceb98
set LD to link & add -nologo
SpaceIm 44ee28c
honor CC, CXX, LD from profile
SpaceIm bbc8cf7
handle more cases on windows
SpaceIm 73345fa
refactor
SpaceIm dddfa50
also handle NM
SpaceIm 1eed250
refactor again
SpaceIm 6b69fd2
formatting
SpaceIm 6b7743c
also handle AR
SpaceIm 9977d83
refactor again
SpaceIm 73c2e19
small change
SpaceIm 6e9295b
add more variables
SpaceIm 3ad51c3
add comments
SpaceIm 305783b
add two new attributes to prefix CC, CXX & ARLIB with compatibility w…
SpaceIm fc3c72c
add cc, cxx, ld, ar, nm, objdump, ranlib & trip attributes
SpaceIm 40fdb20
add compiler_wrapper & arlib_wrapper to arguments of constructor
SpaceIm f03d98d
default extra_options to None
SpaceIm c160c7b
typo
SpaceIm a81f43a
rename to arlib_wrapper to ar_wrapper
SpaceIm 6a415fd
use VirtualBuildEnv to get env vars from profile
SpaceIm 746bff5
do not add -nologo to AR if msvc
SpaceIm ea62645
don't check existence of wrapper
SpaceIm a2a2a5d
do not allow spaces in env var paths for autotools
SpaceIm 7d4adf1
minor change
SpaceIm b539767
improve windows support
SpaceIm 47b8213
move import of win32api where it is used
SpaceIm a3f77e1
add 4 conf to define build executables
SpaceIm 39001d3
Merge branch 'develop' into autotoolstoolchain-msvc
SpaceIm 49d2cd7
some fixes following merge
SpaceIm c994932
more fixes
SpaceIm c902918
minor change
SpaceIm e393600
less babysitting, only curate path
SpaceIm 49264d8
minor change
SpaceIm 8ab97ab
simplify curated_path
SpaceIm 22abcaa
only manage env vars related to tools which may be provided by tools.…
SpaceIm e885850
do not compute these paths on instance creation
SpaceIm 3bb2dc9
typo
SpaceIm 3172628
simplify even more
SpaceIm b878025
Merge branch 'develop' into autotoolstoolchain-msvc
SpaceIm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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've tested and it's always
None, regardless of env var I put under[env]in my profile (tested with 1 & 2 profiles).I've tried with
VirtualBuildEnvandconans.tools.get_env. What's wrong? I see thatMesonToolchainalso tries to getCC,CXXetc from profile withVirtualBuildEnv, does it work actually?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 don't have much experience with conan 2.0 (yet), but did you use a
[buildenv]section in your host profile? See this link.Uh oh!
There was an error while loading. Please reload this page.
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.
Indeed thanks, it honors env from profile now.
But now I see two issues:
VirtualBuildEnvis called afterAutotoolsToolchainingenerate()of a recipe (I'm testing with m4: conan v2 support conan-center-index#13135), it overrides all the CC etc logic ofAutotoolsToolchain, so it's very important to callVirtualBuildEnvbefore any other generator also relying onEnvironmentto set env vars.unix_pathdoesn't help (nor protecting spaces with\, or protecting full path with quotes, and I've tested with and without env vars wrapped by compile & ar-lib, errors either happen in those wrappers or later on in configure).For example for
CC,C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\bin\Hostx64\x64\cl.exein profile is converted to/c/users/spaceim/.conan/data/m4/1.4.19/_/_/build/0a420ff5c47119e668867cdb51baff0eca1fdb68/src/build-aux/compile /c/program files/microsoft visual studio/2022/community/vc/tools/msvc/14.33.31629/bin/hostx64/x64/cl.exe -nologoin m4: conan v2 support conan-center-index#13135.Uh oh!
There was an error while loading. Please reload this page.
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.
For the second point, the best I can do is display a warning and suggest to set CC etc with short file names.
For example on my computer I can set in profile:
then it works and full path is honored