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

[bug] Rust package build failing when trying "tauri dev" #3701

Closed
danimesq opened this issue Mar 14, 2022 · 18 comments
Closed

[bug] Rust package build failing when trying "tauri dev" #3701

danimesq opened this issue Mar 14, 2022 · 18 comments

Comments

@danimesq
Copy link

danimesq commented Mar 14, 2022

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

@danimesq danimesq changed the title [bug] Rust package built failing when trying "tauri dev" [bug] Rust package build failing when trying "tauri dev" Mar 14, 2022
@lucasfernog
Copy link
Member

You need to install the system dependencies listed here.

@danimesq
Copy link
Author

danimesq commented Mar 15, 2022

You need to install the system dependencies listed here.

Have installed libwebkit2gtk-4.0-dev, build-essential, curl, wget, libssl-dev, libgtk-3-dev, libappindicator3-dev, librsvg2-dev.
Have NOT installed libappindicator nor librsvg as they're marked as optional.

Already have NodeJS installed (although not sure if installed from official NodeJS or from nvm).

Have upgraded my old (but already installed) Rustc and Cargo.

rustc --version outputs rustc 1.59.0 (9d1b2106e 2022-02-23).
npm -v outputs 7.19.1.

This isn't a issue in the repo, but in the docs; specifically this part:

sudo apt update && sudo apt install libwebkit2gtk-4.0-dev
build-essential
curl
wget
libssl-dev
libgtk-3-dev
libappindicator3-dev
librsvg2-dev

I copied it and pasted, but Bash have read only sudo apt update and the other lines were missed.

libssl-dev wasn't installed.
libappindicator3-dev wasn't installed. librsvg2-dev wasn't installed. (why optional packages were added in the required quote?)

When trying sudo apt install libwebkit2gtk-4.0-dev, got this output:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
libwebkit2gtk-4.0-dev : Depends: libsoup2.4-dev (>= 2.40) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

How to fix the libsoup2.4-dev issue?

@jaques-sam
Copy link

On debian11 the package libappindicator3-dev cannot be found any more.

@lucasfernog
Copy link
Member

We're currently working to expose the Ayatana appindicator in tauri.

@lucasfernog
Copy link
Member

@jaques-sam you can add Debian 10 to your source list, see #2647

@thy-jumrylsolivio
Copy link

to fix the libsoup2.4-dev issue try this " sudo apt install libsoup2.4-dev

@Type1J
Copy link

Type1J commented Mar 8, 2023

You need to install the system dependencies listed here.

Did you mean https://tauri.app/v1/guides/getting-started/prerequisites ?

@FabianLars
Copy link
Member

that's the new location of the docs Lucas linked back then, correct.

@Kennytian
Copy link

Kennytian commented Apr 7, 2023

sudo apt-get install javascriptcoregtk-4.1 libsoup-3.0 webkit2gtk-4.1 -y

It's worked for me

Edit by @FabianLars: These are the requirements for tauri v2! For v1 see the other comments above.

@FreeWebber
Copy link

FreeWebber commented Aug 4, 2023

You need to install the system dependencies listed here.

Link is broken, now it's here

nwesterhausen added a commit to nwesterhausen/dfraw_json_parser that referenced this issue Oct 14, 2023
nwesterhausen added a commit to nwesterhausen/dfraw_json_parser that referenced this issue Oct 24, 2023
* refactor: wipe and rewrite all for new engine

* refactor: example cli runs. metadata is good but need to rework raw parsing

* refactor: continue rewrite

* refactor: finish creature parsing rewrite

* chore: clear clippy warnings

* fix: remove unused dependencies

* fix: add missing tags

* feat; handle copy_tags_from

* fix: with progress response

* feat: add rs-ts

* refactor: continue rewrite

* refactor: continue rewrite

* change: use formatting for rs-ts

* docs: update readme and remove old type file

* feat: add plant_growths

* fix: use default pattern for module info file

* feat: add options struct for passing options to parser

* chore: disable clippy::must_use_candidate

* chore: allow clippy::must_use_candidate

* feat: plant parsing

* fix: remove formatting from rs-ts

* feat: add shrub details for plant

* feat: add plant seed

* feat: handle plant materials

* feat: add inorganic parsing

* fix: plant raws serializing empties

* feat: add temperature and state names

* feat: parse material templates

* fix: respect parser options

* feat: add syndromes

* chore: update bindings

* chore: add helper script to update bindings

* feat: update tauri_lib with new logic

* feat: update cli and tauri_lib for new logic

* fix: make sure cli works and update examples

* chore: update bindings

* fix: improve library methods

* feat: add first-pass graphics and other utility

* fix: graphic parsing includes layers

* chore: update bindings

* feat: add TilePage parsing

* fix: improve graphic parsing

* fix: improve graphic parsing

* chore: update bindings

* ci: update tauri dependencies

* ci: update clippy check

* ci: fix clippy check

* ci: fix formatting

* ci: add libsoup-3.0 dependency for tauri dependency soup3

* ci: add additional `soup3` dependency

* ci: add tauri v2 requirements

based on comment tauri-apps/tauri#3701 (comment)

* feat(tauri): return objects instead of json string

Tauri handles serde serialization automatically.

* feat: some changes to help enable + Send + Sync

* fix: expose names

* fix: expose graphics

* ci: add a step to verify type bindings

* ci: prettier bindings

* feat: parse syndromes and other material properties

* fix: remove liquid density

* feat: handle more tokens

* feat: more tokens

* chore: update bindings

* feat: implement search string generation

* chore: remove boilerplate

* feat: expose build_search_string

* chore: update bindings

* feat: impl Searchable as part of RawObject

* feat: expose name on raw object for sorting

* fix: page number - 1

* fix: less verbose logs

* dev: add launch config for debug

* fix: correct the parsing logic

* chore: update logging messages

* fix: caste and creature are together

* fix: hopefully final change for creature caste

* feat: add entity object

* feat: add remaining entity fields and parsing

* feat: actually add entity parsing

* fix: handle creature tags on entity

* fix: add entity to clone raw object box

* fix: entity wasn't getting updated

* feat: add Position raw under Entity

* feat: improved turnaround on non-supported raw files

* chore: update bindings

* feat: add convenience functions to creature

* fix: expose DoesNotExist

* feat: expose all tile pages used

* fix: check parse_graphics for graphics go-ahead

* fix: guard against page number 0

* feat: expose location on metadata

* chore: set tauri back to stable before merge

---------

Co-authored-by: Nicholas Westerhausen <[email protected]>
@ZoeLeee
Copy link

ZoeLeee commented Mar 14, 2024

sudo apt-get install javascriptcoregtk-4.1 libsoup-3.0 webkit2gtk-4.1 -y

It's worked for me

Edit by @FabianLars: These are the requirements for tauri v2! For v1 see the other comments above.

It's worked for me

@OJFord
Copy link
Contributor

OJFord commented Mar 19, 2024

Note on ubuntu (at least, GH Actions' ubuntu-latest) it's:

  • libjavascriptcoregtk-4.1 -0
  • libsoup-3.0 -0
  • libwebkitgtk-4.1 -0

Then it still doesn't work because:

 error: failed to run custom build command for `gdk-sys v0.18.0`
[...]
  --- stderr
  `PKG_CONFIG_ALLOW_SYSTEM_CFLAGS="1" "pkg-config" "--libs" "--cflags" "gdk-3.0" "gdk-3.0 >= 3.22"` did not exit successfully: exit status: 1
  error: could not find system library 'gdk-3.0' required by the 'gdk-sys' crate
  --- stderr
  Package gdk-3.0 was not found in the pkg-config search path.
  Perhaps you should add the directory containing `gdk-3.0.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'gdk-3.0' found
  Package gdk-3.0 was not found in the pkg-config search path.
  Perhaps you should add the directory containing `gdk-3.0.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'gdk-3.0' found

libgdk3.0-cil doesn't fix it; leaving it there for now.

@FabianLars
Copy link
Member

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 lib in 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.

@kleenkanteen
Copy link

kleenkanteen commented Jun 3, 2024

I am using github codspaces that uses Ubuntu 20 LTS for tauri v1 and am getting this error:

@kleenkanteen ➜ /workspaces/speak-together (main) $ sudo apt install libwebkit2gtk-4.1-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package libwebkit2gtk-4.1-dev
E: Couldn't find any package by glob 'libwebkit2gtk-4.1-dev'

Similar error if I do sudo apt-get install javascriptcoregtk-4.1 libsoup-3.0 webkit2gtk-4.1 -y:

@kleenkanteen ➜ /workspaces/speak-together (main) $ sudo apt-get install javascriptcoregtk-4.1 libsoup-3.0 webkit2gtk-4.1 -y
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package javascriptcoregtk-4.1
E: Couldn't find any package by glob 'javascriptcoregtk-4.1'
E: Couldn't find any package by regex 'javascriptcoregtk-4.1'
E: Unable to locate package libsoup-3.0
E: Couldn't find any package by glob 'libsoup-3.0'
E: Couldn't find any package by regex 'libsoup-3.0'
E: Unable to locate package webkit2gtk-4.1
E: Couldn't find any package by glob 'webkit2gtk-4.1'
E: Couldn't find any package by regex 'webkit2gtk-4.1'

I did sudo apt update and sudo apt update before all this.

Any ideas? What a pain

@FabianLars
Copy link
Member

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

@kleenkanteen
Copy link

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?

@hellojason3
Copy link

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.

@AndreRojasMartinsson
Copy link

Workaround in this issue #9662

I worked around this by adding the following line to /etc/apt/sources.list:

deb http://gb.archive.ubuntu.com/ubuntu jammy main

Then doing:

sudo apt update
sudo apt install libwebkit2gtk-4.0-dev

IMPORTANT: it was recommended in this #9662 (comment) to undo the change to sources.list after installing to prevent problems with dependencies being deleted.

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

No branches or pull requests