Skip to content

Wails doctor reports library of libgtk-3-dev and libwebkit2gtk-4.0-dev incorrectly #4258

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

Open
jherman opened this issue Apr 30, 2025 · 4 comments
Labels
Bug Something isn't working

Comments

@jherman
Copy link

jherman commented Apr 30, 2025

Description

I think the contains call in the GO code is too strict when it is looking for the output of "[installed]". The output could be different. For example, in my container Debian bookworm container it shows:

root@091659c6144f:/# apt list -qq libgtk-3-dev
libgtk-3-dev/now 3.24.38-2~deb12u3 amd64 [installed,local]

Thus, I get a false negative.

To Reproduce

Use this dockerfile:

FROM debian:bookworm-slim

ARG GOLANG_VERSION=1.24.1
ARG LLVM_MINGW_URL=https://github.com/mstorsjo/llvm-mingw/releases/download/20250114/llvm-mingw-20250114-msvcrt-ubuntu-20.04-x86_64.tar.xz
ARG NODE_VERSION=20.12.2

# Install required packages and cross-compilers
RUN apt-get update && apt-get install -y \
    wget curl \
    git bash \
    build-essential pkg-config \
    gcc \
    xsel xclip \
    libpng++-dev \
    xcb libxcb-xkb-dev libxkbcommon-dev \
    gcc-mingw-w64 \
    libgtk-3-dev \
    libwebkit2gtk-4.0-dev \
    ca-certificates \
    software-properties-common \
    gnupg && \
    rm -rf /var/lib/apt/lists/*

# Optional: Install Docker CLI & NSIS for Windows packaging (Wails optional deps)
# RUN apt-get update && apt-get install -y \
#     docker.io \
#     nsis && \
#     rm -rf /var/lib/apt/lists/*

# Install LLVM MinGW
RUN wget ${LLVM_MINGW_URL} -O llvm-mingw.tar.xz && \
    tar -xJf llvm-mingw.tar.xz -C /opt && \
    rm llvm-mingw.tar.xz && \
    name=$(find /opt/* -maxdepth 0 -type d | grep llvm-mingw) && \
    mv "$name" /opt/llvm-mingw

# Install Go
RUN wget https://go.dev/dl/go${GOLANG_VERSION}.linux-amd64.tar.gz && \
    tar -C /usr/local -xzf go${GOLANG_VERSION}.linux-amd64.tar.gz && \
    rm go${GOLANG_VERSION}.linux-amd64.tar.gz

# Install Node.js and npm (default bundled version)
RUN curl -fsSL https://deb.nodesource.com/setup_20.x -o nodesource_setup.sh && \
    bash nodesource_setup.sh && \
    rm nodesource_setup.sh && \
    apt-get install -y nodejs && \
    rm -rf /var/lib/apt/lists/*

ENV PATH="/opt/llvm-mingw/bin:/usr/local/go/bin:/usr/local/bin:$PATH"

Expected behaviour

doctor should report installed

Screenshots

No response

Attempted Fixes

No response

System Details

Wails Doctor



# Wails
Version         | v2.10.1
Package Manager | apt


# System
WARNING: failed to read int from file: open /sys/devices/system/cpu/cpu0/online: no such file or directory
┌──────────────────────────────────────────────────────────┐
| OS           | Debian GNU/Linux                          |
| Version      | 12                                        |
| ID           | debian                                    |
| Go Version   | go1.24.1                                  |
| Platform     | linux                                     |
| Architecture | amd64                                     |
| CPU          | Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz |
| GPU          | Unknown                                   |
| Memory       | 32GB                                      |
└──────────────────────────────────────────────────────────┘

# Dependencies
┌────────────────────────────────────────────────────────────────────┐
| Dependency | Package Name          | Status    | Version           |
| *docker    | Unknown               | Not Found |                   |
| gcc        | build-essential       | Installed | 12.2.0            |
| libgtk-3   | libgtk-3-dev          | Available | 3.24.38-2~deb12u3 |
| libwebkit  | libwebkit2gtk-4.0-dev | Available | 2.48.1-2~deb12u1  |
| npm        | Unknown               | Not Found | 10.8.2            |
| *nsis      | Unknown               | Not Found |                   |
| pkg-config | pkg-config            | Installed | 1.8.1             |
|                                                                    |
└───────────────────── * - Optional Dependency ──────────────────────┘

# Diagnosis
Required package(s) installation details:
  - libgtk-3: sudo apt install libgtk-3-dev
  - libwebkit: sudo apt install libwebkit2gtk-4.0-dev

 WARNING  Your system has missing dependencies!
Fatal:
Required dependencies missing: npm
Please read this article on how to resolve this: https://wails.io/guides/resolving-missing-packages

Additional context

By the way, NPM is installed as the version is seen correctly, however status says not found.

@jherman jherman added the Bug Something isn't working label Apr 30, 2025
@jherman
Copy link
Author

jherman commented Apr 30, 2025

After some further investigation it seems like the call to

rm -rf /var/lib/apt/lists/*

is what causes wails doctor to not see things properly, including NPM.

after running apt-get update, things looked good again:

root@091659c6144f:/# rm -rf /var/lib/apt/lists/*
root@091659c6144f:/# wails doctor


          Wails Doctor



# Wails
Version         | v2.10.1
Package Manager | apt


# System
WARNING: failed to read int from file: open /sys/devices/system/cpu/cpu0/online: no such file or directory
┌──────────────────────────────────────────────────────────┐
| OS           | Debian GNU/Linux                          |
| Version      | 12                                        |
| ID           | debian                                    |
| Go Version   | go1.24.1                                  |
| Platform     | linux                                     |
| Architecture | amd64                                     |
| CPU          | Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz |
| GPU          | Unknown                                   |
| Memory       | 32GB                                      |
└──────────────────────────────────────────────────────────┘

# Dependencies
┌──────────────────────────────────────────────────────────────┐
| Dependency | Package Name    | Status    | Version           |
| *docker    | Unknown         | Not Found |                   |
| gcc        | build-essential | Installed | 12.2.0            |
| libgtk-3   | libgtk-3-dev    | Available | 3.24.38-2~deb12u3 |
| libwebkit  | Unknown         | Not Found |                   |
| npm        | Unknown         | Not Found | 10.8.2            |
| *nsis      | Unknown         | Not Found |                   |
| pkg-config | pkg-config      | Installed | 1.8.1             |
|                                                              |
└────────────────── * - Optional Dependency ───────────────────┘

# Diagnosis
Required package(s) installation details:
  - libgtk-3: sudo apt install libgtk-3-dev
  - libwebkit: sudo apt install libwebkit2gtk-4.0-dev

 WARNING  Your system has missing dependencies!
Fatal:
Required dependencies missing: libwebkit npm
Please read this article on how to resolve this: https://wails.io/guides/resolving-missing-packages

 ♥   If Wails is useful to you or your company, please consider sponsoring the project:
https://github.com/sponsors/leaanthony
root@091659c6144f:/# apt-get update
Get:1 http://deb.debian.org/debian bookworm InRelease [151 kB]
Get:2 http://deb.debian.org/debian bookworm-updates InRelease [55.4 kB]
Get:3 http://deb.debian.org/debian-security bookworm-security InRelease [48.0 kB]
Get:4 https://deb.nodesource.com/node_20.x nodistro InRelease [12.1 kB]
Get:5 http://deb.debian.org/debian bookworm/main amd64 Packages [8792 kB]
Get:6 https://deb.nodesource.com/node_20.x nodistro/main amd64 Packages [11.1 kB]
Get:7 http://deb.debian.org/debian bookworm/main amd64 DEP-11 Metadata [4492 kB]
Get:8 http://deb.debian.org/debian bookworm-updates/main amd64 Packages [512 B]
Get:9 http://deb.debian.org/debian-security bookworm-security/main amd64 Packages [257 kB]
Fetched 13.8 MB in 2s (5736 kB/s)
Reading package lists... Done
root@091659c6144f:/# wails doctor


          Wails Doctor



# Wails
Version         | v2.10.1
Package Manager | apt


# System
WARNING: failed to read int from file: open /sys/devices/system/cpu/cpu0/online: no such file or directory
┌──────────────────────────────────────────────────────────┐
| OS           | Debian GNU/Linux                          |
| Version      | 12                                        |
| ID           | debian                                    |
| Go Version   | go1.24.1                                  |
| Platform     | linux                                     |
| Architecture | amd64                                     |
| CPU          | Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz |
| GPU          | Unknown                                   |
| Memory       | 32GB                                      |
└──────────────────────────────────────────────────────────┘

# Dependencies
┌───────────────────────────────────────────────────────────────────────────┐
| Dependency | Package Name          | Status    | Version                  |
| *docker    | docker.io             | Available | 20.10.24+dfsg1-1+deb12u1 |
| gcc        | build-essential       | Installed | 12.9                     |
| libgtk-3   | libgtk-3-dev          | Installed | 3.24.38-2~deb12u3        |
| libwebkit  | libwebkit2gtk-4.0-dev | Available | 2.48.1-2~deb12u1         |
| npm        | npm                   | Installed | 10.8.2                   |
| *nsis      | nsis                  | Available | 3.08-3+deb12u1           |
| pkg-config | pkg-config            | Installed | 1.8.1-1                  |
|                                                                           |
└───────────────────────── * - Optional Dependency ─────────────────────────┘

# Diagnosis
Required package(s) installation details:
  - libwebkit: sudo apt install libwebkit2gtk-4.0-dev

Optional package(s) installation details:
  - docker: sudo apt install docker.io
  - nsis: sudo apt install nsis

 WARNING  Your system has missing dependencies!

@leaanthony
Copy link
Member

Is this a local environment issue then? Can this be closed?

@jherman
Copy link
Author

jherman commented May 2, 2025

@leaanthony It depends on how you look at it. To me it should remain open and solved. Since the libraries are installed but the screenscraping from this particular line:

return strings.Contains(stdo.String(), "[installed]"), err

is too restrictive to match this valid output libgtk-3-dev/now 3.24.38-2~deb12u3 amd64 [installed,local].

Perhaps using regex instead would be beneficial here. Ultimately, I'll let you decide.

@leaanthony
Copy link
Member

Sounds good to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants