-
-
Notifications
You must be signed in to change notification settings - Fork 775
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
Ubuntu 22.04 compilation issue: "error: ‘O_CLOEXEC’ undeclared (first use in this function); did you mean ‘FD_CLOEXEC’?" #1933
Comments
Workaround: diff --git a/meson.build b/meson.build
index 44fc844f..01ed86f4 100644
--- a/meson.build
+++ b/meson.build
@@ -35,7 +35,6 @@ project(
license: 'GPL-3.0-or-later OR BSD-3-Clause OR MIT',
# license_files: ['COPYING', 'COPYING-BSD', 'COPYING-MIT'], # Only available in meson 1.1.0
default_options: [
- 'c_std=c11',
'optimization=s',
'debug=true',
# 'warning_level=3', # TODO: Enable by default when all warnings are fixed |
Thank you for this report, however this is an issue on the HIDAPI fork, not this repo. It was already addressed in commit 9a5cb9f which is where the hidapi-0.14.0-meson tag should point which is what the Meson .wrap file points to in this repo. Please run Please note that "just" removing the C standard line is not actually the correct fix as this causes the library to be built with whatever standard the compiler defaults to. It very specifically needs an older GNU mode, hence how we fixed the issue on the fork. |
I cloned again:
I have verified that deps/hidapi does indeed contain the fix:
It looks like the root meson.build's default_options is overriding the sub-project configuration. This is the compiler invocation with the current root meson.build showing that FAILED: deps/hidapi/linux/libhidapi-hidraw.a.p/hid.c.o |
Different workaround: diff --git a/meson.build b/meson.build
index 44fc844f..054ec053 100644
--- a/meson.build
+++ b/meson.build
@@ -35,7 +35,7 @@ project(
license: 'GPL-3.0-or-later OR BSD-3-Clause OR MIT',
# license_files: ['COPYING', 'COPYING-BSD', 'COPYING-MIT'], # Only available in meson 1.1.0
default_options: [
- 'c_std=c11',
+ 'c_std=gnu99',
'optimization=s',
'debug=true',
# 'warning_level=3', # TODO: Enable by default when all warnings are fixed |
I found this issue: mesonbuild/meson#2612 (comment)
This is a bit odd since I would expect dependencies to come up with their own defaults. Looks like a different mechanism needs to be used in this case to avoid the root meson.build defining dependency-level configurations? |
To complete this picture, as we're not seeing this issue in CI or locally, what version of Meson are you running? ( Regarding your proposed fix that edits the project's main meson.build: unfortunately that won't work out because GNU modes subtly change semantics, and particularly downgrading the standard version is no-go as we are depending on C11 features. It's troubling in particular that the existing mitigation is not seeming to work for you either. Note that |
meson --version (Default for Ubuntu. Root readme.md states meson>0.61 so this should work ok?) |
Readme is likely out of date and that version of Meson is absolutely ancient. It's not even major release 1 - which was put out a full 2 years ago. Knowing that you're hitting a known bug that was fixed since, please upgrade your Meson installation. We will address this by updating the documentation to claim support only with a newer Meson than that as there is absolutely no way to fix this our side. Running Debian 12 ("Bookworm") here and even that packages v1.0.1 out the box for context on just how "absolutely ancient" Ubuntu's choice here is. With the backports channel we're running v1.5.1. |
That worked! The actual fix for this is then:
Then
|
Note: previous 1.0 builds might work as well. I have only tested with latest today (1.5.1). Fixes blackmagic-debug#1933
I tried gcc 10,11 and 12 with the same result.
Repro on 6.5.0-41-generic #41~22.04.2-Ubuntu :
meson setup build
meson compile
orninja
within the\build
folder:The text was updated successfully, but these errors were encountered: