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] pkg-config cant see gdk-3.0.pc, when its clearly presented #11077

Open
MercuryHgO opened this issue Sep 20, 2024 · 0 comments
Open

[bug] pkg-config cant see gdk-3.0.pc, when its clearly presented #11077

MercuryHgO opened this issue Sep 20, 2024 · 0 comments
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@MercuryHgO
Copy link

Describe the bug

    Running BeforeDevCommand (`npm run dev`)

> cross-platform@0.1.0 dev
> vite


  VITE v5.4.3  ready in 211 ms

  ➜  Local:   http://localhost:1420/
    Info Watching /home/bittermann/projects/cross-platform/src-tauri for changes...
   Compiling glib-sys v0.18.1
   Compiling gobject-sys v0.18.0
   Compiling gio-sys v0.18.1
   Compiling gdk-sys v0.18.0
error: failed to run custom build command for `gdk-sys v0.18.0`

Caused by:
  process didn't exit successfully: `/home/bittermann/projects/cross-platform/src-tauri/target/debug/build/gdk-sys-439577ead3d06791/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-env-changed=GDK_3.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

  --- stderr

  pkg-config exited with status code 1
  > PKG_CONFIG_PATH=/nix/store/m1v13sqd0h9qfvynrj20aqx17d5chkin-gtk+3-3.24.41-dev/lib/pkgconfig:/nix/store/gdr1ghkakyjfdj8bc6n0virwllm4zpwz-glib-2.80.2-dev/lib/pkgconfig:/nix/store/ljrz822j7b6db3jnmw1jiafgrm8armcw-cairo-1.18.0-dev/lib/pkgconfig:/nix/store/gqkw1wn30p059dd1qzip7iz8zf810rx6-pango-1.52.2-dev/lib/pkgconfig:/nix/store/gx938f6w31a0alyqm81c6fp70br4xqqy-gdk-pixbuf-2.42.11-dev/lib/pkgconfig:/nix/store/srmh4pyhivcjsmaf9mjvafwp2wgynbdp-webkitgtk-2.44.2+abi=4.1-dev/lib/pkgconfig:/nix/store/cmfa2zrlji2lg5ng9ds9zwp38z3zw3i5-librsvg-2.58.0-dev/lib/pkgconfig PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 pkg-config --libs --cflags gdk-3.0 gdk-3.0 >= 3.22

  The system library `gdk-3.0` required by crate `gdk-sys` was not found.
  The file `gdk-3.0.pc` needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory.
  PKG_CONFIG_PATH contains the following:
      - /nix/store/m1v13sqd0h9qfvynrj20aqx17d5chkin-gtk+3-3.24.41-dev/lib/pkgconfig
      - /nix/store/gdr1ghkakyjfdj8bc6n0virwllm4zpwz-glib-2.80.2-dev/lib/pkgconfig
      - /nix/store/ljrz822j7b6db3jnmw1jiafgrm8armcw-cairo-1.18.0-dev/lib/pkgconfig
      - /nix/store/gqkw1wn30p059dd1qzip7iz8zf810rx6-pango-1.52.2-dev/lib/pkgconfig
      - /nix/store/gx938f6w31a0alyqm81c6fp70br4xqqy-gdk-pixbuf-2.42.11-dev/lib/pkgconfig
      - /nix/store/srmh4pyhivcjsmaf9mjvafwp2wgynbdp-webkitgtk-2.44.2+abi=4.1-dev/lib/pkgconfig
      - /nix/store/cmfa2zrlji2lg5ng9ds9zwp38z3zw3i5-librsvg-2.58.0-dev/lib/pkgconfig

  HINT: you may need to install a package such as gdk-3.0, gdk-3.0-dev or gdk-3.0-devel.

warning: build failed, waiting for other jobs to finish...

but gdk-3.0.pc is presented

[bittermann@nixos:~/projects/cross-platform]$ l /nix/store/m1v13sqd0h9qfvynrj20aqx17d5chkin-gtk+3-3.24.41-dev/lib/pkgconfig
total 40K
dr-xr-xr-x 1 root root 318 Jan  1  1970 .
dr-xr-xr-x 1 root root  18 Jan  1  1970 ..
-r--r--r-- 1 root root 361 Jan  1  1970 gail-3.0.pc
-r--r--r-- 1 root root 696 Jan  1  1970 gdk-3.0.pc
-r--r--r-- 1 root root 696 Jan  1  1970 gdk-broadway-3.0.pc
-r--r--r-- 1 root root 696 Jan  1  1970 gdk-wayland-3.0.pc
-r--r--r-- 1 root root 696 Jan  1  1970 gdk-x11-3.0.pc
-r--r--r-- 1 root root 693 Jan  1  1970 gtk+-3.0.pc
-r--r--r-- 1 root root 693 Jan  1  1970 gtk+-broadway-3.0.pc
-r--r--r-- 1 root root 492 Jan  1  1970 gtk+-unix-print-3.0.pc
-r--r--r-- 1 root root 693 Jan  1  1970 gtk+-wayland-3.0.pc
-r--r--r-- 1 root root 693 Jan  1  1970 gtk+-x11-3.0.pc

Reproduction

entering dev shell with nix-shell

initializng project with npm create tauri-app@latest -- --rc

running node_packages/.bin/tauri dev

default.nix

{
  pkgs ? import <nixpkgs> {},
  runScript ? ''$PWD/node_modules/.bin/tauri''
}:
let
  android-nixpkgs = pkgs.callPackage (import (builtins.fetchGit {
    url = "https://github.com/tadfisher/android-nixpkgs.git";
  })) {
    # Default; can also choose "beta", "preview", or "canary".
    channel = "stable";
  };

  android-sdk = android-nixpkgs.sdk (sdkPkgs: with sdkPkgs; [
    build-tools-34-0-0
    cmdline-tools-latest
    emulator
    platform-tools
    platforms-android-34

    # Other useful packages for a development environment.
    ndk-26-1-10909125
    # skiaparser-3
    # sources-android-34
  ]);
in
pkgs.buildFHSUserEnv {
  name = "tauri-env";
  targetPkgs = pkgs: 
  [
    android-sdk
  ]++(with pkgs; [
    clang
    gradle
    jdk
    rustup
    webkitgtk_4_1
    curl
    wget
    xorg.libxcb
    openssl
    libayatana-appindicator
    librsvg
    androidStudioPackages.stable
    pkg-config
    nodejs_22
    glib
    gtk3
    gdk-pixbuf
    pango
    cairo

    kotlin-language-server
    nodePackages.typescript-language-server
    vscode-langservers-extracted
  ]);

  runScript = runScript;

  profile = ''
    export ANDROID_HOME=${android-sdk}/share/android-sdk
    export ANDROID_SDK_ROOT=${android-sdk}/share/android-sdk
    export NDK_HOME=${android-sdk}/share/android-sdk/ndk/26.1.10909125
    export JAVA_HOME=${pkgs.jdk.home}
    export HOSTNAME=tauri-dev-env
    export PKG_CONFIG_PATH="${pkgs.gtk3.dev}/lib/pkgconfig:${pkgs.glib.dev}/lib/pkgconfig:${pkgs.cairo.dev}/lib/pkgconfig:${pkgs.pango.dev}/lib/pkgconfig:${pkgs.gdk-pixbuf.dev}/lib/pkgconfig:${pkgs.webkitgtk_4_1.dev}/lib/pkgconfig:${pkgs.librsvg.dev}/lib/pkgconfig"
  '';
}

shell.nix

{ pkgs ? import <nixpkgs> {}}:
let
  environment = import ./default.nix { inherit pkgs; runScript = ''bash'';};
in
environment.env

Expected behavior

normal execution of tauri dev

Full tauri info output

[✔] Environment
    - OS: NixOS 24.5.0 x86_64 (X64)
    ✔ webkit2gtk-4.1: 2.44.2
    ✔ rsvg2: 2.58.0
    ✔ rustc: 1.80.1 (3f5fd8dd4 2024-08-06)
    ✔ cargo: 1.80.1 (376290515 2024-07-16)
    ✔ rustup: 1.26.0 (1980-01-01)
    ✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (default)
    - node: 22.2.0
    - npm: 10.7.0

[-] Packages
    - tauri 🦀: 2.0.0-rc.10
    - tauri-build 🦀: 2.0.0-rc.9
    - wry 🦀: 0.43.1
    - tao 🦀: 0.30.0
    - @tauri-apps/api : 2.0.0-rc.4
    - @tauri-apps/cli : 2.0.0-rc.12

[-] Plugins
    - tauri-plugin-shell 🦀: 2.0.0-rc.3
    - @tauri-apps/plugin-shell : 2.0.0-rc.1

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/
    - framework: React
    - bundler: Vite

Stack trace

No response

Additional context

OS: NixOS 24.05
Nixpkgs 24.05

@MercuryHgO MercuryHgO added status: needs triage This issue needs to triage, applied to new issues type: bug labels Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

1 participant