-
Notifications
You must be signed in to change notification settings - Fork 984
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
AutotoolsToolchain: curate paths coming from tools.build:compiler_executables
on Windows before defining CC
, CXX
etc
#12194
Closed
Closed
Changes from all 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 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from conan.tools.microsoft.win32api import win32api |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import os | ||
|
||
if os.name == "nt": | ||
import ctypes | ||
from ctypes import wintypes | ||
|
||
|
||
def get_short_path_name(path): | ||
try: | ||
_GetShortPathNameW = ctypes.windll.kernel32.GetShortPathNameW | ||
_GetShortPathNameW.argtypes = [wintypes.LPCWSTR, wintypes.LPWSTR, wintypes.DWORD] | ||
_GetShortPathNameW.restype = wintypes.DWORD | ||
output_buf_size = 0 | ||
while True: | ||
output_buf = ctypes.create_unicode_buffer(output_buf_size) | ||
needed = _GetShortPathNameW(path, output_buf, output_buf_size) | ||
if output_buf_size >= needed: | ||
return output_buf.value | ||
else: | ||
output_buf_size = needed | ||
except: | ||
return path |
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.
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.
This needs explanation why it is needed, I am not sure how this is related to improving the AutotoolsToolchain
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 explained in #12194 (comment):
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 is too complicated, difficult to maintain. I prefer to limit the functionality to paths without spaces, honestly, we cannot add this complexity to satisfy every corner case in the world. If autotools does not support paths with spaces, it does not support paths with spaces, so things should go in paths without spaces.
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.
But why not implementing this workaround if it works? It's not so complicated and allows to support absolute path to Visual Studio. For me underlying build system is an internal detail.
It shouldn't fail to build if someone specificy some usual profile (CC set to a specific compiler, CC not set so it takes default compiler).
It should honor CC, CXX, LD, etc from profile (overridding CC to just
cl
is the very last solution because you may not honor compiler version from profile when there are several Visual Studio installations).