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 fails with musl libc: error: 'FNM_EXTMATCH' undeclared here #177

Open
ncopa opened this issue Sep 11, 2023 · 3 comments
Open

build fails with musl libc: error: 'FNM_EXTMATCH' undeclared here #177

ncopa opened this issue Sep 11, 2023 · 3 comments

Comments

@ncopa
Copy link

ncopa commented Sep 11, 2023

Build fails on alpine linux (edge):

...
[31/37] Compiling C object src/io.elementary.vala-lint.p/meson-generated_FileData.c.o
[32/37] Compiling C object src/io.elementary.vala-lint.p/meson-generated_Application.c.o
ninja: job failed: gcc -Isrc/io.elementary.vala-lint.p -Isrc -I../src -Ilib -I../lib -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/vala-0.56 -I/usr/include/json-glib-1.0 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -w '-DGETTEXT_PACKAGE="io.elementary.vala-lint"' -Os -fomit-frame-pointer -Os -fomit-frame-pointer -fPIE -pthread -MD -MQ src/io.elementary.vala-lint.p/meson-generated_Application.c.o -MF src/io.elementary.vala-lint.p/meson-generated_Application.c.o.d -o src/io.elementary.vala-lint.p/meson-generated_Application.c.o -c src/io.elementary.vala-lint.p/Application.c
src/io.elementary.vala-lint.p/Application.c:120:52: error: 'FNM_EXTMATCH' undeclared here (not in a function); did you mean 'FNM_NOMATCH'?
  120 | static gint vala_lint_application_fnmatch_flags = (FNM_EXTMATCH | FNM_PERIOD) | FNM_PATHNAME;
      |                                                    ^~~~~~~~~~~~
      |                                                    FNM_NOMATCH
ninja: subcommand failed

FNM_EXTMATCH seems to be a GNU extension.

Introduced in 923adb5

@ncopa
Copy link
Author

ncopa commented Feb 7, 2024

Does vala-lint actually support anything other than GNU libc? Please let us know if not so we can delete the package from Alpine Linux.

@mzpqnxow
Copy link

FYI- there's a patch to add FNM_EXTMATCH to musl here though I can't (yet) comment on whether it resolves your issue (I'm actually applying it for the purpose of building libelf, not vala)

@ncopa
Copy link
Author

ncopa commented May 7, 2024

Just defining FNM_EXTMATCH to 0 will make it compile but it will not make the extended pattern matches work.

The code does:

 ignore_pattern_list += ("|" + pattern);

As I read that, it means that they try to match files with extended fnmatch doing file1|file2|file3. That needs to be refactored if this is supposed to work on POSIX and not only GNU.

Alternatively clearly document that nothing but GNU is supported (so we can delete the package from alpine).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants