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

cargo install tectonic failed to run custom build command for tectonic_bridge_harfbuzz v0.2.9 #1172

Open
forgemo opened this issue Mar 18, 2024 · 4 comments

Comments

@forgemo
Copy link

forgemo commented Mar 18, 2024

I tried to install tectonic via cargo install tectonic.
Unfortunately, it failed with the following error message.

warning: [email protected]: Compiler version doesn't include clang or GCC: "c++" "--version"

error: failed to run custom build command for `tectonic_bridge_harfbuzz v0.2.9`

Caused by:
  process didn't exit successfully: `/tmp/cargo-installn9Dxxu/release/build/tectonic_bridge_harfbuzz-75c575493e1341a0/build-script-build` (exit status: 101)
  --- stdout
  TARGET = Some("x86_64-unknown-linux-gnu")
  OPT_LEVEL = Some("3")
  HOST = Some("x86_64-unknown-linux-gnu")
  cargo:rerun-if-env-changed=CXX_x86_64-unknown-linux-gnu
  CXX_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CXX_x86_64_unknown_linux_gnu
  CXX_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_CXX
  HOST_CXX = None
  cargo:rerun-if-env-changed=CXX
  CXX = None
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  cargo:warning=Compiler version doesn't include clang or GCC: "c++" "--version"
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("false")
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
  cargo:rerun-if-env-changed=CXXFLAGS_x86_64-unknown-linux-gnu
  CXXFLAGS_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CXXFLAGS_x86_64_unknown_linux_gnu
  CXXFLAGS_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_CXXFLAGS
  HOST_CXXFLAGS = None
  cargo:rerun-if-env-changed=CXXFLAGS
  CXXFLAGS = None
  cargo:rerun-if-env-changed=AR_x86_64-unknown-linux-gnu
  AR_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=AR_x86_64_unknown_linux_gnu
  AR_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_AR
  HOST_AR = None
  cargo:rerun-if-env-changed=AR
  AR = None
  cargo:rerun-if-env-changed=ARFLAGS_x86_64-unknown-linux-gnu
  ARFLAGS_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=ARFLAGS_x86_64_unknown_linux_gnu
  ARFLAGS_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_ARFLAGS
  HOST_ARFLAGS = None
  cargo:rerun-if-env-changed=ARFLAGS
  ARFLAGS = None
  cargo:rustc-link-lib=static=harfbuzz
  cargo:rustc-link-search=native=/tmp/cargo-installn9Dxxu/release/build/tectonic_bridge_harfbuzz-9aa78a8c840c15d7/out
  cargo:rerun-if-env-changed=CXXSTDLIB_x86_64-unknown-linux-gnu
  CXXSTDLIB_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CXXSTDLIB_x86_64_unknown_linux_gnu
  CXXSTDLIB_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_CXXSTDLIB
  HOST_CXXSTDLIB = None
  cargo:rerun-if-env-changed=CXXSTDLIB
  CXXSTDLIB = None
  cargo:rustc-link-lib=stdc++
  cargo:include-path=/tmp/cargo-installn9Dxxu/release/build/tectonic_bridge_harfbuzz-9aa78a8c840c15d7/out;/usr/include

  --- stderr
  thread 'main' panicked at /home/forgemo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tectonic_bridge_harfbuzz-0.2.9/build.rs:143:47:
  failed to copy header: Os { code: 2, kind: NotFound, message: "No such file or directory" }
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: failed to compile `tectonic v0.15.0`, intermediate artifacts can be found at `/tmp/cargo-installn9Dxxu`.

I'm using Ubuntu 22.04 and my installed libharfbuzz-dev version is

libharfbuzz-dev/jammy-security,jammy-updates,now 2.7.4-1ubuntu3.1 amd64

I installed all dependencies via

sudo apt-get install \
  libfontconfig1-dev libgraphite2-dev libharfbuzz-dev libicu-dev libssl-dev zlib1g-dev

Please help me to understand what is going wrong.

@forgemo forgemo changed the title Cargo install fails due to "failed to run custom build command for tectonic_bridge_harfbuzz v0.2.9" Cargo install tectonic failed to run custom build command for tectonic_bridge_harfbuzz v0.2.9 Mar 18, 2024
@forgemo forgemo changed the title Cargo install tectonic failed to run custom build command for tectonic_bridge_harfbuzz v0.2.9 ecargo install tectonic failed to run custom build command for tectonic_bridge_harfbuzz v0.2.9 Mar 18, 2024
@forgemo forgemo changed the title ecargo install tectonic failed to run custom build command for tectonic_bridge_harfbuzz v0.2.9 cargo install tectonic failed to run custom build command for tectonic_bridge_harfbuzz v0.2.9 Mar 18, 2024
@forgemo
Copy link
Author

forgemo commented Mar 18, 2024

Little addition:

When using tectonic as a dependency, I get the same error from cargo build.
However, when adding the feature flag external-harfbuzz, it builds successfully.

// this works
tectonic = {version = "0.15", features = ["external-harfbuzz"]}

// this fails
tectonic = {version = "0.15"}

Therefore, the issue is likely related to the vendoring of harfbuzz.

@qtfkwk
Copy link

qtfkwk commented Mar 22, 2024

Ran into the same error just now on a Kali (Debian-based) system (rolling release; updated just prior) where the same tectonic version (0.15.0) was being reinstalled (--force) due to Rust upgrading to 1.77.0. Installed libharfbuzz-dev version is 8.3.0-2.

Uninstalling and installing fresh did not resolve it.

Based on your observation adding the external-harfbuzz feature, I tried cargo install -F external-harfbuzz tectonic... that worked!

@j-rock
Copy link

j-rock commented Apr 10, 2024

I believe this might be fixed in #1156 which has not yet made it to a crates.io release. I was able to successfully build by specifying a git dependency in my Cargo.toml:

tectonic = { git = "https://github.com/tectonic-typesetting/tectonic.git", branch = "master" }

@ilyapopov
Copy link

ilyapopov commented Apr 18, 2024

I have the same problem when trying to install tectonic on Ubuntu 24.04 beta with:

cargo install tectonic

If instead I use

cargo install --git https://github.com/tectonic-typesetting/tectonic tectonic

It works fine.

I guess a lot of people will hit this problem when Ubuntu 24.04 is released in a week or so, so maybe it makes sense to cut a release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants