Merge ~zhsj/ubuntu/+source/gobject-introspection:ubuntu/noble into ubuntu/+source/gobject-introspection:ubuntu/noble

Proposed by Shengjing Zhu
Status: Needs review
Proposed branch: ~zhsj/ubuntu/+source/gobject-introspection:ubuntu/noble
Merge into: ubuntu/+source/gobject-introspection:ubuntu/noble
Diff against target: 187 lines (+148/-1)
5 files modified
debian/.gitignore (+16/-0)
debian/changelog (+23/-0)
debian/control (+2/-1)
debian/patches/giscanner-Be-more-thorough-about-applying-Wl-no-as-needed.patch (+106/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Simon Chopin (community) Needs Fixing
Review via email: mp+466076@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Simon Chopin (schopin) wrote :

Hi Shengjing,

While I understand that the practical effect are almost the same, could you please provide this fix as a cherry-pick on top of the version in Noble, rather than a wholesale backport? That's the standard way for SRUs, and makes it easier for observers to understand that it's a standard SRU, not an MRE or any other kind of exceptional process.

review: Needs Fixing
Revision history for this message
Shengjing Zhu (zhsj) wrote (last edit ):

I don't get the idea when there is no difference. This is a targeted fix only. The only difference is the version string. I think you want something like 1.80.1-2ubuntu24.04.1. But compared to 1.80.1-3~ubuntu24.04.1, the latter makes clear that the fix has been proven to work in oracular. It can't be confused with MRE, since the upstream version is not changed. Besides, when people going to fix something in future, they can just start to look at version after 1.8.1-3 in oracular and cherry-pick commits.

Revision history for this message
Simon Chopin (schopin) wrote :

Yes, your points are valid, but that's not how we do SRUs. We don't backport versions, we cherry-pick fixes, because we want to ensure we only get the bugfix, nothing else, in order to minimize regression potential. For instance, with your backport, something *could* actually go wrong, since you're adding a .gitignore file. That file could be buggy, and lead to unwanted files being included in the final upload.

The version number is a natural consequence of that process, not the endgoal. If I see an upload with -XubuntuY.Z that's indicative of that minimalistic process. OTOH, -X~ubuntuYY.ZZ is showing that something else happened.

Revision history for this message
Shengjing Zhu (zhsj) wrote (last edit ):

> For instance, with your backport, something *could* actually go wrong, since you're adding a .gitignore file. That file could be buggy, and lead to unwanted files being included in the final upload.

IMO you should compare and review the source package when uploading. There will also be buggy gitignore files globally in your home directory.

So if the new version only has the targeted fixes, what the version number should be used when backporting (or you can call it cherry-pick) to stable release? I don't see it has been written down somewhere. Shall we do it to avoid confusion in future?

Revision history for this message
Simon Chopin (schopin) wrote :
Revision history for this message
Shengjing Zhu (zhsj) wrote :

> https://wiki.ubuntu.com/SecurityTeam/UpdatePreparation#Update_the_packaging is the standard way to do it.

I mean it doesn't say if the change is like fast-forward thing.

Revision history for this message
Simon Chopin (schopin) wrote :

> > https://wiki.ubuntu.com/SecurityTeam/UpdatePreparation#Update_the_packaging
> is the standard way to do it.
>
> I mean it doesn't say if the change is like fast-forward thing.

There is no notion of fast forward in the general case.

What I'm expecting to happen is a single commit (well, two if you split out the changelog in proper git-ubuntu etiquette) based off ubuntu/noble-devel that contains the fix and *only* the fix. There should be no mention of the 1.80.1-2 and 3 releases, although it'd be polite to credit the Debian contributor in the changelog.

Unmerged commits

d8091bc... by Shengjing Zhu

Update changelog for 1.80.1-3~ubuntu24.04.1 release

37c9a18... by Simon McVittie

1.80.1-3 (patches unapplied)

Imported using git-ubuntu import.

3aace32... by Jeremy Bícha

1.80.1-2 (patches unapplied)

Imported using git-ubuntu import.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/.gitignore b/debian/.gitignore
2new file mode 100644
3index 0000000..7906d36
4--- /dev/null
5+++ b/debian/.gitignore
6@@ -0,0 +1,16 @@
7+/*.debhelper
8+/*.debhelper.log
9+/*.substvars
10+/.debhelper/
11+/debhelper-build-stamp
12+/dh_girepository.1
13+/extra-substvars
14+/files
15+/gir1.2-freedesktop/
16+/gir1.2-glib-2.0/
17+/gobject-introspection/
18+/libgirepository-1.0-1.symbols
19+/libgirepository-1.0-1/
20+/libgirepository1.0-dev/
21+/libgirepository1.0-doc/
22+/tmp/
23diff --git a/debian/changelog b/debian/changelog
24index 64a47ee..2812cb1 100644
25--- a/debian/changelog
26+++ b/debian/changelog
27@@ -1,3 +1,26 @@
28+gobject-introspection (1.80.1-3~ubuntu24.04.1) noble; urgency=medium
29+
30+ * Rebuild for Noble (LP: #2065902)
31+
32+ -- Shengjing Zhu <shengjing.zhu@canonical.com> Thu, 16 May 2024 21:23:42 +0800
33+
34+gobject-introspection (1.80.1-3) unstable; urgency=medium
35+
36+ * d/p/giscanner-Be-more-thorough-about-applying-Wl-no-as-needed.patch:
37+ Add proposed patch to apply -Wl,--no-as-needed more thoroughly.
38+ This avoids build regressions in libkkc and ibus-anthy, which pass
39+ libraries to `g-ir-scanner --library` that do not contain any functions
40+ directly called by the dumper.
41+ (Closes: #1060951, #1060953) (Mitigates: #1071116)
42+
43+ -- Simon McVittie <smcv@debian.org> Tue, 14 May 2024 18:42:37 +0100
44+
45+gobject-introspection (1.80.1-2) unstable; urgency=medium
46+
47+ * Release to unstable
48+
49+ -- Jeremy Bícha <jbicha@ubuntu.com> Sat, 04 May 2024 12:39:14 -0400
50+
51 gobject-introspection (1.80.1-1) experimental; urgency=medium
52
53 [ Jeremy Bícha ]
54diff --git a/debian/control b/debian/control
55index f02016a..43a3ade 100644
56--- a/debian/control
57+++ b/debian/control
58@@ -1,7 +1,8 @@
59 Source: gobject-introspection
60 Section: devel
61 Priority: optional
62-Maintainer: Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>
63+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
64+XSBC-Original-Maintainer: Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>
65 Uploaders: Iain Lane <laney@debian.org>,
66 Jeremy Bícha <jbicha@ubuntu.com>,
67 Laurent Bigonville <bigon@debian.org>,
68diff --git a/debian/patches/giscanner-Be-more-thorough-about-applying-Wl-no-as-needed.patch b/debian/patches/giscanner-Be-more-thorough-about-applying-Wl-no-as-needed.patch
69new file mode 100644
70index 0000000..750e80b
71--- /dev/null
72+++ b/debian/patches/giscanner-Be-more-thorough-about-applying-Wl-no-as-needed.patch
73@@ -0,0 +1,106 @@
74+From: Simon McVittie <smcv@debian.org>
75+Date: Sun, 12 May 2024 18:03:17 +0100
76+Subject: giscanner: Be more thorough about applying -Wl,--no-as-needed option
77+
78+Some Linux distributions routinely build all executables and libraries
79+with -Wl,--as-needed, either by adding it to LDFLAGS or by making it the
80+compiler or linker default.
81+
82+For installed executables and libraries this is a desirable way to
83+drop unnecessary transitive dependencies, minimizing the number of
84+rebuilds required if a lower-level library breaks ABI, but for our
85+dump executable it's counterproductive and can prevent us from finding
86+the SONAMEs of libraries that were passed as explicit -l arguments,
87+especially if we use a ldd replacement that is not recursive
88+(like the one in gobject-introspection#482).
89+
90+We already had a special case to add -Wl,--no-as-needed to the linker
91+arguments, but only for "internal" libraries and only when not using
92+libtool. Extend that to cover "external" libraries and libtool as well,
93+and filter out any -Wl,--as-needed from LDFLAGS to avoid it from being
94+defeated.
95+
96+Bug: https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/505
97+Bug-Debian: https://bugs.debian.org/1060951
98+Bug-Debian: https://bugs.debian.org/1060953
99+Signed-off-by: Simon McVittie <smcv@debian.org>
100+Forwarded: https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/463
101+---
102+ giscanner/ccompiler.py | 28 ++++++++++++++++++++++------
103+ giscanner/dumper.py | 3 ++-
104+ 2 files changed, 24 insertions(+), 7 deletions(-)
105+
106+diff --git a/giscanner/ccompiler.py b/giscanner/ccompiler.py
107+index d0ed70a..1938a84 100644
108+--- a/giscanner/ccompiler.py
109++++ b/giscanner/ccompiler.py
110+@@ -35,6 +35,17 @@ from distutils.sysconfig import customize_compiler as orig_customize_compiler
111+ from . import utils
112+
113+
114++def no_as_needed(linker):
115++ """\
116++ Filter out -Wl,--as-needed from the shell-quoted arguments in linker.
117++ """
118++ return ' '.join(
119++ [shlex.quote(arg)
120++ for arg in shlex.split(linker)
121++ if arg != '-Wl,--as-needed']
122++ )
123++
124++
125+ def customize_compiler(compiler):
126+ """This is a version of distutils.sysconfig.customize_compiler, without
127+ any macOS specific bits and which tries to avoid using any Python specific
128+@@ -88,8 +99,8 @@ def customize_compiler(compiler):
129+ compiler=cc_cmd,
130+ compiler_so=cc_cmd,
131+ compiler_cxx=cxx,
132+- linker_so=ldshared,
133+- linker_exe=cc,
134++ linker_so=no_as_needed(ldshared),
135++ linker_exe=no_as_needed(cc),
136+ archiver=archiver)
137+
138+ compiler.shared_lib_extension = shlib_suffix
139+@@ -230,10 +241,10 @@ class CCompiler(object):
140+ # https://bugzilla.gnome.org/show_bug.cgi?id=625195
141+ args.append('-Wl,-rpath,.')
142+
143+- # Ensure libraries are always linked as we are going to use ldd to work
144+- # out their names later
145+- if sys.platform != 'darwin':
146+- args.append('-Wl,--no-as-needed')
147++ # Ensure libraries are always linked as we are going to use ldd to work
148++ # out their names later
149++ if sys.platform != 'darwin':
150++ args.append('-Wl,--no-as-needed')
151+
152+ for library_path in libpaths:
153+ # The dumper program needs to look for dynamic libraries
154+@@ -279,6 +290,11 @@ class CCompiler(object):
155+ # is installed on the system; this case is used for the scanning
156+ # of GLib in gobject-introspection itself.
157+
158++ # Ensure libraries are always linked as we are going to use ldd to work
159++ # out their names later
160++ if os.name != 'nt' and sys.platform != 'darwin':
161++ args.append('-Wl,--no-as-needed')
162++
163+ for library in libraries:
164+ if os.path.isfile(library):
165+ # If we get a real filename, just use it as-is
166+diff --git a/giscanner/dumper.py b/giscanner/dumper.py
167+index 74a494b..e2e7eee 100644
168+--- a/giscanner/dumper.py
169++++ b/giscanner/dumper.py
170+@@ -254,7 +254,8 @@ class DumpCompiler(object):
171+
172+ if not self._compiler.check_is_msvc():
173+ for ldflag in shlex.split(os.environ.get('LDFLAGS', '')):
174+- args.append(ldflag)
175++ if ldflag != '-Wl,--as-needed':
176++ args.append(ldflag)
177+
178+ dll_dirs = utils.dll_dirs()
179+ dll_dirs.add_dll_dirs(self._packages)
180diff --git a/debian/patches/series b/debian/patches/series
181index 2c51846..f1558b3 100644
182--- a/debian/patches/series
183+++ b/debian/patches/series
184@@ -1,2 +1,3 @@
185 meson-Only-generate-typelib-and-install-win32-files-on-wi.patch
186+giscanner-Be-more-thorough-about-applying-Wl-no-as-needed.patch
187 debian/multiarch_compat.patch

Subscribers

People subscribed via source and target branches