-
Notifications
You must be signed in to change notification settings - Fork 257
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
0.21 fails to build workspace project from crate root: "could not find the root package" #909
Comments
I experimented with some options a bit and it looks like :; ~/.cargo/bin/trunk build --config=src/foo-ui/Trunk.toml ./src/foo-ui/index.html
2024-11-08T17:49:07.855806Z INFO 🚀 Starting trunk 0.21.4
2024-11-08T17:49:07.861348Z ERROR error getting the canonical path to the build target HTML file "/Users/asf/Hacks/foo/src/foo-ui/./src/foo-ui/index.html"
2024-11-08T17:49:07.861529Z INFO 1: No such file or directory (os error 2) but: :; ~/.cargo/bin/trunk build --config=src/foo-ui/Trunk.toml ./src/foo-ui/index.html
2024-11-08T17:49:07.855806Z INFO 🚀 Starting trunk 0.21.4
2024-11-08T17:51:17.755288Z INFO 📦 starting build
2024-11-08T17:51:17.761751Z INFO spawned hook yarn command_arguments=["install"]
2024-11-08T17:51:17.761762Z INFO spawning hook stage=PreBuild command=yarn
yarn install v1.22.22
[1/4] 🔍 Resolving packages...
success Already up-to-date.
✨ Done in 0.03s.
2024-11-08T17:51:17.902947Z INFO finished hook yarn
Compiling proc-macro2 v1.0.82
Compiling wasm-bindgen-shared v0.2.93
[...success!] So it sounds like trunk is looking for the HTML file relative to the config option's directory, rather than relative to the directory where trunk was invoked... if the index file is a relative pathname, because passing an absolute pathname works: :; ~/.cargo/bin/trunk build --config=src/foo-ui/Trunk.toml `pwd`/src/foo-ui/index.html
2024-11-08T17:49:07.855806Z INFO 🚀 Starting trunk 0.21.4
2024-11-08T17:51:17.755288Z INFO 📦 starting build
2024-11-08T17:56:35.660576Z INFO spawned hook yarn command_arguments=["install"]
2024-11-08T17:56:35.660597Z INFO spawning hook stage=PreBuild command=yarn
2024-11-08T17:56:35.661358Z ERROR ❌ error
error from build pipeline
Caused by:
0: error spawning hook call for yarn
1: No such file or directory (os error 2)
[...failure, but because the yarn command runs in the workspace root instead of the src/foo-ui now?!] That's really confusing /: |
Having the same problem |
So yes, the |
Trunk 0.20 managed to build my workspace project's wasm project from the workspace root, using the following command line:
trunk build ./src/foo-ui/index.html
. Now, on trunk 0.21.4, that results in the following error:I notice that trunk isn't searching for a Trunk.toml (and Cargo.tom) relative to the index.html file provided - only the current directory. Is there a way to make it search there again? The build process I'm using doesn't make it easy to invoke trunk from a subdirectory.
The text was updated successfully, but these errors were encountered: