lzanini / mdbook-katex

A preprocessor for mdBook, rendering LaTex equations to HTML at build time.
MIT License
195 stars 34 forks source link

Undefined references in new release v0.5.10 #107

Open AtomicFS opened 5 months ago

AtomicFS commented 5 months ago

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 commented 5 months ago

Hi @AtomicFS,

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

Anyway, some comments:

Hope this helps!

Steven Hé (Sīchàng)

AtomicFS commented 5 months ago

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:

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 commented 5 months ago

quickjs-rs' last commit was about 3 years ago. But, it seems that QuickJS' development resumed about 3 months ago despite the comments in https://github.com/theduke/quickjs-rs/issues/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.