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

PHD: allow patched Crucible dependencies #778

Merged
merged 4 commits into from
Oct 3, 2024
Merged

Commits on Oct 2, 2024

  1. PHD: allow patched Crucible dependencies

    `phd-runner` uses the dependency on Crucible specified in the
    workspace's Cargo.toml to determine which downstairs artifact to
    download from Buildomat. This only works when the Crucible dependency is
    a Git dep on the `oxidecomputer/crucible` GitHub repo. In some cases,
    developers may patch Crucible to a local checkout or a different
    repository, such as for testing changes that haven't been merged to
    `oxidecomputer/crucible`. Unfortunately, the phd-runner build script
    fails in this case, which makes running any PHD tests impossible.
    
    This is unfortunate. PHD tests _can_ still be run when the Crucible
    dependency is patched, either by disabling the Crucible-based tests, or
    by manually providing a Crucible downstairs binary path. However,
    because the build script fails in this case, it's impossible to build
    `phd-runner`, which sucks. Instead, we should allow the build to succeed
    and just disable the `--crucible-downstairs-commit auto` CLI option when
    the dependency isn't pointed at the Crucible GitHub repo.
    
    This commit does that. Now, we just log a warning and set the env var to
    a sentinel value that means we couldn't determine the SHA for auto mode.
    The `phd-runner` binary will then exit with an error if
    `--crucible-downstairs-commit auto` is selected when compiled without a
    known Git SHA.
    
    To test this, I patched Crucible with a local checkout:
    
    ```toml
    [patch."https://github.com/oxidecomputer/crucible"]
    crucible = { path = "../crucible/upstairs" }
    crucible-client-types = { path = "../crucible/crucible-client-types" }
    ```
    
    Running `cargo build -p phd-runner` now succeeds:
    
    ```console
    eliza@theseus ~/Code/oxide/propolis $ cargo build -p phd-runner
         Locking 4 packages to latest compatible versions
          Adding crucible v0.0.1 (/home/eliza/Code/oxide/crucible/upstairs)
          Adding crucible-client-types v0.1.0 (/home/eliza/Code/oxide/crucible/crucible-client-types)
          Adding crucible-common v0.0.1 (/home/eliza/Code/oxide/crucible/common)
          Adding crucible-protocol v0.0.0 (/home/eliza/Code/oxide/crucible/protocol)
       Compiling propolis-client v0.1.0 (/home/eliza/Code/oxide/propolis/lib/propolis-client)
       Compiling phd-runner v0.1.0 (/home/eliza/Code/oxide/propolis/phd-tests/runner)
    warning: phd-runner@0.1.0: Crucible upstairs dependency is not pointed at the https://github.com/oxidecomputer/crucible repository, so this phd-runner build not be able to automatically determine the Crucible commit to download from Buildomat: Crucible dependency is patched with a local checkout
       Compiling phd-framework v0.1.0 (/home/eliza/Code/oxide/propolis/phd-tests/framework)
       Compiling phd-testcase v0.1.0 (/home/eliza/Code/oxide/propolis/phd-tests/testcase)
       Compiling phd-tests v0.1.0 (/home/eliza/Code/oxide/propolis/phd-tests/tests)
        Finished `dev` profile [unoptimized + debuginfo] target(s) in 11.63s
    ```
    
    Fixes #770
    hawkw committed Oct 2, 2024
    Configuration menu
    Copy the full SHA
    5ded14d View commit details
    Browse the repository at this point in the history
  2. cleanup warning

    hawkw committed Oct 2, 2024
    Configuration menu
    Copy the full SHA
    d03db31 View commit details
    Browse the repository at this point in the history
  3. nicer error message

    hawkw committed Oct 2, 2024
    Configuration menu
    Copy the full SHA
    cc2ecf0 View commit details
    Browse the repository at this point in the history
  4. s/command/cmd

    hawkw committed Oct 2, 2024
    Configuration menu
    Copy the full SHA
    ae8b61e View commit details
    Browse the repository at this point in the history