Merge ~liushuyu-011/ubuntu/+source/gobject-introspection:ubuntu/devel into ubuntu/+source/gobject-introspection:ubuntu/devel

Proposed by Zixing Liu
Status: Needs review
Proposed branch: ~liushuyu-011/ubuntu/+source/gobject-introspection:ubuntu/devel
Merge into: ubuntu/+source/gobject-introspection:ubuntu/devel
Diff against target: 213 lines (+192/-0)
3 files modified
debian/changelog (+6/-0)
debian/patches/series (+1/-0)
debian/patches/time_t-64-fix.patch (+185/-0)
Reviewer Review Type Date Requested Status
Steve Langasek (community) Approve
Review via email: mp+462175@code.launchpad.net

Description of the change

This merge proposal adds a patch to fix the gobject-introspection assumption that time_t and off_t are always register-width-wide.

To post a comment you must log in.
Revision history for this message
Steve Langasek (vorlon) wrote :

Already uploaded via the Foundations bootstrap ppa.

review: Approve

Unmerged commits

0ee3546... by Zixing Liu

d/p/time_t-64-fix.patch: add a patch to fix time_t and off_t type ...

... mismatch after time_t 64-bit transition

a99795a... by Steve Langasek

1.79.1-1ubuntu5 (patches unapplied)

Imported using git-ubuntu import.

44fc865... by Jeremy Bícha

1.79.1-1ubuntu3 (patches unapplied)

Imported using git-ubuntu import.

5c0e0c1... by Jeremy Bícha

1.79.1-1ubuntu2 (patches unapplied)

Imported using git-ubuntu import.

506ce31... by Jeremy Bícha

1.79.1-1ubuntu1 (patches unapplied)

Imported using git-ubuntu import.

1520f66... by Steve Langasek

