-
Notifications
You must be signed in to change notification settings - Fork 40
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
build: introduce meson subprojects option #1856
Conversation
Download the built assets for this pull request: |
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'm thinking, maybe we should augment our dockerfiles rather than use subprojects so that we pre-install our static builds of uthash the same way we do ffmpeg and SDL?
On Gentoo Linux, downloading external dependencies via subprojects concept is forbidden (meson setup --wrap-mode nodownload). Then, when trying to package TRX, meson is failing with the following error on libtrx configuration while it tries to download/unpack the uthash library : > Executing subproject libtrx > > libtrx| Project name: libtrx > libtrx| Project version: undefined > libtrx| C compiler for the host machine: x86_64-pc-linux-gnu-gcc (gcc 13.3.1 "x86_64-pc-linux-gnu-gcc (Gentoo 13.3.1_p20241025 p1) 13.3.1 20241024") > libtrx| C linker for the host machine: x86_64-pc-linux-gnu-gcc ld.bfd 2.42 > libtrx| Using subprojects/libtrx/subprojects/uthash.wrap > > src/tr1/subprojects/libtrx/meson.build:35:9: ERROR: Automatic wrap-based subproject downloading is disabled On Gentoo, the uthash library is distributed by the package manager and installed in /usr/include. This commit introduces a new boolean meson option (subprojects), defaulting to true. With subprojects == true, meson is using the bundled uthash subproject library as usual. With subprojects == false, meson is trying to find the uthash.h header on the system (in /usr/include). It also checks for the right library version (currently 2.3.0). Partial meson output with -Dsubprojects=false when the header was found : > Executing subproject libtrx > > libtrx| Project name: libtrx > libtrx| Project version: undefined > libtrx| C compiler for the host machine: ccache cc (gcc 13.3.1 "cc > (Gentoo 13.3.1_p20241025 p1) 13.3.1 20241024") > libtrx| C linker for the host machine: cc ld.bfd 2.42 > libtrx| Fetching value of define "UTHASH_VERSION" : 2.3.0 > libtrx| Message: Found uthash library header version: 2.3.0 Same output with -Dsubprojects=false while the header was not found : > Executing subproject libtrx > > libtrx| Project name: libtrx > libtrx| Project version: undefined > libtrx| C compiler for the host machine: ccache cc (gcc 13.3.1 "cc > (Gentoo 13.3.1_p20241025 p1) 13.3.1 20241024") > libtrx| C linker for the host machine: cc ld.bfd 2.42 > [...]/TRX/src/tr1/subprojects/libtrx/meson.build:46:30: ERROR: Could not get define 'UTHASH_VERSION' Same output with -Dsubprojects=false while the header version mismatches : > Executing subproject libtrx > > libtrx| Project name: libtrx > libtrx| Project version: undefined > libtrx| C compiler for the host machine: ccache cc (gcc 13.3.1 "cc > (Gentoo 13.3.1_p20241025 p1) 13.3.1 20241024") > libtrx| C linker for the host machine: cc ld.bfd 2.42 > [..]TRX/src/tr1/subprojects/libtrx/meson.build:54:4: ERROR: Problem encountered: Found wrong uthash library header version: 2.2.0 Signed-off-by: Fabrice Delliaux <[email protected]>
@netfab I'm not sure if you had the chance to read my last comment. I'm fine with the proposed approach as well – just wanted to get your opinion on this. |
I'm sorry, I didn't think it was addressed to me. I am not familiar with docker and github workflows, but yes, I think that any dependencies should be treated in the same way. It seems strange to me that the build system (meson) to be in charge of downloading a missing build dependency. So yes, I think it would be better. |
Thanks. Would you like to lead the charge on the other approach? It involves working with Docker, so it's a bit more demanding. If you'd prefer not to, I'm happy to handle it, though my schedule is quite packed at the moment, so it might take some time. |
Unfortunately I have very little experience with docker, I wouldn't even know where to start. |
Apologies for the numerous force pushes – I was struggling to get the Mac builds to work, which currently unfortunately means CI-driven development. But it should be all good now. |
It works fine. I close this pull request. Thank you.
|
Checklist
Description
On Gentoo Linux, downloading external dependencies via subprojects concept is forbidden (meson setup --wrap-mode nodownload).
Then, when trying to package TRX, meson is failing with the following error on libtrx configuration while it tries to download/unpack the uthash library :
On Gentoo, the uthash library is distributed by the package manager and installed in /usr/include.
This commit introduces a new boolean meson option (subprojects), defaulting to true.
With subprojects == true, meson is using the bundled uthash subproject library as usual.
With subprojects == false, meson is trying to find the uthash.h header on the system (in /usr/include). It also checks for the right library version (currently 2.3.0).
Partial meson output with -Dsubprojects=false when the header was found :
Same output with -Dsubprojects=false while the header was not found :
Same output with -Dsubprojects=false while the header version mismatches :