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

flake.nix: add openroad-release attrubute #6004

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fedeinthemix
Copy link

The current flake.nix openroad attribute can't be imported into other flakes for consumption nor used to install openroad. This is due to a limitation in nix that doesn't fetch submodules (with the exception of self with '.?submodules=1'). Due to this limitation, peoples using nix wanting to install openroad have to

  1. clone the OpenROAD repository with git
  2. use nix to build or install openroad from the git clone using a special undocumented flag.

Step 2. copies the git source code in the nix store ending up with two copies of a large repo on disk.

To remedy this we propose to add a second attribute openroad-release using fetchFromGitHub which is capable to retrieve submodules and pointing to a git commit (tag) known to work. (I tried to compile HEAD with the nix flake without success.)

@donn

@maliberty maliberty requested a review from donn October 23, 2024 14:12
@maliberty
Copy link
Member

Commits need to be signed with 'git commit -s' Please see the details link by DCO for how to fix it.

@donn I have no opinion on this as it is just for OL usage.

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

@donn donn left a comment

Choose a reason for hiding this comment

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

Overall looks okay. We don't use this flake though, it is purely convenience for developing in Nix environments (i.e. me working on OpenROAD), for the OpenLanes we build OpenROAD out-of-tree, with submodules factored out and built standalone (+ some seds to support that): https://github.com/efabless/openlane2/blob/1bfa43d34dcab6f859bb699b182948eda91884e2/nix/openroad.nix

The reason is having this entire repository be a flake is a download in the order of hundreds of megabytes during Nix evaluation time, which slows things down. Additionally, a recursive fetchFromGitHub on this repo is a download of a couple gigabytes in addition to that. Nevertheless, this is strictly more useful in some scenarios than the status quo so I'd still merge it with those minor tweaks.

flake.nix Outdated Show resolved Hide resolved
flake.nix Outdated Show resolved Hide resolved
fetchSubmodules = true;
sha256 = "sha256-Ye9XJcoUxtg031eazT4qrexvyN0jZHd8/kmvAr/lPzk=";
};
});
default = all.openroad;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think default should be openroad-release because it'd actually work with nix run/etc… @widlarizer thoughts?

Copy link
Author

Choose a reason for hiding this comment

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

I didn't change the default because I didn't want to disrupt anybody's flow, but I agree that it would make sense. In any case it's still possible to use all nix commands by adding #openroad-release.

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

Successfully merging this pull request may close these issues.

3 participants