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

build error linux #50

Closed
Eliyaan opened this issue Jan 25, 2025 · 14 comments
Closed

build error linux #50

Eliyaan opened this issue Jan 25, 2025 · 14 comments
Labels

Comments

@Eliyaan
Copy link

Eliyaan commented Jan 25, 2025

While trying to build the project on linux I get an error:

❯ task build-linux
task: [build-linux] wails build -platform=linux/amd64,linux/arm64
Wails CLI v2.9.2


# Build Options

Platform(s)        | linux/amd64,linux/arm64
Compiler           | /usr/bin/go
Skip Bindings      | false
Build Mode         | production
Devtools           | false
Frontend Directory | /home/nopana/apps/RemoteController/frontend
Obfuscated         | false
Skip Frontend      | false
Compress           | false
Package            | true
Clean Bin Dir      | false
LDFlags            |
Tags               | []
Race Detector      | false
Warning: go.mod is using Wails '2.7.1' but the CLI is 'v2.9.2'. Consider updating your project's `go.mod` file.


# Building target: linux/amd64

  • Generating bindings:   ERROR
          main.go:15:12: pattern frontend/build/*: no matching files found

          exit status 1

  ERROR
          main.go:15:12: pattern frontend/build/*: no matching files found

          exit status 1
 ♥   If Wails is useful to you or your company, please consider sponsoring the project:
https://github.com/sponsors/leaanthony
task: Failed to run task "build-linux": exit status 1

I never used go so I may be missing some obvious thing but I did not find information on it.

  • OS: Void Linux

I tested it in the browser with a friend, it works very well. Thanks for your work! (I wanted to install it on my pc to host because my friend has a worse connection than me so there was latency.)

@PiterWeb
Copy link
Owner

I think it's my fault. The error should be solved if you do the following steps:

  • cd frontend
  • pnpm run build / npm run build

And then try to execute task build-linux again

There is also an error with a keyboard dependency related to linux but should be pretty easy to solve.
On a few days I can try to solve this.

If this error appears to you one way of fixing it quickly is to comment all the code related with the keyboard (the code is in src/keyboard folder and you will have to comment the functions in src/net/host.go that came from src/keyboard)

I am happy that you like my work :)

@Eliyaan
Copy link
Author

Eliyaan commented Jan 25, 2025

Thanks for your quick answer.
When running the command you mentioned, it says that vite is not found, I dont know which software to install and did not find any mentions of it in the readme and others. What do I need to install?
I think for the dependencies it would be great to add some links (instead of just the names), as inexperienced developers in this field (as me) wont be sure of what/how to install and might not install the right tool. I was not sure if I installed to right things for Task CLI, Wails CLI.

>  pnpm run build

> [email protected] build /home/nopana/apps/RemoteController/frontend
> vite build

sh: 1: vite: not found
 ELIFECYCLE  Command failed.

Your work is very impressive, it looks very clean and works well :D

@PiterWeb
Copy link
Owner

You are right, I will edit the docs to include the links of the tools.

Talking about the error you have is again my fault. Before doing pnpm run build / npm run build you have to do pnpm install / npm install. This will install all the frontend dependencies automatically.

@Eliyaan
Copy link
Author

Eliyaan commented Jan 25, 2025

Oh amazing thank you!

It's a bit wierd, it does not seem to take effect, do I have to do something else?

nopana@void ~/apps/RemoteController/frontend (main)
❯ pnpm install
Lockfile is up to date, resolution step is skipped
Already up to date
Done in 1.8s
nopana@void ~/apps/RemoteController/frontend (main)
❯ pnpm run build

> [email protected] build /home/nopana/apps/RemoteController/frontend
> vite build

sh: 1: vite: not found
 ELIFECYCLE  Command failed.

@PiterWeb
Copy link
Owner

I think you don't have to do nothing more.
The only thing I can think that might help could be deleting the pnpm-lock.yaml and package-lock.json located in the frontend folder.

If you still have the same error I will try to build myself from linux. If that is the case I can upload the binaries to the releases section so you don't have to build.

@Eliyaan
Copy link
Author

Eliyaan commented Jan 26, 2025

Thanks it would be great to have the linux binaries!

I tried to install vite by hand with pnpm:

❯ pnpm install vite
 WARN  deprecated [email protected]: This version is no longer supported. Please see https://eslint.org/version-support for other options.
 WARN  6 deprecated subdependencies found: @humanwhocodes/[email protected], @humanwhocodes/[email protected], [email protected], [email protected], [email protected], [email protected]
Already up to date
Progress: resolved 912, reused 851, downloaded 0, added 0, done

dependencies:
+ vite 6.0.11

 WARN  Issues with peer dependencies found
.
├─┬ @sveltejs/kit 2.7.2
│ └── ✕ unmet peer vite@^5.0.3: found 6.0.11
├─┬ @sveltejs/vite-plugin-svelte 4.0.0
│ ├── ✕ unmet peer vite@^5.0.0: found 6.0.11
│ └─┬ @sveltejs/vite-plugin-svelte-inspector 3.0.1
│   └── ✕ unmet peer vite@^5.0.0: found 6.0.11
└─┬ vite-plugin-pwa 0.20.5
  └── ✕ unmet peer vite@"^3.1.0 || ^4.0.0 || ^5.0.0": found 6.0.11

Done in 4.2s
nopana@void ~/apps/RemoteController/frontend (main)
❯ pnpm run build

> [email protected] build /home/nopana/apps/RemoteController/frontend
> vite build

vite v6.0.11 building SSR bundle for production...
transforming (49) node_modules/.pnpm/[email protected]/node_modules/svelte/src/internal/server/dev.js
╭── 🌼 daisyUI 3.9.4 https://daisyui.com
│
├── 1 theme is enabled. How to add more themes:
│   https://daisyui.com/docs/themes
│
╰── ⭐️ Star daisyUI project on GitHub: https://github.com/saadeghi/daisyui

"default" is imported from external module "@formkit/auto-animate" but never used in "src/lib/webrtc/ICEServerManager.svelte".
✓ 184 modules transformed.
vite v6.0.11 building for production...
✓ 212 modules transformed.
x Build failed in 2.22s
x Build failed in 5.96s

PWA v0.20.5
mode      generateSW
precache  3 entries (17.83 KiB)
files generated
  .svelte-kit/output/server/sw.js
  .svelte-kit/output/server/workbox-cbf83eee.js
warnings
  One of the glob patterns doesn't match any files. Please remove or fix the following: {
  "globDirectory": "/home/nopana/apps/RemoteController/frontend/.svelte-kit/output",
  "globPattern": "prerendered/**/*.html",
  "globIgnores": [
    "server/*.*",
    "server/sw.js",
    "server/workbox-*.js"
  ]
}
  One of the glob patterns doesn't match any files. Please remove or fix the following: {
  "globDirectory": "/home/nopana/apps/RemoteController/frontend/.svelte-kit/output",
  "globPattern": "client/*.webmanifest",
  "globIgnores": [
    "server/*.*",
    "server/sw.js",
    "server/workbox-*.js"
  ]
}

error during build:
[vite-plugin-sveltekit-compile] [vite:manifest] Cannot read properties of undefined (reading 'length')
[vite:manifest] Cannot read properties of undefined (reading 'length')
    at Object.generateBundle (file:///home/nopana/apps/RemoteController/frontend/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-M1IYMR16.js:13767:58)
    at Object.handler (file:///home/nopana/apps/RemoteController/frontend/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-M1IYMR16.js:51358:15)
    at file:///home/nopana/apps/RemoteController/frontend/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:20730:40
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
 ELIFECYCLE  Command failed with exit code 1.
nopana@void ~/apps/RemoteController/frontend (main) [1]

@PiterWeb
Copy link
Owner

PiterWeb commented Jan 26, 2025

I managed to compile with linux installing all from scratch, the only error I got was because of the Go code related to keyboard but I managed to fix it. But I only have the amd64 bin, not the ARM (this crash due to assembly errors (: )

I will upload later, I have to make a release first because the Web client in production (release branch) right now is not up to date with the one binaries I am going to publish (of the main branch)

@Eliyaan
Copy link
Author

Eliyaan commented Jan 26, 2025

Thanks for you help!
I installed vite 5.0.0 (with pnpm vite@^5.0.0) and now pnpm run build worked.
Now task build-linux only complains about keyboard things. I'll try to comment them if I get a bit more time and if the binaries are not released yet.

# Building target: linux/amd64

  • Generating bindings:   ERROR
          # github.com/PiterWeb/RemoteController/src/gamepad
          src/gamepad/handler_unix.go:26:11: undefined: clonedGamepad
          # github.com/PiterWeb/RemoteController/src/keyboard
          src/keyboard/translate_js_to_go.go:59:30: undefined: keybd_event.VK_SELECT

          exit status 1

  ERROR
          # github.com/PiterWeb/RemoteController/src/gamepad
          src/gamepad/handler_unix.go:26:11: undefined: clonedGamepad
          # github.com/PiterWeb/RemoteController/src/keyboard
          src/keyboard/translate_js_to_go.go:59:30: undefined: keybd_event.VK_SELECT

          exit status 1

@PiterWeb
Copy link
Owner

I have published the release, but I have found one thing, there is still an error with the Keyboard but on runtime.

Another thing I have realised (and I want you to know that I am very sorry for it, because I didn't remember during this time) that in linux I didn't implement yet the gamepad.

But good news, this week I have installed in my laptop a Linux OS so I can be focus on developing it.

@PiterWeb PiterWeb added the linux label Jan 26, 2025
@Eliyaan
Copy link
Author

Eliyaan commented Jan 26, 2025

That's amazing news! Thanks for your work :D

@Eliyaan
Copy link
Author

Eliyaan commented Jan 26, 2025

I pulled the last version, it complained about pkg-config missing :

  • Compiling application: github.com/wailsapp/wails/v2/pkg/assetserver/webview: exec: "pkg-config": executable file not found in $PATH
  ERROR   exit status 1

So I installed it and now it tells this:

  • Compiling frontend: Done.
  • Compiling application: # github.com/wailsapp/wails/v2/pkg/assetserver/webview
# [pkg-config --cflags  -- gtk+-3.0 gio-unix-2.0 webkit2gtk-4.0 gtk+-3.0 gio-unix-2.0 webkit2gtk-4.0 gtk+-3.0 webkit2gtk-4.0]
Package gtk+-3.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-3.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk+-3.0' found
Package gio-unix-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gio-unix-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gio-unix-2.0' found
Package webkit2gtk-4.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `webkit2gtk-4.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'webkit2gtk-4.0' found
Package gtk+-3.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-3.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk+-3.0' found
Package gio-unix-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gio-unix-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gio-unix-2.0' found
Package webkit2gtk-4.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `webkit2gtk-4.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'webkit2gtk-4.0' found
Package gtk+-3.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-3.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk+-3.0' found
Package webkit2gtk-4.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `webkit2gtk-4.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'webkit2gtk-4.0' found
  ERROR   exit status 1

Do I need to install these packages? (I think I'm missing a lot of things because I'm on void linux, a distribution with the bare minimum installed)

It would be great to add pkg-config (and maybe those packages if needed) to the docs along with the links to the dependencies/tools.

@Eliyaan
Copy link
Author

Eliyaan commented Jan 26, 2025

I installed gtk+3-devel and webkit2gtk-devel (*-devel is the name of the developement packages/libs in void linux) and now it builds for linux amd64!

@PiterWeb
Copy link
Owner

Very nice, I am happy that finally builds for you.
The dependencies you are talking about are related to Wails, the libs and instalation steps are different for every platform so there is a command wails doctor that I forgot to mention, which explains what dependencies you need, if they are already installed and how to install them.

Now that builds I will close the issue and the conversation about the implementation of the Gamepad functionality (that I have already started to do yesterday) will be moved to Linux support issue

@Eliyaan
Copy link
Author

Eliyaan commented Jan 27, 2025

Okay great!

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

No branches or pull requests

2 participants