Fix nix develop invocation for verification scripts - #305
Merged
Conversation
run_script() launches the DRC/LVS scripts with
nix develop --command <script>
from a working directory of OPTS.openram_temp. nix develop resolves its
flake from the working directory, and the temp directory has no
flake.nix, so the command fails before the script ever runs:
path '/tmp/openram_<user>_<pid>_temp' does not contain a 'flake.nix', searching up
error: could not find a flake.nix file
Nothing is written to the report file, so verification then dies on the
missing output rather than on the nix error itself, which makes this
confusing to diagnose:
ERROR: file magic.py: Unable to load LVS results from
/tmp/openram_<user>_<pid>_temp/<name>.lvs.report
FileNotFoundError: [Errno 2] No such file or directory
Name the flake explicitly so it is resolved from the repository while
the script still runs in the temp directory, which the scripts depend on
for their relative copies.
Verified on a sky130 build with use_nix = True: before the change no
report is produced and the run asserts, after it both DRC and LVS run
through the devShell and write their reports.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #295 together with PR #304 .
Problem
run_script()launches the DRC/LVS scripts through the Nix devShell:nix developresolves its flake from the working directory, but the working directory here isOPTS.openram_temp, which contains noflake.nix. The error lands in the script's.errfile:The script never runs, so no report is written, and verification fails on the missing file rather than on the nix error. That is what #295 reports:
Depending on which check runs first the same cause can also surface at the DRC stage as
Unable to find the total error line in Magic output.Change
Name the flake explicitly, so it is resolved from the repository while the script still runs with its working directory in the temp dir — which
run_drc.shrelies on for its relativecpof the cell library.OPENRAM_HOMEis guaranteed to be set here —__init__.pyputs it inos.environduring setup, andinstall_nix()already derives the flake location the same way.Verification
sky130 build with
use_nix = True(magic 8.3.568, netgen 1.5.323):could not find a flake.nix filein the.errfile, no report produced, run assertsThe workaround until this lands is
use_nix = Falsein the config, which uses whatever tools are onPATH.