Skip to content
Open
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
34 changes: 16 additions & 18 deletions dev-tools/releng/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ const TUF_PACKAGES: [&PackageName; 12] = [
&PackageName::new_const("probe"),
];

const HELIOS_REPO: &str = "https://pkg.oxide.computer/helios/2/dev/";
const HELIOS_PKGREPO: &str = "https://pkg.oxide.computer/helios/2/dev/";
const HELIOS_REPO: &str = "https://github.com/oxidecomputer/helios.git";

static WORKSPACE_DIR: LazyLock<Utf8PathBuf> = LazyLock::new(|| {
// $CARGO_MANIFEST_DIR is at `.../omicron/dev-tools/releng`
Expand Down Expand Up @@ -323,22 +324,19 @@ async fn main() -> Result<()> {
}
} else {
// check that our helios clone is up to date
Command::new(&args.git_bin)
.arg("-C")
.arg(&args.helios_dir)
// HEAD in a remote repository refers to the default
// branch, even if the default branch is renamed.
// `--no-write-fetch-head` avoids modifying FETCH_HEAD.
.args(["fetch", "--no-write-fetch-head", "origin", "HEAD"])
.ensure_success(&logger)
let stdout = Command::new(&args.git_bin)
.args(["ls-remote", "--exit-code", HELIOS_REPO, "HEAD"])
.ensure_stdout(&logger)
.await?;
let upstream_commit = git_resolve_commit(
&args.git_bin,
&args.helios_dir,
"origin/HEAD",
&logger,
)
.await?;
let upstream_commit = stdout
.lines()
.find_map(|line| match line.split_once('\t') {
Some((commit, "HEAD")) => Some(commit),
_ => None,
})
.with_context(|| {
format!("remote {HELIOS_REPO} did not list HEAD")
})?;
if helios_commit != upstream_commit {
error!(
logger,
Expand All @@ -355,7 +353,7 @@ async fn main() -> Result<()> {
} else {
info!(logger, "cloning helios to {}", args.helios_dir);
Command::new(&args.git_bin)
.args(["clone", "https://github.com/oxidecomputer/helios.git"])
.args(["clone", HELIOS_REPO])
.arg(&args.helios_dir)
.ensure_success(&logger)
.await?;
Expand Down Expand Up @@ -674,7 +672,7 @@ async fn main() -> Result<()> {
if !args.helios_local {
image_cmd = image_cmd
.arg("-p") // use an external package repository
.arg(format!("helios-dev={HELIOS_REPO}"))
.arg(format!("helios-dev={HELIOS_PKGREPO}"))
}

// helios-build experiment-image
Expand Down
Loading