trunk icon indicating copy to clipboard operation
trunk copied to clipboard

"no rust project found" in Gitlab Pages CI

Open Waridley opened this issue 2 years ago • 7 comments

I'm trying to deploy a game jam project to Gitlab Pages using Trunk, but no matter what I do it only copies the assets folder and index.html, and doesn't build the Rust project.

Here's an example job log: https://gitlab.com/Waridley/pac-ghoul/-/jobs/5198168518

I'm not sure if it's related to the fact that the rust project is not in the root of the repository, but in the rs folder. However, it is finding Trunk.toml just fine in the same folder.

Waridley avatar Sep 30 '23 21:09 Waridley

@Waridley Hi! I ran into the same problem. It has a very trivial solution. You need to move your index.html file to the same level as Cargo.toml. This is because in the current version (0.17.5) trunk does the following to find the project path: let path = html_dir.join("Cargo.toml"); image

KiritoMC03 avatar Oct 14 '23 20:10 KiritoMC03

@Waridley Hi! I ran into the same problem. It has a very trivial solution. You need to move your index.html file to the same level as Cargo.toml.

Mine is, though. I even added an ls to the CI to verify that it could see all of the files. They are in the rs folder, so not the root of the repo, but all in the same folder: Screenshot_20231014-152201.png

Waridley avatar Oct 14 '23 20:10 Waridley

Not sure about the exact layout of your project, but there's a way to influence this lookup: https://trunkrs.dev/assets/#rust

ctron avatar Oct 19 '23 09:10 ctron

In my case, let metadata = match spawn_blocking(move || cmd.exec()) failed because CARGO env variable was not set up, maybe that helps.

adrianncovaci avatar Nov 02 '23 08:11 adrianncovaci

In my case, I added <link data-trunk rel="rust" href="/Cargo.toml" />; it moved on to another issue (failed to open the cargo registry index). I eventually switched to running it as root to solve the latter.

pedroapero avatar Nov 04 '23 19:11 pedroapero

In my case, I added <link data-trunk rel="rust" href="/Cargo.toml" />; it moved on to another issue (failed to open the cargo registry index). I eventually switched to running it as root to solve the latter.

That worked, thank you.

Of course it would still be nice to know the root cause and prevent this from happening to others if possible.

Waridley avatar Nov 08 '23 03:11 Waridley

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Dec 09 '23 00:12 github-actions[bot]