#Tauri app refuses to compile

134 messages · Page 1 of 1 (latest)

earnest bison
#

I'm getting the same error as I got trying to compile tauri-cli, but this time adding --debug does not change it.

Caused by:
  process didn't exit successfully: `/home/gitlab-runner/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/rustc --crate-name windows --edition=2018 /home/gitlab-runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/windows-0.39.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=111 --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --cfg 'feature="Win32"' --cfg 'feature="Win32_Devices"' --cfg 'feature="Win32_Devices_HumanInterfaceDevice"' --cfg 'feature="Win32_Foundation"' --cfg 'feature="Win32_Globalization"' --cfg 'feature="Win32_Graphics"' --cfg 'feature="Win32_Graphics_Dwm"' --cfg 'feature="Win32_Graphics_Gdi"' --cfg 'feature="Win32_System"' --cfg 'feature="Win32_System_Com"' --cfg 'feature="Win32_System_Com_StructuredStorage"' --cfg 'feature="Win32_System_DataExchange"' --cfg 'feature="Win32_System_Diagnostics"' --cfg 'feature="Win32_System_Diagnostics_Debug"' --cfg 'feature="Win32_System_LibraryLoader"' --cfg 'feature="Win32_System_Memory"' --cfg 'feature="Win32_System_Ole"' --cfg 'feature="Win32_System_SystemInformation"' --cfg 'feature="Win32_System_SystemServices"' --cfg 'feature="Win32_System_Threading"' --cfg 'feature="Win32_System_WinRT"' --cfg 'feature="Win32_System_WindowsProgramming"' --cfg 'feature="Win32_UI"' --cfg 'feature="Win32_UI_Accessibility"' --cfg 'feature="Win32_UI_Controls"' --cfg 'feature="Win32_UI_HiDpi"' --cfg 'feature="Win32_UI_Input"' --cfg 'feature="Win32_UI_Input_Ime"' --cfg 'feature="Win32_UI_Input_KeyboardAndMouse"' --cfg 'feature="Win32_UI_Input_Pointer"' --cfg 'feature="Win32_UI_Input_Touch"' --cfg 'feature="Win32_UI_Shell"' --cfg 'feature="Win32_UI_TextServices"' --cfg 'feature="Win32_UI_WindowsAndMessaging"' --cfg 'feature="default"' --cfg 'feature="implement"' --cfg 'feature="windows-implement"' -C metadata=ba98931a7ed26849 -C extra-filename=-ba98931a7ed26849 --out-dir /home/gitlab-runner/builds/gsQXRju4G/0/root/rust-po-project/src-tauri/target/x86_64-pc-windows-msvc/release/deps --target x86_64-pc-windows-msvc -C linker=lld -L dependency=/home/gitlab-runner/builds/gsQXRju4G/0/root/rust-po-project/src-tauri/target/x86_64-pc-windows-msvc/release/deps -L dependency=/home/gitlab-runner/builds/gsQXRju4G/0/root/rust-po-project/src-tauri/target/release/deps --extern windows_implement=/home/gitlab-runner/builds/gsQXRju4G/0/root/rust-po-project/src-tauri/target/release/deps/libwindows_implement-da84f97ae4ad4284.so --extern windows_x86_64_msvc=/home/gitlab-runner/builds/gsQXRju4G/0/root/rust-po-project/src-tauri/target/x86_64-pc-windows-msvc/release/deps/libwindows_x86_64_msvc-021083bbf68e77ce.rmeta --cap-lints allow -Lnative=/home/gitlab-runner/.xwin/crt/lib/x86_64 -Lnative=/home/gitlab-runner/.xwin/sdk/lib/um/x86_64 -Lnative=/home/gitlab-runner/.xwin/sdk/lib/ucrt/x86_64 -L native=/home/gitlab-runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/windows_x86_64_msvc-0.39.0/lib` (signal: 9, SIGKILL: kill)
       Error failed to build app: failed to build app```
outer laurel
#

Please share the output of tauri info.

earnest bison
# outer laurel Please share the output of `tauri info`.

[✔] Environment
- OS: Ubuntu 22.04 X64
✔ webkit2gtk-4.0: 2.40.5
✔ rsvg2: 2.52.5
✔ rustc: 1.73.0 (cc66ad468 2023-10-03)
✔ Cargo: 1.73.0 (9c4383fb5 2023-08-26)
✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (environment override by RUSTUP_TOOLCHAIN)

[-] Packages
- tauri-cli [RUST]: 1.5.1

[-] App

#

The initial compile command was cargo tauri build --target x86_64-pc-windows-msvc

outer laurel
#

Ah, you're trying to compile for Windows from Linux?

#

There's a great deal of details missing from that tauri info.

#

Please run it in your project root as we need to know what your lock file is using.

earnest bison
# outer laurel Please run it in your project root as we need to know what your lock file is usi...

[✔] Environment
    - OS: Ubuntu 22.04 X64
    ✔ webkit2gtk-4.0: 2.40.5
    ✔ rsvg2: 2.52.5
    ✔ rustc: 1.72.0 (5680fa18f 2023-08-23)
    ✔ Cargo: 1.72.0 (103a7ff2e 2023-08-15)
    ✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
    ✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (environment override by RUSTUP_TOOLCHAIN)
    - node: 20.5.1
    - yarn: 4.0.0-rc.50
    - npm: 9.8.0

[-] Packages
    - tauri [RUST]: 1.2.4
    - tauri-build [RUST]: 1.2.1
    - wry [RUST]: 0.23.4
    - tao [RUST]: 0.15.8
    - tauri-cli [RUST]: 1.5.1
    - @tauri-apps/api [NPM]: not installed!
    - @tauri-apps/cli [NPM]: 1.5.1

[-] App
    - build-type: bundle
    - CSP:
    - distDir: ../src
    - devPath: ../src```
earnest bison
#

I get the same exit code when I try cargo tauri dev

zealous kindle
#

can you update tauri to the latest versions? the experimental cross platform compilation support was added in 1.3 (i recommend to update to 1.5 of course).

#

well, i may have mixed things up because your error complains about the windows crate, but still, updating is worth a try.

earnest bison
lavish whale
earnest bison
#

I was attempting to at first, but now I'm also having problems updating tauri on my linux server to attempt recompiling on a version that supports it

lavish whale
earnest bison
#

Since I was on 1.2.x

lavish whale
#

that's easier to update

#

I see

#

you are using fully rust stack?

earnest bison
#

As far as I know. My friend put together the project itself. All I know is that we use Rust and Vanilla HTML/JS

lavish whale
#

not that much info I can gather rn

earnest bison
#

I just double checked that every prereq for linux is installed and it still throws an error code of 9

lavish whale
#

This probably happens in your wsl?

#

or linux

earnest bison
#

Full linux

lavish whale
#

try running that with --verbose

earnest bison
#

You'll probably need to download that message to see the whole error 💀

lavish whale
lavish whale
earnest bison
#

My discord shortens it to like 6 lines

#

Odd

lavish whale
#

same here

#

I mean

#

I can still read the full error

earnest bison
#

I ran --verbose for you which is probably why it's 11kb

lavish whale
#

and no reason there

#

that why

zealous kindle
#

yeah, really annoying error. all the internet said is that it's likely due to limited memory but without guarantees - super helpful 🙄

earnest bison
#

We thought that at first when I was trying to fix a different issue so I moved to my server with more RAM

zealous kindle
#

it could still be memory related. I've seen servers being configured to kill processes that use more than XY gb of memory but no idea if that's really a thing still and/or how to configure that stuff

earnest bison
#

It maxes out at maybe 6GB

#

Out of the 8 available

outer laurel
lavish whale
lavish whale
#

Wsl

earnest bison
#

I'll look into it

lavish whale
#

Cuz ito make sure

#

Desktops allocate swap if ram not enough

#

Technically cargo takes about 8gb ram on my pc which has 12gb of installed memory

earnest bison
#

Monitoring the resources with top on another ssh connection, it appears they are not running out of memory for sure

outer laurel
#

Are you still running it with the old tauri and tauri-build packages?

earnest bison
#

No clue. I just ran the cargo tauri build command after running cargo update

outer laurel
#

What does your tauri info look like now?

earnest bison
#

I’ll run it in the morning and post it here

outer laurel
#

If it still says the same as before (tauri [RUST]: 1.2.4) then it's likely you have a ^ or = in your Cargo.toml file. I think the CLI used to generate the file with ^. Removing it should let cargo update move you to Tauri v1.5.1 automatically.

earnest bison
#

I did run cargo tauri —version and it did spit out 1.5.1

outer laurel
#

That's just the CLI.

#

The CLI being way more updated than the actual Rust project can cause issues.

earnest bison
# outer laurel What does your `tauri info` look like now?

[✔] Environment
- OS: Ubuntu 22.04 X64
✔ webkit2gtk-4.0: 2.40.5
✔ rsvg2: 2.52.5
✔ rustc: 1.72.0 (5680fa18f 2023-08-23)
✔ Cargo: 1.72.0 (103a7ff2e 2023-08-15)
✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (environment override by RUSTUP_TOOLCHAIN)
- node: 20.5.1
- yarn: 4.0.0-rc.50
- npm: 9.8.0

[-] Packages
- tauri [RUST]: 1.2.4
- tauri-build [RUST]: 1.2.1
- wry [RUST]: 0.23.4
- tao [RUST]: 0.15.8
- tauri-cli [RUST]: 1.5.1
- @tauri-apps/api [NPM]: not installed!
- @tauri-apps/cli [NPM]: 1.5.1 (outdated, latest: 1.5.2)

[-] App
- build-type: bundle
- CSP:
- distDir: ../src
- devPath: ../src

#

On my local server the only differences are there is no node section and @tauri-apps/cli is 1.5.2 instead of 1.5.1

outer laurel
earnest bison
# outer laurel It looks like you're still stuck on `tauri 1.2.4` and `tauri-build 1.2.1` for so...

Looking at my Cargo.toml it looks like tauri is being forced to 1.3 for some reason ```toml
[package]
name = "testing-code"
version = "0.1.0"
edition = "2021"

See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
wasm-bindgen = "0.2.84"
wkhtmltopdf = "0.4.0"
yew = { version = "0.20.0", features = ["csr"] }
log = "0.4.14"
tauri = "1.3.0"

[target.x86_64-pc-windows-msvc]
linker = "lld"
rustflags = [
"-Lnative=/home/gitlab-runner/.xwin/crt/lib/x86_64",
"-Lnative=/home/username/.xwin/sdk/lib/um/x86_64",
"-Lnative=/home/username/.xwin/sdk/lib/ucrt/x86_64"
]```

#

I'll want to change that to 1.5.1 right

outer laurel
#

That's pretty strange. I also don't see [build-dependencies] in there.

earnest bison
#

Also I am aware that line 15 and below should be in another file. I fixed it and never deleted it from my Cargo.toml

outer laurel
#

Considering your issues with LLD, line 15 and below might be part of the problem.

#

This is all about cross-compiling for Windows from Linux, right?

earnest bison
#

Yep

#

I put those lines in to .cargo/config.toml and fixed the path names

outer laurel
#

Where is the dependency for tauri-build?

#

Should be under [build-dependencies] but I don't see that in your post above.

earnest bison
#

is that something I have to manually add?

outer laurel
#

You shouldn't need to, it should have been there when the project was bootstrapped by create-tauri-app.

earnest bison
#

I removed those lines from my Cargo.toml and it still throws the same lld error

outer laurel
#

Have you added tauri-build and changed tauri to 1.5?

earnest bison
#

yep

outer laurel
#

That's pretty strange then. What does it look like now?

earnest bison
#

Exact same error

outer laurel
#

I meant the Cargo.toml file.

earnest bison
#
[package]
name = "testing-code"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[build-dependencies]
tauri-build = { version = "1.5", features = [] }

[dependencies]
wasm-bindgen = "0.2.84"
wkhtmltopdf = "0.4.0"
yew = { version = "0.20.0", features = ["csr"] }
log = "0.4.14"
tauri = "1.5.0"
outer laurel
#

That should work then. Is this an active project or a minimum reproduction?

earnest bison
#

This is an active project

#

Despite the name

outer laurel
#

Hm... can you try creating a minimum reproduction?

earnest bison
#

how would I do that

outer laurel
earnest bison
outer laurel
#

Are you using the same distro and release on your VPS and your laptop?

earnest bison
#

My laptop is using Ubuntu 22.04.2 LTS and the VPS is using 22.04.3

outer laurel
#

Seems pretty unlikely to be the issue then.

#

Have you installed all the dependencies on the VPS? Do any of them get a 404 response when trying to download? I know that some hosts run their own mirrors that don't always have everything you would expect.

#

If it's not that, check to see the exact error message using the dmesg utility.

earnest bison
#

I reran the command linked and it says 0 upgraded, 0 installed, 3 not upgraded

outer laurel
#

Seems fine then.

#

Just running dmesg will give you everything since you booted the machine.

earnest bison
#

dmesg: read kernel buffer failed: Operation not permitted

#

I'd assume I need to sudo it?

outer laurel
#

Yep.

earnest bison
#

[4670405.594591] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=user.slice,mems_allowed=0,global_oom,task_memcg=/user.slice/user-1000.slice/session-9462.scope,task=rustc,pid=1073897,uid=1000 [4670405.594622] Out of memory: Killed process 1073897 (rustc) total-vm:2797168kB, anon-rss:1988988kB, file-rss:0kB, shmem-rss:0kB, UID:1000 pgtables:4788kB oom_score_adj:0

outer laurel
#

Well, that explains it.

#

You might have to speak to your VPS vendor about the memory constraints.

earnest bison
#

We have 8GB available to us on the plan we are on so it should have no problem in theory

#

I ran sudo swapon --show and the laptop has a much larger swap file. Would increasing that help?

outer laurel
#

It should.

#

According to that error, your process is getting killed while using less than 2 GiB of memory.

#

Which means your VPS must have a 6 GiB overhead or you're getting scammed of something like 4 GiB.

earnest bison
#

@outer laurel that fixed the issue

outer laurel
#

When you run top, does it say that you have around MiB Mem : 8000 total?

#

On the VPS, that is.

earnest bison
outer laurel
#

Seems right. Weird that it used so much memory. I run a VM with the same but a 1 GB swap.

earnest bison
#

Odd

#

I guess it's just linode being linode

outer laurel
#

Yep. Probably to do with the cross-compling overhead since I'm only compiling for Linux at the moment.

lavish whale
#

My rust uses about 8gb ram out of my 12gb I havr

outer laurel
#

It might be scaling itself back. It takes the VM 10 minutes to compile an empty Tauri app.

lavish whale
#

That may be the casr

#

Then my compiling should be faster than yours I guess?

#

Anyways back to the topic