-
-
Couldn't load subscription status.
- Fork 39
Ticket #4803: replace LIBS with LDADD to fix tests deps and linkage
#4806
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
base: master
Are you sure you want to change the base?
Conversation
The low-level LIBS variable of autotools does not provide dependency tracking for sources and also does not resolve interdependencies between libraries. Replace it with high-level LDADD to make sure that tests get re-linked when underlying source files change, and also automatically consider dependent libraries. Signed-off-by: Yury V. Zaytsev <[email protected]>
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.
Verified again that it fixes my problem, thanks! :)
Can't comment on the implementation details.
|
The annoying Ubuntu issue must be because of the great Debian ideas around |
|
Do you mean this CI failure? Unfortunately I have no idea. I'm on Ubuntu 25.10, from a clean repo with your patch |
Yes, exactly. Our CI runs on Ubuntu 24.04 LTS. Maybe they finally decided to stop the nonsense by the time 25.10 got released? If yes, too bad it didn't make it into the LTS. :( |
|
Works for me on my 24.04 computer, too. It must be something different, some compile flags or LDFLAGS or some other difference in the enrivonment. |
Try |
|
Haha, sorry. Broken on 25.10 too. |
|
How co cancel my approval? I have an error with |
Each of test executables must be linked with all required libraries, but $(GLIB_LIBS) and @E2P_LIBS@ are removed now. |
|
the linking error probably stems from unintentional reliance on a transitive dependency, that is, some module uses glib, but fails to explicitly link it. note that libs/modules should use LIBADD, not LDADD, iiuc. |
I don't think that you can remove your approval with GitHub, but what you can do instead is to leave a new review requesting changes. This effectively cancels your previous approval. |
Yes, me removing these statements is correct and intentional. The question is how do you organize the linking of your executables? When you link your executable with an internal library that is part of your project like So either, you can define a variable that contains all the libraries that your executable needs, like Or you can organize your code in internal libraries and specify the dependencies for these libraries, like Our build system uses this second way: The tests, for whatever reason, used low-level The consequence was that you had to specify transitive dependencies yourself in addition to the libraries themselves, and also that if source files were changing the tests were not correctly rebuilt. I didn't investigate who introduced that code and why, but clearly, it's a misguided idea, to stay civil. Now I changed it to depend on the libraries in the correct way, fixing the source dependency tracking and automatic transitive dependency lookup. However, it has the consequence of breaking the build if The reason why this is a questionable idea in the first place is explained at length in #4803. Of course, in addition to that, we are obviously doing it wrong because I didn't check exactly why it happens, but either we are generally doing it wrong or it fails due to the interaction with Debian libtool patches specifically. In any case, I think I've had enough of this nonsense. It's time to remove the generation of the useless shared library. I will create a separate ticket for that. |
I'm not quite sure what you mean here. The tests are binaries, not libraries, so I'm using |
|
but it could be relevant for the missing transitive dep. just a random idea. |
Proposed changes
The low-level LIBS variable of autotools does not provide dependency tracking for sources and also does not resolve interdependencies between libraries.
Replace it with high-level LDADD to make sure that tests get re-linked when underlying source files change, and also automatically consider dependent libraries.
Resolves: #4803