@gjsify/http-soup-bridge 0.64.5 → 0.64.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/meson.build +34 -7
  2. package/package.json +10 -10
package/meson.build CHANGED
@@ -8,12 +8,39 @@ project('GjsifyHttpSoupBridge', ['c', 'vala'], version: '1.0',
8
8
 
9
9
  root_dir = meson.current_source_dir()
10
10
 
11
- dependencies = [
12
- dependency('glib-2.0'),
13
- dependency('gobject-2.0'),
14
- dependency('gio-2.0'),
15
- dependency('libsoup-3.0', version: '>=3.6'),
16
- ]
11
+ host_system = host_machine.system()
12
+
13
+ # On darwin every GNOME library is resolved against the HOST PROCESS rather than
14
+ # recorded as an `@rpath/` dependency: a second GLib beside the one the host
15
+ # already loaded gives the process two GType registries, then SIGSEGV.
16
+ # docs/prebuilds.md § One GLib. libsoup is in the list because its own `--libs`
17
+ # carry `-lglib-2.0 -lgobject-2.0` — stripping only the glib trio would still
18
+ # let ld64 record a GLib load command.
19
+ host_provided = ['glib-2.0', 'gobject-2.0', 'gio-2.0']
20
+
21
+ dependencies = []
22
+ foreach pkg : host_provided
23
+ dep = dependency(pkg)
24
+ dependencies += host_system == 'darwin' \
25
+ ? dep.partial_dependency(compile_args: true, includes: true) \
26
+ : dep
27
+ endforeach
28
+
29
+ # libsoup is NOT left to `dynamic_lookup` like GLib: the host process (gjs) never
30
+ # loads it by itself, so an unrecorded libsoup leaves `soup_*` unbound and the
31
+ # class init dereferences NULL (SIGSEGV on a bare `imports.gi.<Ns>`). It is linked
32
+ # by path instead, which records ITS load command while GLib — absent from the
33
+ # link line — still binds to the host. docs/prebuilds.md § One GLib.
34
+ soup_dep = dependency('libsoup-3.0', version: '>=3.6')
35
+ if host_system == 'darwin'
36
+ dependencies += soup_dep.partial_dependency(compile_args: true, includes: true)
37
+ dependencies += meson.get_compiler('c').find_library('soup-3.0',
38
+ dirs: soup_dep.get_variable(pkgconfig: 'libdir'))
39
+ else
40
+ dependencies += soup_dep
41
+ endif
42
+
43
+ host_provided_link_args = host_system == 'darwin' ? ['-Wl,-undefined,dynamic_lookup'] : []
17
44
 
18
45
  sources = files(
19
46
  'src/vala/peer-close-watch.vala',
@@ -24,6 +51,7 @@ sources = files(
24
51
 
25
52
  libGjsifyHttpSoupBridge = library('gjsifyhttpsoupbridge', sources,
26
53
  dependencies: dependencies,
54
+ link_args: host_provided_link_args,
27
55
  vala_gir: meson.project_name() + '-1.0.gir',
28
56
  install: true,
29
57
  install_dir: [true, true, true, true],
@@ -42,7 +70,6 @@ libGjsifyHttpSoupBridge = library('gjsifyhttpsoupbridge', sources,
42
70
  # work, so `else` (ELF naming) is the honest fallback rather than a .dll branch
43
71
  # that would imply support which does not exist.
44
72
  # ----------------------------------------------------------------------------
45
- host_system = host_machine.system()
46
73
  if host_system == 'darwin'
47
74
  shared_lib_name = 'libgjsifyhttpsoupbridge.dylib'
48
75
  else
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/http-soup-bridge",
3
- "version": "0.64.5",
3
+ "version": "0.64.7",
4
4
  "description": "Vala-based main-thread bridge for libsoup HTTP server. Marshals SoupServer + SoupServerMessage signals onto the GLib main context and keeps every libsoup boxed type (MessageBody, MessageHeaders, the message's GMainContext ref, the HTTP1 IO GSource) on the C side, so SpiderMonkey GC has no chance to race a libsoup-side cleanup. Used by @gjsify/http to keep MCP/SSE/long-poll workloads stable on GJS.",
5
5
  "type": "module",
6
6
  "main": "lib/esm/index.js",
@@ -64,10 +64,10 @@
64
64
  "@girs/glib-2.0": "5.4.0",
65
65
  "@girs/gobject-2.0": "5.4.0",
66
66
  "@girs/soup-3.0": "5.4.0",
67
- "@gjsify/utils": "^0.64.5"
67
+ "@gjsify/utils": "^0.64.7"
68
68
  },
69
69
  "devDependencies": {
70
- "@gjsify/cli": "^0.64.5",
70
+ "@gjsify/cli": "^0.64.7",
71
71
  "@ts-for-gir/cli": "^4.1.0",
72
72
  "@types/node": "^25.9.2",
73
73
  "typescript": "^6.0.3"
@@ -83,12 +83,12 @@
83
83
  },
84
84
  "homepage": "https://github.com/gjsify/gjsify/tree/main/packages/node/http-soup-bridge#readme",
85
85
  "optionalDependencies": {
86
- "@gjsify/http-soup-bridge-darwin-arm64": "0.64.5",
87
- "@gjsify/http-soup-bridge-darwin-x64": "0.64.5",
88
- "@gjsify/http-soup-bridge-linux-arm64": "0.64.5",
89
- "@gjsify/http-soup-bridge-linux-ppc64": "0.64.5",
90
- "@gjsify/http-soup-bridge-linux-riscv64": "0.64.5",
91
- "@gjsify/http-soup-bridge-linux-s390x": "0.64.5",
92
- "@gjsify/http-soup-bridge-linux-x64": "0.64.5"
86
+ "@gjsify/http-soup-bridge-darwin-arm64": "0.64.7",
87
+ "@gjsify/http-soup-bridge-darwin-x64": "0.64.7",
88
+ "@gjsify/http-soup-bridge-linux-arm64": "0.64.7",
89
+ "@gjsify/http-soup-bridge-linux-ppc64": "0.64.7",
90
+ "@gjsify/http-soup-bridge-linux-riscv64": "0.64.7",
91
+ "@gjsify/http-soup-bridge-linux-s390x": "0.64.7",
92
+ "@gjsify/http-soup-bridge-linux-x64": "0.64.7"
93
93
  }
94
94
  }