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

Undefined references in new release v0.5.10 #107

Open
AtomicFS opened this issue Feb 17, 2024 · 3 comments
Open

Undefined references in new release v0.5.10 #107

AtomicFS opened this issue Feb 17, 2024 · 3 comments
Labels
question Further information is requested

Comments

@AtomicFS
Copy link

I just tried to update AUR package that I am maintaining and I I got into problem building the newest release.

I am getting a lot of undefined references to some JavaScript things.

error: linking with `cc` failed: exit status: 1

...

  = note: /usr/bin/ld: /<HOME>/mdbook-katex/src/mdbook-katex-0.5.10/target/release/deps/mdbook_katex-5d33f764a8eae680.mdbook_katex.35b81f164e81743-cgu.00.rcgu.o: in function `std::sys::common::thread_local::fast_local::Key<T>::try_initialize':
          mdbook_katex.35b81f164e81743-cgu.00:(.text._ZN3std3sys6common12thread_local10fast_local12Key$LT$T$GT$14try_initialize17hc606d5746a222611E+0x52): undefined reference to `JS_NewRuntime'

...

  = note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link
  = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)

error: could not compile `mdbook-katex` (bin "mdbook-katex") due to 1 previous error
==> ERROR: A failure occurred in build().
    Aborting...

I just try to build it with cargo build --release.

Am I missing some dependency?

@SichangHe
Copy link
Collaborator

Hi @AtomicFS,

There's an AUR package for mdBook-KaTeX? 😳

Anyway, some comments:

  • I suggest people directly download from the Releases.
  • I did not touch anything related to JavaScript in v0.5.10, so it is surprising that it stopped working on that. Chances are, it is the new rustc (why are you on nightly?), Cargo, or some other stuff that broke the build, and the older version of your AUR package might stop working too. (Try stable Rust?)
  • Regarding the missing dependency, this JavaScript thing comes from katex-rs, which uses quick-js. I think they bundle the libraries though.

Hope this helps!

Steven Hé (Sīchàng)

@AtomicFS
Copy link
Author

AtomicFS commented Feb 18, 2024

Thank you for so fast response :) Yeah, there is AUR package I made because I prefer to use pacman over language-specific packages managers (cargo, pip, ...).

To the topis:

  • I am trying to build a release, all this AUR thing does is automating it. Not black magic behind it. Pulls sources, builds / compiles it, and the wraps up the results into archive.
  • You are right, there is very little difference between v0.5.10 and previous .... :/
    • I am running stable rust, not nightly, specifically v1.76.0 which is the most recent stable release.
    • I just tried to build mdbook-katex v0.5.9 and it fails the same way. I tried this also in fresh docker container with ArchLinux.
  • Seems like the errors come from quick-js. Rust pulls in quick-js v0.4.1, and while there is not much going on there, there have been 2 updates relatively recently on 2023-12-09 and 2024-01-13.
    • Last successful build of mine was on 2024-01-09, which is when I updated the AUR package from v0.5.8 to v0.5.9

UPDATE:

If it helps, here is the log of failed build attempt.

But it seems that downgrade of quick-js to 0.4.0 fixes the problem.

cargo update quick-js --precise 0.4.0
cargo build --release

@SichangHe
Copy link
Collaborator

quickjs-rs' last commit was about 3 years ago. But, it seems that QuickJS' development resumed about 3 months ago despite the comments in theduke/quickjs-rs#125. Maybe that's what broke your build.

Unfortunately, I reran some of the tests of katex-rs and mdbook-katex on Ubuntu latest and they both passed:
https://github.com/SichangHe/xu-cheng--katex-rs/actions/runs/7967406488/job/21750099066
https://github.com/SichangHe/mdbook-katex/actions/runs/7968221842/job/21752137560

Could you please open an issue on quickjs-rs? I am afraid I don't have a further direction in finding the solution.

@SichangHe SichangHe added the question Further information is requested label May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants