-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
gnome.compile_resources builds wrong paths since 0.44 #2860
Comments
FYI: I'm getting quite a few reports about the fwupd build being "broken" so any help welcome. I'm going to suggest that Fedora reverts to an older meson version or to backport any fix if it comes quickly. |
From a cursory look, I don't know much about the gnome module, but it seems to me it depends on the old (wrong) behavior of custom targets not adding the subdir to str dependencies. |
Once this and other regressions are fixed, we will release 0.44.1. This regression was probably caused by me, so I'll take a look at it. |
I know you're handling this @nirbheek, so I am just thinking out loud here. The simple fix would be to strip the subdir from the str dependencies in the gnome module, so the backend can add them again. Perhaps something like: diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
index ad99c14d..a8bc90d5 100644
--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
@@ -19,6 +19,7 @@ from .. import build
import os
import copy
import subprocess
+from pathlib import PurePath
from . import ModuleReturnValue
from ..mesonlib import MesonException, OrderedSet, Popen_safe, extract_as_list from ..dependencies import Dependency, PkgConfigDependency, InternalDependency @@ -244,6 +245,15 @@ class GnomeModule(ExtensionModule):
def exists_in_srcdir(f):
return os.path.exists(os.path.join(state.environment.get_source_dir(), f))
+ def strip_subdir(f):
+ if os.path.isabs(f):
+ return f
+ pure_f = str(PurePath(f))
+ prefix = os.path.commonpath([state.subdir, pure_f])
+ if pure_f.startswith(prefix):
+ return pure_f[len(prefix) + 1:]
+ return f
+
depends = []
subdirs = []
for resfile in dep_files[:]:
@@ -282,6 +292,7 @@ class GnomeModule(ExtensionModule):
'generated file, pass the target that generates it to '
'gnome.compile_resources() using the "dependencies" '
'keyword argument.' % (resfile, input_file))
+ dep_files[dep_files.index(resfile)] = strip_subdir(resfile)
return dep_files, depends, subdirs
def _get_link_args(self, state, lib, depends=None, include_rpath=False, The question is if this is actually the right level to fix it at. Why are subdirs added by the backend? Also, the comments in the gnome module talk about some magic regarding generated files, I don't know if this would affect that. |
I'm also seeing this same issue with qt5 resource generation... (and reverting commit 5219333 also fixes it). Should I open up a new bug report for that? I can also cook up a patch once the recommended solution to this bug is decided. |
Also add a unit test that will test all codepaths for old Glib tools versions. Closes #2860
Also add a unit test that will test all codepaths for old Glib tools versions. Closes #2860
Also add a unit test that will test all codepaths for old Glib tools versions. Closes #2860
Also add a unit test that will test all codepaths for old Glib tools versions. Closes #2860
Also add a unit test that will test all codepaths for old Glib tools versions. Closes #2860
Also add a unit test that will test all codepaths for old Glib tools versions. Closes #2860
Since upgrading to meson 0.44, the paths generated from a call to gnome.compile_resources include the subdirectory twice, breaking the build.
This is on Slackware Linux 14.2 x86_64 using meson 0.44. Example projects breaking are appstream-glib and fwupd.
appstream-glib includes this in its meson.build:
That results in this in the build.ninja file:
note the double
libappstream-glib
directory.The same happens with fwupd:
note the duplicated
src
directory.The builds were fine with meson 0.43.
Reverting the commit 5219333 unbreaks the build, but that commit was added to fix #2633.
I initially reported this as an appstream-glib issue here hughsie/appstream-glib#216, but it seems to be a meson regression.
Slackbuilds for meson, appstream-glib, and fwupd are here:
https://slackbuilds.org/slackbuilds/14.2/libraries/appstream-glib/appstream-glib.SlackBuild
https://slackbuilds.org/repository/14.2/libraries/appstream-glib/
https://slackbuilds.org/slackbuilds/14.2/development/meson/meson.SlackBuild
https://slackbuilds.org/repository/14.2/development/meson/
http://slackbuilds.org/slackbuilds/14.2/system/fwupd/fwupd.SlackBuild
http://slackbuilds.org/repository/14.2/system/fwupd/
The appstream-glib build includes a work-around for now to remove the duplicated paths from the generated ninja files.
The text was updated successfully, but these errors were encountered: