tauri: [bug] Rust package build failing when trying "tauri dev"
Describe the bug
Output:
--- stderr
Package javascriptcoregtk-4.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `javascriptcoregtk-4.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'javascriptcoregtk-4.0' found
Package javascriptcoregtk-4.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `javascriptcoregtk-4.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'javascriptcoregtk-4.0' found
Even more details:
Compiling zvariant v3.1.2
The following warnings were emitted during compilation:
warning: `"pkg-config" "--libs" "--cflags" "javascriptcoregtk-4.0" "javascriptcoregtk-4.0 >= 2.24"` did not exit successfully: exit status: 1
error: failed to run custom build command for `javascriptcore-rs-sys v0.4.0`
Caused by:
process didn't exit successfully: `/home/daniell/Desktop/test/frameworkjs/src-tauri/target/debug/build/javascriptcore-rs-sys-e4d503634ed33e5f/build-script-build` (exit status: 1)
--- stdout
cargo:rerun-if-env-changed=JAVASCRIPTCOREGTK_4.0_NO_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
cargo:warning=`"pkg-config" "--libs" "--cflags" "javascriptcoregtk-4.0" "javascriptcoregtk-4.0 >= 2.24"` did not exit successfully: exit status: 1
error: could not find system library 'javascriptcoregtk-4.0' required by the 'javascriptcore-rs-sys' crate
--- stderr
Package javascriptcoregtk-4.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `javascriptcoregtk-4.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'javascriptcoregtk-4.0' found
Package javascriptcoregtk-4.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `javascriptcoregtk-4.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'javascriptcoregtk-4.0' found
warning: build failed, waiting for other jobs to finish...
error: build failed
Blocking waiting for file lock on build directory
Compiling zstd-safe v4.1.4+zstd.1.5.2
Compiling javascriptcore-rs-sys v0.4.0
Compiling gobject-sys v0.15.9
Compiling cairo-sys-rs v0.15.1
Compiling gio-sys v0.14.0
Compiling gtk v0.15.4
Compiling rfd v0.7.0
Compiling gobject-sys v0.14.0
Compiling zbus v2.1.1
The following warnings were emitted during compilation:
warning: `"pkg-config" "--libs" "--cflags" "javascriptcoregtk-4.0" "javascriptcoregtk-4.0 >= 2.24"` did not exit successfully: exit status: 1
error: failed to run custom build command for `javascriptcore-rs-sys v0.4.0`
Caused by:
process didn't exit successfully: `/home/daniell/Desktop/test/frameworkjs/src-tauri/target/debug/build/javascriptcore-rs-sys-e4d503634ed33e5f/build-script-build` (exit status: 1)
--- stdout
cargo:rerun-if-env-changed=JAVASCRIPTCOREGTK_4.0_NO_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
cargo:warning=`"pkg-config" "--libs" "--cflags" "javascriptcoregtk-4.0" "javascriptcoregtk-4.0 >= 2.24"` did not exit successfully: exit status: 1
error: could not find system library 'javascriptcoregtk-4.0' required by the 'javascriptcore-rs-sys' crate
Reproduction
No response
Expected behavior
No response
Platform and versions
❯ cargo tauri info
Operating System - Ubuntu, version 20.04 X64
Node.js environment
Node.js - 14.17.3
@tauri-apps/cli - 1.0.0-rc.6
@tauri-apps/api - 1.0.0-rc.2
Global packages
npm - 7.19.1
pnpm - Not installed
yarn - 1.22.10
Rust environment
rustup - 1.24.3
rustc - 1.59.0
cargo - 1.59.0
toolchain - stable-x86_64-unknown-linux-gnu
App directory structure
/node_modules
/dist
/src-tauri
App
tauri - 1.0.0-rc.4
tauri-build - 1.0.0-rc.4
tao - 0.6.4
wry - 0.13.3
build-type - bundle
CSP - unset
distDir - ../dist
devPath - ../dist
Stack trace
No response
Additional context
No response
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 18 (7 by maintainers)
Commits related to this issue
- ci: add tauri v2 requirements based on comment https://github.com/tauri-apps/tauri/issues/3701#issuecomment-1499791223 — committed to nwesterhausen/dfraw_parser by nwesterhausen 3 years ago
- Refactor: Logic Rewrite (#35) * refactor: wipe and rewrite all for new engine * refactor: example cli runs. metadata is good but need to rework raw parsing * refactor: continue rewrite * ref... — committed to nwesterhausen/dfraw_parser by nwesterhausen 3 years ago
- release: update `5.9.0` — committed to pure-admin/tauri-pure-admin by xiaoxian521 2 years ago
You need to install the system dependencies listed here.
sudo apt-get install javascriptcoregtk-4.1 libsoup-3.0 webkit2gtk-4.1 -yIt’s worked for me
Edit by @FabianLars: These are the requirements for tauri v2! For v1 see the other comments above.
Link is broken, now it’s here
Did you mean https://tauri.app/v1/guides/getting-started/prerequisites ?
If you append -0 it will install the runtime package but to build the app you will need the development packages that have the -dev suffix instead of -0.
The
libin front while technically correct is not reallyyy required since apt-get interprets it as a pattern and will add the lib prefix itself. Same for -dev as long as you do not append the -0.To be extra clear, the most correct name on ubuntu is
libwebkit2gtk-4.1-dev. This will also include libsoup and libjavascriptcore so in theory you can remove the other 2.Workaround in this issue tauri-apps/tauri#9662
If you meet this in Ubuntu24, unfortunately, it does not have the libwebkit2gtk-4.0-dev package yet, see this link in the official repository. ubuntu official package search I haven’t found a solution yet and gave up on tauri for now.
If you want to develop for tauri v1 (which you said) then you want to install webkitgtk 4.0 not 4.1
If you want to develop for v2 then you need Ubuntu 22.04 or above for 4.1
That fixed the erorr, I installed webgitktk 4 with
sudo apt install libwebkit2gtk-4.0-dev.Now I get the error
(speak-together:28859): Gtk-WARNING **: 19:14:44.440: cannot open display:. I think since I am connected over ssh. I tried following https://stackoverflow.com/questions/76961661/how-to-open-the-tauri-application-located-on-the-server, no banana.Is it feasible to do tauri developement over ssh?
that’s the new location of the docs Lucas linked back then, correct.
@jaques-sam you can add Debian 10 to your source list, see #2647
We’re currently working to expose the Ayatana appindicator in tauri.