-
-
Notifications
You must be signed in to change notification settings - Fork 319
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
Mingw link issue #3270
Mingw link issue #3270
Changes from 2 commits
fdd3664
4518d14
b68e505
dd340d5
3341dc6
3454ffa
88621c3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -167,7 +167,8 @@ def generate(env): | |
|
||
env['SHOBJSUFFIX'] = '.o' | ||
env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1 | ||
|
||
if 'CCFLAGS' in env: | ||
env['CCFLAGS'] = SCons.Util.CLVar(str(env['CCFLAGS']).replace('/nologo', '')) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Won't this fail badly if CCFLAGS is a list? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, I was assuming it was CLVar, but its user settable so really should check if its CLVar and if not make it one first before doing the replace. |
||
env['RC'] = 'windres' | ||
env['RCFLAGS'] = SCons.Util.CLVar('') | ||
env['RCINCFLAGS'] = '$( ${_concat(RCINCPREFIX, CPPPATH, RCINCSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)' | ||
|
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.
Curious why this started failing now?
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 know either, I don't know the last time we had the test/Win32/mingw.py test passing to see what changed since then.
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.
A bit of a weakness of our tests which just skip a test if the tool/setup is not there is if no CI environment is set up for a particular config, it just doesn't get tested. We have potential exposure on mingw, D, docbook, TeX, SWIG, packaging. Some of these have gotten added in recently, others fail to be added (e.g. the WiX toolset for msi packaging: apparently that code has rotted, or WiX has changed out from underneath it).
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. Some tests will create fake tools to run with always and/or if the tool doesn't exist in the environment. However in some cases that's insufficient to test if the scons code works. Ideally we'd get a list of all tools missing and/or causing tests to be skipped at the end of a test run.. but that could be considerable work to make happen.
Any thoughts on how to better address?
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.
Both Appveyor and Travis have good REST APIs for getting the logs. I could fashion a python script to get the logs of the latest master CI runs and parse the No Results at the end. That would make collecting the current list easier.
We could take that list and update a wiki page using the wiki git repository like in this example: https://stackoverflow.com/a/14673994/1644736
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.
Yeah, it will get an exception that 'str' has no member 'attributes' just below. I'm not sure if there is somewhere further up the chain that the target should have been converted.
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.
Still should be some kind of check here even if the real fix is somewhere else. Maybe a try/except? Add a warning message? I think assuming its a file if its a string is a pretty good default case.
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.
Yes. Can you change to try/except and put a comment in the except that we'd expect the target to be a Node at this point. And a # TODO to track down the why at some point?
I don't want to lose this discovery without some reasonable way of remembering to address it at some point if possible.
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 chased this down and found that mingw is getting an emitter list of [mslink.py winLibEmitter, link.py shlib_emitter, mingw.py shlib_emitter]. mslink's winLibEmitter never converts its new targets to File's and just leaves them as strings:
scons/src/engine/SCons/Tool/mslink.py
Lines 144 to 154 in 9f09013
The other tools with emitters take care to convert targets to File objects:
scons/src/engine/SCons/Tool/cyglink.py
Lines 100 to 106 in 9f09013
So the fix can be applied by converting the the targets in mslink.py's winLibEmitter to File's. Probably still want to have a check in link.py to convert str's as well.
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 left the if check instead of a try except because the current code looks cleaner than:
I am not sure about the speed up. Let me know your opinion.