Giter Club home page Giter Club logo

Comments (8)

yusdacra avatar yusdacra commented on July 24, 2024 1

I think this is because dream2nix uses the path dependency source, not the workspace source (eg. it uses ${src}/crates/grep and not ${src}), which means other path dependencies won't be available. It also means that cargo won't be able to access the Cargo.lock, so even if a path dep had no other path deps, it won't build because of that. Adding a getSourceRoot function like described in #83 would fix this.

from dream2nix.

yusdacra avatar yusdacra commented on July 24, 2024 1

crane will install lib outputs, if there are any. I'm not sure if buildRustPackage does that. These packages don't really have any lib outputs, so nothing is installed.

For example nix-cargo-integration works around these by just disabling all outputs for crates default, and makes you add a metadata value to the package Cargo.toml for enabling outputs for that crate.

But for dream2nix I would say it's better if all packages are outputted by default, for exposure, and then the user should be able to disable them. It seems rather opinionated to not expose packages because of this, which IMO is better expressed with higher abstraction layers. For example, there could be a use case where a crate has no outputs, but it's build.rs will build something and put it in target. This wouldn't be installed by crane or buildRustPackage. I think not exposing that would make the user more confused, because first they'd need to expose that, and then find out their output wasn't installed, as opposed to just finding out their output wasn't installed.

from dream2nix.

yusdacra avatar yusdacra commented on July 24, 2024

I fixed this on #83.

from dream2nix.

yusdacra avatar yusdacra commented on July 24, 2024

This should be fixed by #83 being merged.

from dream2nix.

DavHau avatar DavHau commented on July 24, 2024

OK, I checked again and all packages build now. Though all of which I tried don't produce any output (empty ./result).
If I switch to the crane builder, all packages result in ./result/bin/rg.

from dream2nix.

DavHau avatar DavHau commented on July 24, 2024

I guess these are all library packages. Does it even make sense to export them? Maybe we should not.

from dream2nix.

yusdacra avatar yusdacra commented on July 24, 2024

They are library packages, so it may not make sense to export them, unless if the user specifically specifies it to be a dynamic library or whatever.

Though IMO this should be left up to the user, so they can just modify the postInstall hook to add anything else they want. They should also be able to filter these packages from the output. Maybe it could be useful to add some arguments to makeFlakeOutputs for this. Eg. exposePackages that takes a list of strings and makes dream2nix only expose the specified packages.

The crane behaviour sounds a bit weird, it's not supposed to build ripgrep on the library packages. I think that is due to crane passing the --workspace flag by default. Will see about overriding the commands for the main derivation so that it is not passed.

from dream2nix.

DavHau avatar DavHau commented on July 24, 2024

Though IMO this should be left up to the user, so they can just modify the postInstall hook to add anything else they want.

I'm not quite sure yet about how a use case for this would look like. Let's say someone would want to make a package that should depend upon libraries built with rust, then they would declare the library outputs coming from dream2nix as an input to their derivation, right?

But the result of our build is currently empty. If we want to support that use case then our derivation should have a result/lib a lib output that can be built.

Right now I feel we should probably either provide these lib outputs or not export these derivations.

from dream2nix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.