@gjsify/oxfmt-native 0.52.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.
- package/meson.build +55 -8
- package/package.json +6 -6
package/meson.build
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
# `buildtype=plain` = NO `-g`. ld64 emits a DEBUG MAP into any image whose objects
|
|
2
|
+
# carry DWARF — one `N_OSO` stab per object, holding its MTIME — so with `-g` every
|
|
3
|
+
# rebuild of this commit differed in bytes (plus the `LC_UUID` and the ad-hoc signature
|
|
4
|
+
# computed over them) and `commit-prebuilds` re-committed all 16 darwin dylibs. That map
|
|
5
|
+
# names intermediate `.o` files no consumer can have. Why: docs/prebuilds.md.
|
|
6
|
+
project('GjsifyOxfmt', ['c', 'vala'], version: '1.0',
|
|
7
|
+
default_options: ['buildtype=plain'])
|
|
2
8
|
|
|
3
9
|
# Required system packages (Fedora 43+):
|
|
4
10
|
# dnf install vala meson ninja-build cargo
|
|
@@ -46,16 +52,52 @@ if host_system == 'darwin'
|
|
|
46
52
|
lib_rpath = '@loader_path'
|
|
47
53
|
# Normalise the cdylib's LC_ID_DYLIB to @rpath/<leaf> BEFORE the Vala
|
|
48
54
|
# library links against it: ld64 copies the dependency's install name
|
|
49
|
-
# verbatim into the dependent's LC_LOAD_DYLIB.
|
|
50
|
-
#
|
|
51
|
-
#
|
|
52
|
-
#
|
|
53
|
-
#
|
|
54
|
-
|
|
55
|
+
# verbatim into the dependent's LC_LOAD_DYLIB. Pinning it here makes the
|
|
56
|
+
# recorded dependency rustc-version-independent, and @rpath/ is never
|
|
57
|
+
# longer than an absolute path so install_name_tool can always rewrite in
|
|
58
|
+
# place.
|
|
59
|
+
#
|
|
60
|
+
# The cdylib must be a FUNCTION OF ITS SOURCES, and on darwin that takes
|
|
61
|
+
# TWO steps, only the first of which `install_name_tool` could do.
|
|
62
|
+
# MEASURED with rustc 1.98.1 / ld64-27037.1 (macOS 27, arm64); the whole
|
|
63
|
+
# measurement and the reasoning behind each step: scripts/macho-set-uuid.mjs.
|
|
64
|
+
#
|
|
65
|
+
# 1. THE INSTALL NAME, at the LINK. rustc still gives a cdylib the ABSOLUTE
|
|
66
|
+
# path of its own output as `LC_ID_DYLIB`
|
|
67
|
+
# (`<builddir>/cargo-target/release/deps/<leaf>`), so the build
|
|
68
|
+
# directory's name and LENGTH reach the artifact: the recorded name, the
|
|
69
|
+
# load-command block's size, and therefore every section address after it.
|
|
70
|
+
# Without this, two builds from `build/` and `builddir/` differ by 8 bytes
|
|
71
|
+
# of pure layout before any content is compared. ld64 takes the LAST
|
|
72
|
+
# `-install_name` (verified), and a `-C link-arg` lands after rustc's own,
|
|
73
|
+
# so this one wins. `install_name_tool` then keeps the recorded dependency
|
|
74
|
+
# rustc-version-independent.
|
|
75
|
+
# 2. THE UUID, after every other edit (the script, which re-signs). ld64
|
|
76
|
+
# computed that field over the image it emitted and `install_name_tool`
|
|
77
|
+
# recomputes neither it nor the signature — and it is not a function of
|
|
78
|
+
# the emitted bytes even so, so pinning the name above still leaves 48
|
|
79
|
+
# moving bytes (16 `LC_UUID` + 32 of the signature hashing it). It is
|
|
80
|
+
# derived from the image instead, so if the CODE ever stops being a
|
|
81
|
+
# function of the sources the UUID moves with it and
|
|
82
|
+
# `check-prebuild-reproducible.mjs` still reds; nothing here hides
|
|
83
|
+
# content drift.
|
|
84
|
+
rust_cargo_link_args = ' -- -C link-arg=-Wl,-install_name,@rpath/' + rust_cdylib_name
|
|
85
|
+
rust_cargo_cmd = 'cargo rustc --lib'
|
|
86
|
+
# The repo's OWN script, from the package's own meson.build — so a bridge
|
|
87
|
+
# built outside the workspace has to say so itself rather than silently
|
|
88
|
+
# skipping the step that makes its artifact reproducible.
|
|
89
|
+
set_uuid_tool = meson.current_source_dir() / '..' / '..' / '..' / 'scripts' / 'macho-set-uuid.mjs'
|
|
90
|
+
rust_cdylib_post = ' && install_name_tool -id "@rpath/' + rust_cdylib_name + '" "$3"' \
|
|
91
|
+
+ ' && ' + find_program('node').full_path() + ' "' + set_uuid_tool + '" "$3"'
|
|
55
92
|
else
|
|
56
93
|
rust_cdylib_name = 'libgjsify_oxfmt.so'
|
|
57
94
|
shared_lib_name = 'libgjsifyoxfmt.so'
|
|
58
95
|
lib_rpath = '$ORIGIN'
|
|
96
|
+
# ELF records a bare SONAME and no UUID load command, and its link line is
|
|
97
|
+
# already a function of the sources: the darwin branch's steps have no ELF
|
|
98
|
+
# spelling, so this one is left exactly as it was.
|
|
99
|
+
rust_cargo_link_args = ''
|
|
100
|
+
rust_cargo_cmd = 'cargo build'
|
|
59
101
|
rust_cdylib_post = ''
|
|
60
102
|
endif
|
|
61
103
|
|
|
@@ -66,6 +108,10 @@ endif
|
|
|
66
108
|
# cdylib into the meson build dir under the expected name, so meson tracks
|
|
67
109
|
# it as a build artifact and serializes the Vala link step behind it.
|
|
68
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.
|
|
69
115
|
cargo = find_program('cargo')
|
|
70
116
|
|
|
71
117
|
rust_sources = files(
|
|
@@ -87,7 +133,8 @@ rust_cdylib = custom_target('gjsify-oxfmt-rust',
|
|
|
87
133
|
input: rust_sources,
|
|
88
134
|
output: rust_cdylib_name,
|
|
89
135
|
command: ['sh', '-c',
|
|
90
|
-
'
|
|
136
|
+
rust_cargo_cmd + ' --release ${CI:+--locked} --manifest-path "$1" --target-dir "$2"'
|
|
137
|
+
+ rust_cargo_link_args + ' && cp "$2/release/'
|
|
91
138
|
+ rust_cdylib_name + '" "$3"' + rust_cdylib_post,
|
|
92
139
|
'sh',
|
|
93
140
|
meson.current_source_dir() / 'src/rust/Cargo.toml',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/oxfmt-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.54.0",
|
|
4
4
|
"description": "Vala/GObject + Rust cdylib bridge to oxc's formatter (oxfmt) for GJS. Formats JavaScript/TypeScript/JSX under GJS without a Node runtime — the Node-free counterpart to the npm `oxfmt` native napi binary, backing `gjsify format` under GJS. Wraps oxc_formatter (Prettier-compatible) via a single-shot FFI; the embedded CSS/HTML/Markdown ExternalFormatter (Prettier-NAPI) is out of scope.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/esm/index.js",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"@girs/gobject-2.0": "5.4.0"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
|
-
"@gjsify/cli": "^0.
|
|
70
|
+
"@gjsify/cli": "^0.54.0",
|
|
71
71
|
"@types/node": "^25.9.2",
|
|
72
72
|
"typescript": "^6.0.3"
|
|
73
73
|
},
|
|
@@ -83,9 +83,9 @@
|
|
|
83
83
|
},
|
|
84
84
|
"homepage": "https://github.com/gjsify/gjsify/tree/main/packages/infra/oxfmt-native#readme",
|
|
85
85
|
"optionalDependencies": {
|
|
86
|
-
"@gjsify/oxfmt-native-darwin-arm64": "0.
|
|
87
|
-
"@gjsify/oxfmt-native-darwin-x64": "0.
|
|
88
|
-
"@gjsify/oxfmt-native-linux-arm64": "0.
|
|
89
|
-
"@gjsify/oxfmt-native-linux-x64": "0.
|
|
86
|
+
"@gjsify/oxfmt-native-darwin-arm64": "0.54.0",
|
|
87
|
+
"@gjsify/oxfmt-native-darwin-x64": "0.54.0",
|
|
88
|
+
"@gjsify/oxfmt-native-linux-arm64": "0.54.0",
|
|
89
|
+
"@gjsify/oxfmt-native-linux-x64": "0.54.0"
|
|
90
90
|
}
|
|
91
91
|
}
|