Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
pkgs.python3Packages.pyyaml
pkgs.python3Packages.yamlfix
];
OPENROAD_EXE = "${openroad.packages.${system}.default}/bin/openroad";
OPENSTA_EXE = "${openroad.packages.${system}.default}/bin/sta";
YOSYS_EXE = "${yosys.packages.${system}.default}/bin/yosys";
PYTHON_EXE = "${pkgs.python3}/bin/python3";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To make the build truly environment-agnostic (as mentioned in the PR description), it is highly recommended to use pkgs.python3.withPackages to create a self-contained Python environment.

Using ${pkgs.python3}/bin/python3 relies on the shell's PYTHONPATH environment variable to locate dependencies like pandas, numpy, etc. If PYTHON_EXE is invoked in a context where PYTHONPATH is cleared or not fully propagated, execution will fail. Wrapping the interpreter ensures all required dependencies are always available to PYTHON_EXE directly.

        PYTHON_EXE   = let
          pythonEnv = pkgs.python3.withPackages (ps: with ps; [
            pandas
            numpy
            firebase-admin
            click
            pyyaml
            yamlfix
          ]);
        in "${pythonEnv}/bin/python3";

};
}
);
Expand Down
Loading