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

[patch.crates-io] with local crate fails #154

Open
pJunger opened this issue Jun 19, 2024 · 3 comments
Open

[patch.crates-io] with local crate fails #154

pJunger opened this issue Jun 19, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@pJunger
Copy link

pJunger commented Jun 19, 2024

Patching the simple-workspace example to replace a crates dependency with an local crate leads to problems when building the dependencies.

Content of the build directory:

nix-build-my-crate-deps-0.1.0.drv-0
├── env-vars
├── nix-vendor
│   ├── hermit-abi-0.3.9
│   │   ├── ...
│   └── num_cpus-1.16.0    # has dependency to libc
│       ├── ...
└── simple-workspace
    ├── Cargo.lock
    ├── Cargo.toml
    ├── libc    # is found by nix but is empty
    │   ├── Cargo.toml
    │   └── src
    │       ├── bin    # dummy main.rs
    │       └── lib.rs    # dummy
    ├── my-crate
    │   ├── ...
    ├── my-other-crate
    │   ├── ...
    └── target
        ├── ...

Is there any way to fix the dependency chain? Excluding the crate from the workspace does not change anything, it still seems to show up as empty in the simple-workspace directory instead of the nix-vendor directory.

@pJunger pJunger changed the title patch.crates-io with local workspace crate fails [patch.crates-io] with local crate fails Jun 19, 2024
@yusdacra yusdacra added the bug Something isn't working label Jun 23, 2024
@yusdacra
Copy link
Owner

Can you verify if this happens with the latest version of https://github.com/ipetkov/crane ? I'm guessing it works fine there, and it's that dream2nix currently just uses an old version of crane (v0.15.0 to be exact) and that's why this doesn't work.

@pJunger
Copy link
Author

pJunger commented Jun 24, 2024

Had to adapt the interface (for mkDummySrc & writeTOML starting with v0.16.1), but the same error occurs with newer versions.

@yusdacra
Copy link
Owner

We just discard any path crates here https://github.com/nix-community/dream2nix/blob/main/modules/dream2nix/rust-crane/vendor.nix#L116 while vendoring so that maybe the reason. Probably have to cross check with patch.crates-io and allow vendoring for it if it does exist there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants