-
-
Notifications
You must be signed in to change notification settings - Fork 324
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
🐛 Allow passing extra_libs
to CheckLibWithHeader
#4676
Conversation
The concept seems good... not sure why that argument was left out of the upper layer when it's present in the lower layer ( |
First time I contribute to |
Yes. That's why we have the checklist in the initial decription. |
And add this change to the docs as well. |
I mean, my remark was more like that test wouldn't test much? |
I should have added all things required. I'm not 100% sure about the doc (XML, really?! :)). |
Yes, xml, really :-) (this project dates back just a few years, like 20+). We can help with docs, there's not really much to do there for this kind of change. The configure stuff is a weird two-layer thing, SConf is the "API layer" and Conftest is the implementation layer. Except, they reach into each other and aren't as separated as they could be. Not making excuses. |
doc/man/scons.xml
Outdated
@@ -4244,6 +4244,7 @@ to serve as the test can be supplied in | |||
if not supplied, | |||
the default checks the ability to link against the specified | |||
<parameter>library</parameter>. | |||
<parameter>extra_libs</parameter> can be used to add additional libraries to link against. |
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.
@mwichmann - what's the blurb to indicate this is added in NEXT_RELEASE?
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.
Since the xml files are not processed by Sphinx, it needs the hand-crafted version:
<para>
<emphasis>Changed in version NEXT_RELEASE:</emphasis>
Added the <parameter>extra_libs</parameter> parameter.
</para>
It's a little unclear whether an existing method getting a new parameter is considered "added" or "changed". I'm tending to follow what CPython does, which is to consider that "changed" (though I admit that's not been consistent).
The corresponding markup in source code (aka the docstring) is:
.. versionchanged:: NEXT_RELEASE
Added the *extra_libs* parameter.
Still think this should be added to |
If I can figure out how to do it, I'm going to push an update to this that
|
Hmmm, I just spotted that this isn't passing on the Windows CI:
Will investigate soon if someone doesn't get there first... |
Need some guidance here... on Windows you have to link against the |
Manpage entries and docstrings updated with version-added specifiers. Signed-off-by: Mats Wichmann <[email protected]>
Add boilderplate header/footer, fix one place where the wrong (non-portable) name for a library was used. Still does not build on Windows, due to mismatch between .dll/.lib construction. Signed-off-by: Mats Wichmann <[email protected]>
"Muscle memory" had me add calls to skip tools for DefaultEnvironment, but the two library builds use it, so that was just plain wrong. Restored prior state. Signed-off-by: Mats Wichmann <[email protected]>
@mwichmann My guess is that A.dll does not export any symbols; therefore, an import library is not generated. |
That's certainly true for the test file in the PR. I've added those in a worktree here, and it still doesn't, so I think I must be doing something wrong with that. |
The following builds libA with MSVC from the command-line outside of the test. It correctly produces the A.lib file. I haven't checked to see if it breaks gnu/gcc yet. It shouldn't but one never knows. libA/libA.h:
libA/libA.c:
libA/SConstruct:
I updated the test and it failed though. P.S.: pretty sure the extra backslash in the print statement is erroneous. |
I have an alternate independently developed example which does work, so later I'll reconcile the two and hopefully find what errors I made adjusting the original. |
yes, that looks like what it should want. And the backslash is left over from when it was a string-print in the testcase, once listed as raw-string, then not, then I think put back. Anyway, this should be enough to wrap it up. |
Attached is a version of test/Configure/CheckLibWithHeader_extra_libs.py which appears to pass on Windows using msvc and WSL using gcc. CheckLibWithHeader_extra_libs.zip In hindsight, the double backslash may be necessary in the test since it is not inside a raw string (e.g., |
thanks. I have one working here, but will look over. |
Signed-off-by: Mats Wichmann <[email protected]>
Okay, this should be working now. Thanks to @jcbrill for confirming that what I was figuring out was on a workable path. |
Thanks for bringing this forward :) |
Signed-off-by: Mats Wichmann <[email protected]>
SharedLibrary(target='A', source=['libA.c'], CPPDEFINES='BUILDINGSHAREDLIB') | ||
""", | ||
) | ||
test.dir_fixture(['fixture', 'checklib_extra', 'libA'], 'libA') |
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 think you should just be able to do this once as
test.dir_fixture(['fixture', 'checklib_extra'])
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 suppose. If you think it's worth doing yet another iteration...
Contributor Checklist:
CHANGES.txt
andRELEASE.txt
(and read theREADME.rst
).