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

mutual with-imports don't work #2

Open
fogti opened this issue Jan 12, 2022 · 1 comment
Open

mutual with-imports don't work #2

fogti opened this issue Jan 12, 2022 · 1 comment

Comments

@fogti
Copy link
Member

fogti commented Jan 12, 2022

This is an issue with the nixpkgs/lib/systems/{inspect,parse}.nix files, which mutually include themselves, and use nested with expressions, which makes static analysis about which free variables belong to which scope mostly impossible.

{ lib }:
with import ./parse.nix { inherit lib; };
with lib.attrsets;
with lib.lists;
{ lib }:
with lib.lists;
with lib.types;
with lib.attrsets;
with lib.strings;
with (import ./inspect.nix { inherit lib; }).predicates;
@fogti
Copy link
Member Author

fogti commented Sep 27, 2022

yeah, static scope lookups were easy (e.g. inherit (y) x; were translated in JS let x = y.x and such), but I had no idea where exactly to put with handling. I probably need to keep an explicit list of static identifiers while transpiling, to omit them from dynamic lookups, which should hopefully fix most of the issue...

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

1 participant