tectonic icon indicating copy to clipboard operation
tectonic copied to clipboard

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

Open forgemo opened this issue 3 months ago • 4 comments

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 avatar Mar 18 '24 20:03 forgemo

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.

forgemo avatar Mar 18 '24 20:03 forgemo

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!

qtfkwk avatar Mar 22 '24 13:03 qtfkwk

I believe this might be fixed in https://github.com/tectonic-typesetting/tectonic/issues/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" }

j-rock avatar Apr 10 '24 06:04 j-rock

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.

ilyapopov avatar Apr 18 '24 14:04 ilyapopov