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

Subscribers

People subscribed via source and target branches