@gjsify/lightningcss-native 0.53.0 → 0.54.0

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 +48 -7
  2. package/package.json +12 -12
package/meson.build CHANGED
@@ -50,16 +50,52 @@ if host_system == 'darwin'
50
50
  lib_rpath = '@loader_path'
51
51
  # Normalise the cdylib's LC_ID_DYLIB to @rpath/<leaf> BEFORE the Vala
52
52
  # library links against it: ld64 copies the dependency's install name
53
- # verbatim into the dependent's LC_LOAD_DYLIB. rustc's own install name has
54
- # varied across releases (absolute build path in older rustc, @rpath/<leaf>
55
- # in current ones); pinning it here makes the recorded dependency
56
- # rustc-version-independent, and @rpath/ is never longer than an absolute
57
- # path so install_name_tool can always rewrite in place.
58
- rust_cdylib_post = ' && install_name_tool -id "@rpath/' + rust_cdylib_name + '" "$3"'
53
+ # verbatim into the dependent's LC_LOAD_DYLIB. Pinning it here makes the
54
+ # recorded dependency rustc-version-independent, and @rpath/ is never
55
+ # longer than an absolute path so install_name_tool can always rewrite in
56
+ # place.
57
+ #
58
+ # The cdylib must be a FUNCTION OF ITS SOURCES, and on darwin that takes
59
+ # TWO steps, only the first of which `install_name_tool` could do.
60
+ # MEASURED with rustc 1.98.1 / ld64-27037.1 (macOS 27, arm64); the whole
61
+ # measurement and the reasoning behind each step: scripts/macho-set-uuid.mjs.
62
+ #
63
+ # 1. THE INSTALL NAME, at the LINK. rustc still gives a cdylib the ABSOLUTE
64
+ # path of its own output as `LC_ID_DYLIB`
65
+ # (`<builddir>/cargo-target/release/deps/<leaf>`), so the build
66
+ # directory's name and LENGTH reach the artifact: the recorded name, the
67
+ # load-command block's size, and therefore every section address after it.
68
+ # Without this, two builds from `build/` and `builddir/` differ by 8 bytes
69
+ # of pure layout before any content is compared. ld64 takes the LAST
70
+ # `-install_name` (verified), and a `-C link-arg` lands after rustc's own,
71
+ # so this one wins. `install_name_tool` then keeps the recorded dependency
72
+ # rustc-version-independent.
73
+ # 2. THE UUID, after every other edit (the script, which re-signs). ld64
74
+ # computed that field over the image it emitted and `install_name_tool`
75
+ # recomputes neither it nor the signature — and it is not a function of
76
+ # the emitted bytes even so, so pinning the name above still leaves 48
77
+ # moving bytes (16 `LC_UUID` + 32 of the signature hashing it). It is
78
+ # derived from the image instead, so if the CODE ever stops being a
79
+ # function of the sources the UUID moves with it and
80
+ # `check-prebuild-reproducible.mjs` still reds; nothing here hides
81
+ # content drift.
82
+ rust_cargo_link_args = ' -- -C link-arg=-Wl,-install_name,@rpath/' + rust_cdylib_name
83
+ rust_cargo_cmd = 'cargo rustc --lib'
84
+ # The repo's OWN script, from the package's own meson.build — so a bridge
85
+ # built outside the workspace has to say so itself rather than silently
86
+ # skipping the step that makes its artifact reproducible.
87
+ set_uuid_tool = meson.current_source_dir() / '..' / '..' / '..' / 'scripts' / 'macho-set-uuid.mjs'
88
+ rust_cdylib_post = ' && install_name_tool -id "@rpath/' + rust_cdylib_name + '" "$3"' \
89
+ + ' && ' + find_program('node').full_path() + ' "' + set_uuid_tool + '" "$3"'
59
90
  else
60
91
  rust_cdylib_name = 'libgjsify_lightningcss.so'
61
92
  shared_lib_name = 'libgjsifylightningcss.so'
62
93
  lib_rpath = '$ORIGIN'
94
+ # ELF records a bare SONAME and no UUID load command, and its link line is
95
+ # already a function of the sources: the darwin branch's steps have no ELF
96
+ # spelling, so this one is left exactly as it was.
97
+ rust_cargo_link_args = ''
98
+ rust_cargo_cmd = 'cargo build'
63
99
  rust_cdylib_post = ''
64
100
  endif
65
101
 
@@ -72,6 +108,10 @@ endif
72
108
  # will package — so meson tracks it as a build artifact and serializes
73
109
  # the Vala link step behind it.
74
110
  # ----------------------------------------------------------------------------
111
+ # `cargo rustc --lib -- <args>` rather than `cargo build`, so the link args reach
112
+ # the FINAL crate's rustc and no other: the dependency rlibs and any build
113
+ # script are linked without them, and a pinned `-install_name` on an executable
114
+ # is not a thing ld64 wants.
75
115
  cargo = find_program('cargo')
76
116
 
77
117
  rust_sources = files(
@@ -93,7 +133,8 @@ rust_cdylib = custom_target('gjsify-lightningcss-rust',
93
133
  input: rust_sources,
94
134
  output: rust_cdylib_name,
95
135
  command: ['sh', '-c',
96
- 'cargo build --release ${CI:+--locked} --manifest-path "$1" --target-dir "$2" && cp "$2/release/'
136
+ rust_cargo_cmd + ' --release ${CI:+--locked} --manifest-path "$1" --target-dir "$2"'
137
+ + rust_cargo_link_args + ' && cp "$2/release/'
97
138
  + rust_cdylib_name + '" "$3"' + rust_cdylib_post,
98
139
  'sh',
99
140
  meson.current_source_dir() / 'src/rust/Cargo.toml',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/lightningcss-native",
3
- "version": "0.53.0",
3
+ "version": "0.54.0",
4
4
  "description": "Vala/GObject + Rust cdylib bridge to lightningcss for GJS. Replaces the Node-only npm `lightningcss` package: parse, transform, minify, and browserslist-target lowering of CSS without leaving a Node-free GJS process. Backs `@gjsify/rolldown-plugin-gjsify`'s cssAsStringPlugin under `--app gjs` so GTK4-CSS lowering (firefox60) works without a Node runtime in the build pipeline.",
5
5
  "type": "module",
6
6
  "main": "lib/esm/index.js",
@@ -63,8 +63,8 @@
63
63
  "@girs/gobject-2.0": "5.4.0"
64
64
  },
65
65
  "devDependencies": {
66
- "@gjsify/cli": "^0.53.0",
67
- "@gjsify/unit": "^0.53.0",
66
+ "@gjsify/cli": "^0.54.0",
67
+ "@gjsify/unit": "^0.54.0",
68
68
  "@ts-for-gir/cli": "^4.1.0",
69
69
  "@types/node": "^25.9.2",
70
70
  "typescript": "^6.0.3"
@@ -81,14 +81,14 @@
81
81
  },
82
82
  "homepage": "https://github.com/gjsify/gjsify/tree/main/packages/infra/lightningcss-native#readme",
83
83
  "optionalDependencies": {
84
- "@gjsify/lightningcss-native-darwin-arm64": "0.53.0",
85
- "@gjsify/lightningcss-native-darwin-x64": "0.53.0",
86
- "@gjsify/lightningcss-native-linux-arm64": "0.53.0",
87
- "@gjsify/lightningcss-native-linux-arm64-musl": "0.53.0",
88
- "@gjsify/lightningcss-native-linux-ppc64": "0.53.0",
89
- "@gjsify/lightningcss-native-linux-riscv64": "0.53.0",
90
- "@gjsify/lightningcss-native-linux-s390x": "0.53.0",
91
- "@gjsify/lightningcss-native-linux-x64": "0.53.0",
92
- "@gjsify/lightningcss-native-linux-x64-musl": "0.53.0"
84
+ "@gjsify/lightningcss-native-darwin-arm64": "0.54.0",
85
+ "@gjsify/lightningcss-native-darwin-x64": "0.54.0",
86
+ "@gjsify/lightningcss-native-linux-arm64": "0.54.0",
87
+ "@gjsify/lightningcss-native-linux-arm64-musl": "0.54.0",
88
+ "@gjsify/lightningcss-native-linux-ppc64": "0.54.0",
89
+ "@gjsify/lightningcss-native-linux-riscv64": "0.54.0",
90
+ "@gjsify/lightningcss-native-linux-s390x": "0.54.0",
91
+ "@gjsify/lightningcss-native-linux-x64": "0.54.0",
92
+ "@gjsify/lightningcss-native-linux-x64-musl": "0.54.0"
93
93
  }
94
94
  }