Bug 2390464
| Summary: | Meson no longer detects Fortran module dependencies | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Susi Lehtola <susi.lehtola> |
| Component: | meson | Assignee: | Zbigniew Jędrzejewski-Szmek <zbyszek> |
| Status: | NEW --- | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | high | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 43 | CC: | caitlinwhittaker, carl, igor.raits, kalevlember, pbonzini, suraj.ghimire7, wtaymans, zbyszek |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | --- | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | Type: | --- | |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 2385747 | ||
Hmm, I haven't used the fortran support in meson, but looking at the files, the
dependency just doesn't seem to be declared:
xtb_exe = executable(sources: prog, dependencies: xtb_dep_static, …)
xtb_dep_static = declare_dependency(link_with: xtb_common, …)
xtb_common = get_option('default_library') == 'both' ? xtb_lib.get_static_lib() : xtb_lib
xtb_lib = library(srcs, …)
So srcs has to be processed before the linking phase of xtb_exe, but
nothing indicates that it needs to be processed before the compilation step
of xtb_exe.
https://github.com/mesonbuild/meson/pull/12539 looks like it could be related.
But looking at the patches in that series, I see:
# Fortran is a bit weird (again). When you link against a library, just compiling a source file
# requires the mod files that are output when single files are built. To do this right we would need to
# scan all inputs and write out explicit deps for each file. That is too slow and too much effort so
# instead just have a full dependency on the library. This ensures all required mod files are created.
So it seems that the intent was to automatically handle the dependency,
contrary to what I wrote above.
Paolo, any idea about this? I think the first question is whether the xtb
config is correct or if it justed worked by accident previously…
The build works with the following workaround:
---------------&<--------------------------------------------------------------------------
diff --git xtb.spec xtb.spec
index abb57d2d21..7a9c1c7c4f 100644
--- xtb.spec
+++ xtb.spec
@@ -87,6 +87,7 @@ character(len=*),parameter :: version = "%{version}-%{release}%{dist}"
character(len=*),parameter :: date = "$date"
character(len=*),parameter :: author = "Fedora project"
EOF
+ninja -C %{_vpath_builddir} -j %{_smp_build_ncpus} %{?__meson_verbose:--verbose} libxtb.a
%meson_build
%install
--------------->&--------------------------------------------------------------------------
Another workaround, that shows how this is supposed to work: $ ninja libxtb.so.6.7.1.p/depscan.json $ sed 's/so\.6\.7\.1/a/' libxtb.so.6.7.1.p/depscan.json > libxtb.a.p/depscan.json $ ninja The build.ninja rule for libxtb.a.p/depscan.json has no dependencies. I'll report the issue upstream. |
The builds of xtb have started to fail. The error is ../src/prog/argparser.f90:20:8: 20 | use xtb_mctc_accuracy, only : wp | 1 Fatal Error: Cannot open module file ‘xtb_mctc_accuracy.mod’ for reading at (1): No such file or directory compilation terminated. xtb is built using meson and ninja. The missing file ‘xtb_mctc_accuracy.mod’ is generated from xtb/src/mctc/accuracy.f90, which means that meson/ninja is no longer handling this dependence correctly. Reproducible: Always Steps to Reproduce: try to rebuild xtb package Actual Results: package fails to build Expected Results: package builds