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

Meson generates a build.ninja file with incorrect dependencies #11047

Closed
vlopezh opened this issue Nov 15, 2022 · 0 comments · Fixed by #11585
Closed

Meson generates a build.ninja file with incorrect dependencies #11047

vlopezh opened this issue Nov 15, 2022 · 0 comments · Fixed by #11585

Comments

@vlopezh
Copy link

vlopezh commented Nov 15, 2022

Describe the bug
(Regression in 0.64.0) Meson generates a build.ninja file with incorrect dependencies if all these three situations are present in the meson.build:

  • The project() function has language fortran , either as unique language or secondary
  • A target depends on objects extracted from another target
  • The first target contains source and header files

To Reproduce
meson.build:

project('test_project', 'c',
  'fortran',
)

sources_tmp = [
  't1.c',
  't1.h',
]

libtmp = static_library(
  'tmp', sources_tmp,
  install: false,
)

tmp_objects = libtmp.extract_all_objects(recursive : true)

sources = [
  't2.c',
]

libfinal = library(
  'final', sources,
  objects : tmp_objects,
)

Source and headers may be empty (touch t1.c t1.h t2.c). After a meson setup, the command ninjareturns:

ninja: error: 'libfinal.so.p/libtmp.a', needed by 'libfinal.so.p/t2.c.o', missing and no known rule to make it

Either commeting line 2 (fortran) or line 7 ('t1.h',) makes the error to disappear.

system parameters

  • plain native build
  • O.S.: Arch Linux
  • python --version: 3.10.8
  • meson --version: 0.64.0
  • ninja --version: 1.11.1
Volker-Weissmann added a commit to Volker-Weissmann/meson that referenced this issue Mar 24, 2023
Volker-Weissmann added a commit to Volker-Weissmann/meson that referenced this issue Mar 24, 2023
Volker-Weissmann added a commit to Volker-Weissmann/meson that referenced this issue Mar 24, 2023
Volker-Weissmann added a commit to Volker-Weissmann/meson that referenced this issue Mar 24, 2023
Volker-Weissmann added a commit to Volker-Weissmann/meson that referenced this issue Mar 25, 2023
Volker-Weissmann added a commit to Volker-Weissmann/meson that referenced this issue Mar 25, 2023
Volker-Weissmann added a commit to Volker-Weissmann/meson that referenced this issue Apr 26, 2023
jpakkane pushed a commit that referenced this issue May 13, 2023
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

Successfully merging a pull request may close this issue.

1 participant