Open
Conversation
5268c1e to
5a1386f
Compare
Duncaen
reviewed
Mar 20, 2026
|
|
||
| do_build() { | ||
| cargo auditable build ${XBPS_VERBOSE+-v} --release --offline \ | ||
| cargo auditable build ${XBPS_VERBOSE+-v} --release \ |
Member
There was a problem hiding this comment.
I think this should still be locked or offline, the whole point is that the versions are choosen as specified in the lock file.
Member
|
You might be able to make cross compilation work with something like this #57605 (comment) if the issue is cc-rs. |
Member
|
This shouldn't work because there is no way to set diff --git a/srcpkgs/tree-sitter/patches/disable-qjs-rt.patch b/srcpkgs/tree-sitter/patches/disable-qjs-rt.patch
deleted file mode 100644
index cdecd0f667b..00000000000
--- a/srcpkgs/tree-sitter/patches/disable-qjs-rt.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml
-index c10b465..0a3319b 100644
---- a/crates/cli/Cargo.toml
-+++ b/crates/cli/Cargo.toml
-@@ -30,7 +30,7 @@ name = "benchmark"
- harness = false
-
- [features]
--default = ["qjs-rt"]
-+default = []
- wasm = ["tree-sitter/wasm", "tree-sitter-loader/wasm"]
- qjs-rt = ["tree-sitter-generate/qjs-rt"]
-
-diff --git a/crates/generate/Cargo.toml b/crates/generate/Cargo.toml
-index 5e93bf4..1ad9cd6 100644
---- a/crates/generate/Cargo.toml
-+++ b/crates/generate/Cargo.toml
-@@ -20,7 +20,7 @@ path = "src/generate.rs"
- workspace = true
-
- [features]
--default = ["qjs-rt"]
-+default = ["load"]
- load = ["dep:semver"]
- qjs-rt = ["load", "rquickjs", "pathdiff"]
diff --git a/srcpkgs/tree-sitter/template b/srcpkgs/tree-sitter/template
index 692d2947466..08ed7ee4101 100644
--- a/srcpkgs/tree-sitter/template
+++ b/srcpkgs/tree-sitter/template
@@ -14,9 +14,25 @@ distfiles="https://github.com/tree-sitter/tree-sitter/archive/refs/tags/v${versi
checksum=4343107ad1097a35e106092b79e5dd87027142c6fba5e4486b1d1d44d5499f84
make_check=no # tests require generating fixtures from remote repositories
-do_build() {
- cargo auditable build ${XBPS_VERBOSE+-v} --release \
- --target ${RUST_TARGET} ${configure_args} ${make_build_args}
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+ XBPS_CROSS_RUSTFLAGS+=" -latomic"
+fi
+
+_setup_env() {
+ # workaround the cc-rs mixing CFLAGS for host and target.
+ # https://github.com/rust-lang/cc-rs/issues/1469
+ export CFLAGS_${RUST_BUILD//-/_}="${CFLAGS_host}" \
+ CXXFLAGS_${RUST_BUILD//-/_}="${CXXFLAGS_host}" \
+ LDFLAGS_${RUST_BUILD//-/_}="${LDFLAGS_host}" \
+ CFLAGS_${RUST_TARGET//-/_}="${CFLAGS}" \
+ CXXFLAGS_${RUST_TARGET//-/_}="${CXXFLAGS}" \
+ LDFLAGS_${RUST_TARGET//-/_}="${LDFLAGS}" \
+ CFLAGS="" CXXFLAGS="" LDFLAGS=""
+ unset BINDGEN_EXTRA_CLANG_ARGS
+}
+
+pre_build() {
+ _setup_env
}
post_build() {
@@ -24,6 +40,10 @@ post_build() {
make
}
+pre_install() {
+ _setup_env
+}
+
post_install() {
# Install libtree-sitter, since do_install installs the tree-sitter CLI.
make STRIP=true PREFIX=/usr DESTDIR=${DESTDIR} install
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Testing the changes
Notes
tree-sitter 0.26 introduced rquickjs (QuickJS JS runtime) as a CLI
dependency, breaking cross-compilation for armv6l-musl, armv7l, aarch64
and aarch64-musl. The disable-qjs-rt.patch disables the qjs-rt feature
to fix this.
neovim and emacs require patches to adapt to the new tree-sitter 0.26
API (ts_language_version was replaced by ts_language_abi_version,
ts_parser_set_timeout_micros was replaced by TSParseOptions callback).
Local build testing