Skip to content
Merged
Show file tree
Hide file tree
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
22 changes: 15 additions & 7 deletions kernel-builder/src/upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,23 @@ pub fn run_upload(args: UploadArgs) -> Result<()> {
let kernel_dir = fs::canonicalize(&kernel_dir)
.wrap_err_with(|| format!("Cannot resolve kernel directory `{}`", kernel_dir.display()))?;

let build = parse_build(&kernel_dir)?;
let arg_repo_id = match args.repo_id {
Some(id) => id,
None => build
.repo_id()
.ok_or_else(|| {
eyre::eyre!("No `general.hub.repo-id` in build.toml. Use --repo-id to specify it.")
})?
.to_owned(),
None =>
// WARN: parsing must not be moved out of this branch, we want users
// to be able to upload without `build.toml` as long as they
// provide a repo id.
{
parse_build(&kernel_dir)
.context("--repo-id is not provided and cannot parse build.toml.")?
.repo_id()
.ok_or_else(|| {
eyre::eyre!(
"No `general.hub.repo-id` in build.toml. Use --repo-id to specify it."
)
})?
.to_owned()
}
};

let (build_dir, variants) = discover_variants(&kernel_dir)?;
Expand Down
2 changes: 1 addition & 1 deletion nix-builder/lib/gen-flake-outputs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ in
# However, we do not want this command to error out in that case, so
# only insert the upload command when there is something to upload.
uploadStr = lib.optionalString (applicableBuildSets != [ ]) ''
${pkgs.python3.pkgs.kernels}/bin/kernels upload --repo-id ${repo_id} ${branchOpt} ${bundle}
${pkgs.kernel-builder}/bin/kernel-builder upload --repo-id ${repo_id} ${branchOpt} ${bundle}
'';
in
writeScriptBin "build-and-upload" ''
Expand Down
Loading