1.79.1-1build1 (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/changelog b/debian/changelog
2index 52762b8..a96b8a8 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,9 @@
6+gobject-introspection (1.79.1-1ubuntu6) noble; urgency=medium
7+
8+ * Add a patch to fix time_t and off_t size mismatch in the gi data
9+
10+ -- Zixing Liu <zixing.liu@canonical.com> Mon, 11 Mar 2024 13:29:58 -0600
11+
12 gobject-introspection (1.79.1-1ubuntu5) noble; urgency=medium
13
14 * Revert bootstrap changes for upload to the main archive.
15diff --git a/debian/patches/series b/debian/patches/series
16index 2c51846..9058acd 100644
17--- a/debian/patches/series
18+++ b/debian/patches/series
19@@ -1,2 +1,3 @@
20 meson-Only-generate-typelib-and-install-win32-files-on-wi.patch
21 debian/multiarch_compat.patch
22+time_t-64-fix.patch
23diff --git a/debian/patches/time_t-64-fix.patch b/debian/patches/time_t-64-fix.patch
24new file mode 100644
25index 0000000..fc79292
26--- /dev/null
27+++ b/debian/patches/time_t-64-fix.patch
28@@ -0,0 +1,185 @@
29+From 2fae19987660db2c0e1d66294b20f911808ccc5c Mon Sep 17 00:00:00 2001
30+From: liushuyu <liushuyu011@gmail.com>
31+Date: Mon, 11 Mar 2024 12:48:54 -0600
32+Subject: giscanner: treat time_t and off_t as standalone types ...
33+
34+... also configure them to be platform-dependently sized
35+Forwarded: https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/451
36+---
37+ girepository/girparser.c | 2 ++
38+ giscanner/ast.py | 9 ++++++---
39+ giscanner/docwriter.py | 4 +++-
40+ meson.build | 8 ++++++--
41+ 4 files changed, 17 insertions(+), 6 deletions(-)
42+
43+Index: gobject-introspection-1.79.1/girepository/girparser.c
44+===================================================================
45+--- gobject-introspection-1.79.1.orig/girepository/girparser.c
46++++ gobject-introspection-1.79.1/girepository/girparser.c
47+@@ -445,6 +445,8 @@ static IntegerAliasInfo integer_aliases[
48+ { "guint", SIZEOF_INT, 0 },
49+ { "glong", SIZEOF_LONG, 1 },
50+ { "gulong", SIZEOF_LONG, 0 },
51++ { "off_t", SIZEOF_OFF_T, 1 },
52++ { "time_t", SIZEOF_TIME_T, 1 },
53+ { "gssize", GLIB_SIZEOF_SIZE_T, 1 },
54+ { "gsize", GLIB_SIZEOF_SIZE_T, 0 },
55+ { "gintptr", GLIB_SIZEOF_SIZE_T, 1 },
56+Index: gobject-introspection-1.79.1/giscanner/ast.py
57+===================================================================
58+--- gobject-introspection-1.79.1.orig/giscanner/ast.py
59++++ gobject-introspection-1.79.1/giscanner/ast.py
60+@@ -231,6 +231,9 @@ TYPE_DOUBLE = Type(target_fundamental='g
61+ TYPE_LONG_DOUBLE = Type(target_fundamental='long double',
62+ ctype='long double')
63+ TYPE_UNICHAR = Type(target_fundamental='gunichar', ctype='gunichar')
64++# Platform-specific types
65++TYPE_TIME_T = Type(target_fundamental='time_t', ctype='time_t')
66++TYPE_OFF_T = Type(target_fundamental='off_t', ctype='off_t')
67+
68+ # C types with semantics overlaid
69+ TYPE_GTYPE = Type(target_fundamental='GType', ctype='GType')
70+@@ -243,7 +246,7 @@ BASIC_TYPES = [TYPE_BOOLEAN, TYPE_INT8,
71+ TYPE_UINT16, TYPE_INT32, TYPE_UINT32, TYPE_INT64,
72+ TYPE_UINT64, TYPE_CHAR, TYPE_SHORT, TYPE_USHORT, TYPE_INT,
73+ TYPE_UINT, TYPE_LONG, TYPE_ULONG, TYPE_SIZE, TYPE_SSIZE,
74+- TYPE_LONG_LONG, TYPE_LONG_ULONG,
75++ TYPE_LONG_LONG, TYPE_LONG_ULONG, TYPE_TIME_T, TYPE_OFF_T,
76+ TYPE_FLOAT, TYPE_DOUBLE,
77+ TYPE_LONG_DOUBLE, TYPE_UNICHAR, TYPE_GTYPE]
78+
79+@@ -344,8 +347,8 @@ type_names['size_t'] = type_names['gsize
80+ type_names['ssize_t'] = type_names['gssize']
81+ type_names['uintptr_t'] = type_names['guintptr']
82+ type_names['intptr_t'] = type_names['gintptr']
83+-type_names['time_t'] = TYPE_LONG
84+-type_names['off_t'] = type_names['gsize']
85++type_names['time_t'] = TYPE_TIME_T
86++type_names['off_t'] = TYPE_OFF_T
87+ type_names['pid_t'] = TYPE_INT
88+ type_names['uid_t'] = TYPE_UINT
89+ type_names['gid_t'] = TYPE_UINT
90+Index: gobject-introspection-1.79.1/giscanner/docwriter.py
91+===================================================================
92+--- gobject-introspection-1.79.1.orig/giscanner/docwriter.py
93++++ gobject-introspection-1.79.1/giscanner/docwriter.py
94+@@ -782,6 +782,8 @@ class DocFormatterPython(DocFormatterInt
95+ "gulong": "int",
96+ "gint64": "int",
97+ "guint64": "int",
98++ "time_t": "int",
99++ "off_t": "int",
100+ "gfloat": "float",
101+ "gdouble": "float",
102+ "gchararray": "str",
103+@@ -923,6 +925,8 @@ class DocFormatterGjs(DocFormatterIntros
104+ "gulong": "Number(gulong)",
105+ "gint64": "Number(gint64)",
106+ "guint64": "Number(guint64)",
107++ "time_t": "Number(time_t)",
108++ "off_t": "Number(off_t)",
109+ "long double": "Number(long double)",
110+ "long long": "Number(long long)",
111+ "unsigned long long": "Number(unsigned long long)"}
112+@@ -1149,7 +1153,7 @@ class DevDocsFormatterGjs(DocFormatterGj
113+ "gchar", "guchar", "gshort", "gint", "guint", "gfloat",
114+ "gdouble", "gsize", "gssize", "gintptr", "guintptr",
115+ "glong", "gulong", "gint64", "guint64", "long double",
116+- "long long", "unsigned long long"]:
117++ "long long", "unsigned long long", "time_t", "off_t"]:
118+ return "Number" # gsize and up cannot fully be represented in GJS
119+ if name in ["none", "gpointer"]:
120+ return "void"
121+Index: gobject-introspection-1.79.1/meson.build
122+===================================================================
123+--- gobject-introspection-1.79.1.orig/meson.build
124++++ gobject-introspection-1.79.1/meson.build
125+@@ -101,8 +101,12 @@ config.set_quoted('GOBJECT_INTROSPECTION
126+ config.set_quoted('GIR_DIR', girdir)
127+ config.set_quoted('GOBJECT_INTROSPECTION_LIBDIR', join_paths(get_option('prefix'), get_option('libdir')))
128+
129+-foreach type : ['char', 'short', 'int', 'long']
130+- size = cc.sizeof(type)
131++foreach type : ['char', 'short', 'int', 'long', 'off_t', 'time_t']
132++ if type == 'time_t'
133++ size = cc.sizeof(type, prefix: '#include <time.h>')
134++ else
135++ size = cc.sizeof(type)
136++ endif
137+ if size == -1
138+ error('Failed to get size of @0@'.format(type))
139+ endif
140+Index: gobject-introspection-1.79.1/tests/scanner/Regress-1.0-Gjs-expected/Regress.FooObject.is_it_time_yet.page
141+===================================================================
142+--- gobject-introspection-1.79.1.orig/tests/scanner/Regress-1.0-Gjs-expected/Regress.FooObject.is_it_time_yet.page
143++++ gobject-introspection-1.79.1/tests/scanner/Regress-1.0-Gjs-expected/Regress.FooObject.is_it_time_yet.page
144+@@ -13,14 +13,14 @@
145+ </api:returns>
146+ <api:name>regress_foo_object_is_it_time_yet</api:name>
147+ <api:arg>
148+- <api:type>Number(glong)</api:type>
149++ <api:type>Number(time_t)</api:type>
150+ <api:name>time</api:name>
151+ </api:arg>
152+ </api:function>
153+ </info>
154+ <title>Regress.FooObject.prototype.is_it_time_yet</title>
155+ <synopsis><code mime="text/x-gjs">
156+-function is_it_time_yet(time: Number(glong)): void {
157++function is_it_time_yet(time: Number(time_t)): void {
158+ // Gjs wrapper for regress_foo_object_is_it_time_yet()
159+ }
160+ </code></synopsis>
161+Index: gobject-introspection-1.79.1/tests/scanner/Regress-1.0-Gjs-expected/Regress.test_timet.page
162+===================================================================
163+--- gobject-introspection-1.79.1.orig/tests/scanner/Regress-1.0-Gjs-expected/Regress.test_timet.page
164++++ gobject-introspection-1.79.1/tests/scanner/Regress-1.0-Gjs-expected/Regress.test_timet.page
165+@@ -9,18 +9,18 @@
166+ <link xref="index" group="function" type="guide"/>
167+ <api:function>
168+ <api:returns>
169+- <api:type>Number(glong)</api:type>
170++ <api:type>Number(time_t)</api:type>
171+ </api:returns>
172+ <api:name>regress_test_timet</api:name>
173+ <api:arg>
174+- <api:type>Number(glong)</api:type>
175++ <api:type>Number(time_t)</api:type>
176+ <api:name>in</api:name>
177+ </api:arg>
178+ </api:function>
179+ </info>
180+ <title>Regress.test_timet</title>
181+ <synopsis><code mime="text/x-gjs">
182+-function test_timet(in: Number(glong)): Number(glong) {
183++function test_timet(in: Number(time_t)): Number(time_t) {
184+ // Gjs wrapper for regress_test_timet()
185+ }
186+ </code></synopsis>
187+Index: gobject-introspection-1.79.1/tests/scanner/Regress-1.0-expected.gir
188+===================================================================
189+--- gobject-introspection-1.79.1.orig/tests/scanner/Regress-1.0-expected.gir
190++++ gobject-introspection-1.79.1/tests/scanner/Regress-1.0-expected.gir
191+@@ -2034,7 +2034,7 @@ uses a C sugar return type.</doc>
192+ <type name="FooObject" c:type="RegressFooObject*"/>
193+ </instance-parameter>
194+ <parameter name="time" transfer-ownership="none">
195+- <type name="glong" c:type="time_t"/>
196++ <type name="time_t" c:type="time_t"/>
197+ </parameter>
198+ </parameters>
199+ </method>
200+@@ -8675,11 +8675,11 @@ https://bugzilla.gnome.org/show_bug.cgi?
201+ <function name="test_timet" c:identifier="regress_test_timet">
202+ <source-position filename="regress.h" line="94"/>
203+ <return-value transfer-ownership="none">
204+- <type name="glong" c:type="time_t"/>
205++ <type name="time_t" c:type="time_t"/>
206+ </return-value>
207+ <parameters>
208+ <parameter name="in" transfer-ownership="none">
209+- <type name="glong" c:type="time_t"/>
210++ <type name="time_t" c:type="time_t"/>
211+ </parameter>
212+ </parameters>
213+ </function>

Subscribers

People subscribed via source and target branches