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

Git dependencies with workspaces are not supported #14

Open
jbaum98 opened this issue Feb 1, 2023 · 1 comment
Open

Git dependencies with workspaces are not supported #14

jbaum98 opened this issue Feb 1, 2023 · 1 comment

Comments

@jbaum98
Copy link
Contributor

jbaum98 commented Feb 1, 2023

If you try to build a project that uses dependencies from a git repository, and that git repository contains multiple crates using a Cargo workspace, you

You can reproduce this error using a repository I made for this purpose that just contains a workspace with two dummy libraries.

cargo new --bin nocargo-workspace-issue
echo 'lib1 = { git = "https://git.sr.ht/~jakewaksbaum/nocargo-workspace-issue-example" }' >> Cargo.toml
echo 'lib2 = { git = "https://git.sr.ht/~jakewaksbaum/nocargo-workspace-issue-example" }' >> Cargo.toml
nix run github:oxalica/nocargo init
git add .
nix build

This fails with an error:

error: 'mkPkgInfoFromCargoToml' at /nix/store/ppzn93hsjjq8nnif26s7w2a2zj8m8wa6-source/lib/pkg-info.nix:163:28 called without required argument 'package'

       at /nix/store/ppzn93hsjjq8nnif26s7w2a2zj8m8wa6-source/lib/support.nix:118:9:

          117|       gitSrcInfos = mapAttrs (url: src:
          118|         mkPkgInfoFromCargoToml (fromTOML (readFile (src + "/Cargo.toml")) // lockVersionSet) src
             |         ^
          119|       ) gitSrcs;
(use '--show-trace' to show detailed location information)

I think this issue could be fixed by adapting the logic used for reading the Cargo.toml of the project we're building, since that handles workspaces fine.

@YuhanunCitgez
Copy link

Same thing here, any way you could give us some guidance into how to commit a fix for this? @oxalica I'd be glad to help, but need some "onboarding" ig :P

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

No branches or pull requests

2 participants