Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

netfab
Copy link
Contributor

@netfab netfab commented Nov 9, 2024

Checklist

  • I have read the coding conventions
  • I have added a changelog entry about what my pull request accomplishes, or it is an internal change

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 :

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

@netfab netfab requested review from a team as code owners November 9, 2024 23:06
@netfab netfab requested review from rr-, lahm86 and walkawayy and removed request for a team November 9, 2024 23:06
Copy link

github-actions bot commented Nov 9, 2024

Copy link
Collaborator

@rr- rr- left a 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?

@rr- rr- added the Internal The invisible stuff label Nov 11, 2024
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]>
@rr-
Copy link
Collaborator

rr- commented Nov 12, 2024

@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.

@netfab
Copy link
Contributor Author

netfab commented Nov 12, 2024

@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.

@rr-
Copy link
Collaborator

rr- commented Nov 12, 2024

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.

@netfab
Copy link
Contributor Author

netfab commented Nov 13, 2024

Unfortunately I have very little experience with docker, I wouldn't even know where to start.
But there is no urgency. The main thing is that you are aware of this problem. Thank you.

rr- added a commit that referenced this pull request Nov 19, 2024
@rr- rr- mentioned this pull request Nov 19, 2024
2 tasks
@rr-
Copy link
Collaborator

rr- commented Nov 19, 2024

@netfab can you take a look at the alternative approach done in #1923 ?

We still are using dwarfstack, but it's a Windows-only dependency which should have no effect on Gentoo package ecosystem.

rr- added a commit that referenced this pull request Nov 19, 2024
rr- added a commit that referenced this pull request Nov 19, 2024
rr- added a commit that referenced this pull request Nov 19, 2024
rr- added a commit that referenced this pull request Nov 19, 2024
rr- added a commit that referenced this pull request Nov 19, 2024
rr- added a commit that referenced this pull request Nov 19, 2024
@rr-
Copy link
Collaborator

rr- commented Nov 19, 2024

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.

@netfab
Copy link
Contributor Author

netfab commented Nov 19, 2024

@netfab can you take a look at the alternative approach done in #1923 ?

It works fine. I close this pull request. Thank you.

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| Found pkg-config: YES (/usr/bin/x86_64-pc-linux-gnu-pkg-config) 2.3.0
libtrx| Run-time dependency libavcodec found: YES 60.31.102
libtrx| Run-time dependency libavformat found: YES 60.16.100
libtrx| Run-time dependency libavutil found: YES 58.29.100
libtrx| Run-time dependency sdl2 found: YES 2.30.7
libtrx| Run-time dependency libpcre2-8 found: YES 10.44
libtrx| Library backtrace found: NO
libtrx| Run-time dependency libswscale found: YES 7.5.100
libtrx| Run-time dependency libswresample found: YES 4.12.100
libtrx| Check usable header "uthash.h" : YES
libtrx| Run-time dependency zlib found: YES 1.3.1
libtrx| Run-time dependency gl found: YES 1.2
libtrx| Build targets in project: 1
libtrx| Subproject libtrx finished.

@netfab netfab closed this Nov 19, 2024
rr- added a commit that referenced this pull request Nov 19, 2024
@netfab netfab deleted the uthash branch January 12, 2025 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Internal The invisible stuff
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants