Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't build on FreeBSD due to lack of downstream support in rquickjs #33

Closed
gsuberland opened this issue Nov 17, 2024 · 7 comments · Fixed by #40
Closed

Can't build on FreeBSD due to lack of downstream support in rquickjs #33

gsuberland opened this issue Nov 17, 2024 · 7 comments · Fixed by #40
Labels
bug Something isn't working

Comments

@gsuberland
Copy link

I've been trying to get this running on FreeBSD but hit a brick wall.

First issue is that the latest rust package on FreeBSD is broken due to linking to the wrong libc, resulting in:

error: process didn't exit successfully: `rustc -vV` (exit status: 1)
--- stderr
ld-elf.so.1: /usr/local/bin/../lib/librustc_driver-a11f9aed9e23c8d3.so: Undefined symbol "_ZNSt3__122__libcpp_verbose_abortEPKcz"

This has been reported but not fixed: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=282638

I used rustup instead, and got rustc/cargo installed ok. But building inv_sig_helper works up to rquickjs-sys, where the 0.6.0 build fails due to an error with a JS_SetPropertyInternal call:

error[E0061]: this function takes 5 arguments but 6 arguments were supplied
    --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rquickjs-sys-0.6.0/src/inlines/common.rs:174:5
     |
174  |     JS_SetPropertyInternal(ctx, this_obj, prop, val, this_obj, JS_PROP_THROW as i32)
     |     ^^^^^^^^^^^^^^^^^^^^^^                           -------- unexpected argument #5 of type `JSValue`

The issue is that this call doesn't expect the this_obj reference. Bumping Cargo.toml to rquickjs-sys 0.6.2 gets past this error, but then fails here:

error: couldn't read /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rquickjs-sys-0.6.2/src/bindings/x86_64-unknown-freebsd.rs: No such file or directory (os error 2)
  --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rquickjs-sys-0.6.2/src/lib.rs:17:1
   |
17 | include!(concat!("bindings/", bindings_env!("TARGET"), ".rs"));
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Turns out they removed the FreeBSD bindings back in Jan 2023 due to not being able to generate bindings automatically via GitHub Actions: DelSkayn/rquickjs#101

This leaves me rather stuck. I've commented on that issue but if anyone here has any ideas on how I might get around this please let me know.

@gsuberland
Copy link
Author

Ok, turns out this can be fixed just by adding bindings to the features list for rquickjs in cargo.toml

@unixfox
Copy link
Member

unixfox commented Nov 17, 2024

Related to #30

My comment still counts: #30 (comment)

@gsuberland
Copy link
Author

A friend opened an issue over at rquickjs to ask them to enable bindgen by default on unsupported targets.

DelSkayn/rquickjs#388

@yo000
Copy link
Contributor

yo000 commented Nov 17, 2024

In the meantime, I opened a PR to enable bindgen at inv_sig_helper side.

@unixfox unixfox reopened this Nov 17, 2024
@unixfox unixfox added the bug Something isn't working label Nov 17, 2024
@yonas
Copy link

yonas commented Nov 19, 2024

Use conditionals:

[target.'cfg(target_os = "freebsd")'.dependencies]
rquickjs = { version = "0.6.0", features = ["bindgen", "futures", "parallel"] }

[target.'cfg(not(target_os = "freebsd"))'.dependencies]
rquickjs = { version = "0.6.0", features = ["futures", "parallel"] }

@unixfox
Copy link
Member

unixfox commented Nov 19, 2024

Thanks @yonas can you create a PR :)?

cullumsmith added a commit to cullumsmith/inv_sig_helper that referenced this issue Dec 14, 2024
When running on FreeBSD, bump the rquickjs version to the next one that
manages to build successfully.

Fixes iv-org#33
cullumsmith added a commit to cullumsmith/inv_sig_helper that referenced this issue Dec 14, 2024
When running on FreeBSD, bump the rquickjs version to 0.6.2 (the next
version that manages to build successfully).

Fixes iv-org#33
@cullumsmith
Copy link
Contributor

@unixfox I took the liberty of creating a PR with @yonas's fix.

cullumsmith added a commit to cullumsmith/inv_sig_helper that referenced this issue Dec 16, 2024
When running on FreeBSD, bump the rquickjs version to 0.6.2 (the next
version that manages to build successfully).

Fixes iv-org#33
cullumsmith added a commit to cullumsmith/inv_sig_helper that referenced this issue Dec 19, 2024
When running on FreeBSD, bump the rquickjs version to 0.6.2 (the next
version that manages to build successfully).

Fixes iv-org#33
@unixfox unixfox closed this as completed in 614e2e2 Jan 3, 2025
alive4ever pushed a commit to alive4ever/inv_sig_helper that referenced this issue Jan 17, 2025
When running on FreeBSD, bump the rquickjs version to 0.6.2 (the next
version that manages to build successfully).

Fixes iv-org#33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants