GithubHelp home page GithubHelp logo

Comments (6)

Radvendii avatar Radvendii commented on June 15, 2024 1

Yeah, that seems good. I should say that I wasn't using this directly, I was using github.com/divnix/digga, which called the function. So maybe this problem should be resolved there.

I guess it should at least be documented that this cannot be called on an arbitrary overlay.

from flake-utils-plus.

Radvendii avatar Radvendii commented on June 15, 2024

That code also assumes overlays is a set. overlays is also allowed to be a list, right?

from flake-utils-plus.

Pacman99 avatar Pacman99 commented on June 15, 2024

Yeah the code very much relies on the lazy eval of overlays. I'm not really sure how to get around that for a function that needs to know the names of the packages the overlay creates.

That code also assumes overlays is a set. overlays is also allowed to be a list, right?

I don't think thats true for the overlays flake output.

from flake-utils-plus.

gytis-ivaskevicius avatar gytis-ivaskevicius commented on June 15, 2024

I can't think of an actual solution to overlays evaluation issue, do you have anything in mind in terms of a fix? I doubt that it is even possible :/
But by looking at your provided example wouldn't something like this fix your particular issue?

    nixpkgs.lib.genAttrs # nixpkgs instead of prev
      (builtins.readDir ./packages) 
      (pkgName: _: prev.callPackage ./packages + "/${pkgName}");

Also as far as I know overlays must evaluate to a set

from flake-utils-plus.

Radvendii avatar Radvendii commented on June 15, 2024

I don't think thats true for the overlays flake output.

Ah, okay. I stand corrected then.

I can't think of an actual solution to overlays evaluation issue, do you have anything in mind in terms of a fix? I doubt that it is even possible :/

It may not be possible to find a fix. It's a rather nasty surprise though, if someone makes a valid overlay, and someone else includes it in their config, and it breaks because flake-utils-plus is making assumptions about the structure of that overlay. How essential is knowing the names of the packages? Is it something we can take out? Is there a way to catch the error somehow and just ignore the packages for that overlay?

from flake-utils-plus.

gytis-ivaskevicius avatar gytis-ivaskevicius commented on June 15, 2024

Okay so first of all it breaks overlays exporter, not everything. a possible workaround is to use builtins.removeAttrs function to keep it from crashing.

One of the ideas I thought of just now is to use builtins.tryEval function as a try/catch. Basically idea is to ignore overlay if evaluation fails

from flake-utils-plus.

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.