You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! when trying to build a docker image, I'm running into this issue where when I run cargo cog build, the path to my root package is resolving incorrectly.
And then I'm running the build command (RUST_BACKTRACE=1 cargo cog build -t matchmaker-service-image) in the matchmaker (root) directory.
My root toml file looks like below:
# matchmaker/Cargo.toml
[package]
edition = "2021"
name = "matchmaker"
version = "0.0.11"
authors = ["<...>"]
[package.metadata.cog]
image = "matchmaker-service-image" # optional, defaults to `cog-[package.name]`
[workspace]
members = [".", "server", "matchmaker-js", "test_utils"]
default-members = ["."]
[dependencies]
bytemuck = { version = "1.13.1", features = ["derive"] }
chef = "0.1.0"
cog-rust = "1.0.14"
env_logger = "0.10.0"
futures = "0.3.28"
futures-intrusive = "0.5.0"
handlebars = "4.3.7"
lazy_static = "1.4.0"
log = "0.4.19"
rayon = "1.7.0"
regex = "1.9.1"
serde_json = "1.0.103"
tokio = { version = "1.29.1", features = ["rt", "rt-multi-thread", "macros"] }
wgpu = "0.17.0"
[dev-dependencies]
criterion = { version = "0.5.1", features = ["async_tokio", "html_reports"] }
test_utils = { path = "./test_utils" }
[profile.release]
lto = true
[[bench]]
name="compatibility"
harness=false
[[bench]]
name="matching"
harness=false
Based on the error output, it seems like the matchmaker package is resolving to src/matchmaker/Cargo.toml instead of the intended src/Cargo.toml.
...
=> ERROR [builder 5/7] RUN cargo chef cook --release --bin matchmaker 0.7s
------
> [builder 5/7] RUN cargo chef cook --release --bin matchmaker:
0.637 error: failed to load manifest for workspace member `/src/matchmaker`
0.637
0.637 Caused by:
0.637 failed to read `/src/matchmaker/Cargo.toml`
0.637
0.637 Caused by:
0.637 No such file or directory (os error 2)
0.639 thread 'main' panicked at 'Exited with status code: 101', /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-chef-0.1.62/src/recipe.rs:204:27
0.639 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
------
Dockerfile:12
--------------------
10 | RUN curl -L --proto '=https' --tlsv1.2 -sSf "https://github.com/cargo-bins/cargo-quickinstall/releases/download/cargo-deb-1.44.0/cargo-deb-1.44.0-x86_64-unknown-linux-gnu.tar.gz" | tar -xzvvf - -C /usr/local/cargo/bin
11 | COPY --from=planner /src/recipe.json recipe.json
12 | >>> RUN cargo chef cook --release --bin matchmaker
13 | COPY . .
14 | RUN cargo deb --output /src/target/matchmaker.deb
--------------------
ERROR: failed to solve: process "/bin/sh -c cargo chef cook --release --bin matchmaker" did not complete successfully: exit code: 101
thread 'main' panicked at 'Failed to build docker image.', /home/ubuntu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-cog-1.0.9/src/docker/builder.rs:239:9
...
I began to wonder if I'm referencing the root package wrong as a dependency, but even in my child packages, I refer to the matchmaker package as a dependency using the relative path: ".."
New to rust and even newer to cog-rust, so very possible I missed specifying the appropriate key or field in the manifest. Any thoughts or help would be super appreciated :)
The text was updated successfully, but these errors were encountered:
nathankg
changed the title
cargo cog build error finding root toml file.
build error in finding root toml file.
Aug 16, 2023
Hi! when trying to build a docker image, I'm running into this issue where when I run cargo cog build, the path to my root package is resolving incorrectly.
I have the following file structure:
And then I'm running the build command (
RUST_BACKTRACE=1 cargo cog build -t matchmaker-service-image
) in the matchmaker (root) directory.My root toml file looks like below:
Based on the error output, it seems like the matchmaker package is resolving to
src/matchmaker/Cargo.toml
instead of the intendedsrc/Cargo.toml
.I began to wonder if I'm referencing the root package wrong as a dependency, but even in my child packages, I refer to the matchmaker package as a dependency using the relative path: ".."
e.g.
New to rust and even newer to cog-rust, so very possible I missed specifying the appropriate key or field in the manifest. Any thoughts or help would be super appreciated :)
The text was updated successfully, but these errors were encountered: