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

runInLinuxVM: refactor structuredAttrs support, fix disko #360413

Merged
merged 6 commits into from
Nov 30, 2024

Commits on Nov 30, 2024

  1. Configuration menu
    Copy the full SHA
    de7867c View commit details
    Browse the repository at this point in the history
  2. runInLinuxVM: clean up

    Those were left-over after 97ed6b4.
    
    This also cleans up some confusion around TMPDIR. We had the following
    lines:
    
      mkdir xchg
      ...
      cd $TMPDIR
      ...
      path=$TMPDIR/xchg
    
    Those only worked because the **current directory** is the same as
    $TMPDIR. Both are /build by default. To refer to the same directory in
    two different ways is very confusing at best.
    wolfgangwalther committed Nov 30, 2024
    Configuration menu
    Copy the full SHA
    3952f87 View commit details
    Browse the repository at this point in the history
  3. runInLinuxVM: minimize saved-env

    The export to saved-env was very intentionally done at the very
    beginning of vmRunCommand, even jumping through extra hoops just to
    avoid the PATH variable from polluting the saved variable.
    
    In 26eba25 we loaded stdenv in the
    wrong place, we should do it after saving the previous environment. This
    is also more consistent with the order of how we load those values back
    in stage2Init.
    wolfgangwalther committed Nov 30, 2024
    Configuration menu
    Copy the full SHA
    9f6b99e View commit details
    Browse the repository at this point in the history
  4. runInLinuxVM: load stdenv/setup with fixed environment in stage2Init

    In [1] we started sourcing stdenv/setup in stage2Init to allow for
    structuredAttrs. We failed to take the changed NIX_BUILD_TOP etc.
    variables into account. We need to load stdenv/setup after changing
    them, because the structuredAttrs startup code makes use of it.
    
    [1]: 97ed6b4
    wolfgangwalther committed Nov 30, 2024
    Configuration menu
    Copy the full SHA
    437e6db View commit details
    Browse the repository at this point in the history
  5. runInLinuxVM: refactor vmRunCommand

    This makes it simpler to copy more files to xchg for the structuredAttrs
    case in the next commit.
    wolfgangwalther committed Nov 30, 2024
    Configuration menu
    Copy the full SHA
    58570e7 View commit details
    Browse the repository at this point in the history
  6. runInLinuxVM: pass .attrs.sh explicitly instead of whole /build direc…

    …tory
    
    The approach taken in [1] breaks down as soon as vmRunCommand is
    manually called with an overriden TMPDIR, like disko does it. /build
    will just not be available.
    
    By moving the .attrs.sh file into the xchg folder explicitly, we can all
    the "exchange infrastructure" the same as before, thus avoid more
    breakage.
    
    This reverts some parts of [1].
    
    [1]: 97ed6b4
    wolfgangwalther committed Nov 30, 2024
    Configuration menu
    Copy the full SHA
    d2593f0 View commit details
    Browse the repository at this point in the history