Skip to content

Commit

Permalink
utilize rust-installer --prepared-only flag in bootstrap tarball
Browse files Browse the repository at this point in the history
Signed-off-by: onur-ozkan <work@onurozkan.dev>
  • Loading branch information
onur-ozkan committed Dec 7, 2023
1 parent 17b5761 commit 8abfe2b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/bootstrap/src/utils/tarball.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ pub(crate) struct Tarball<'a> {
include_target_in_component_name: bool,
is_preview: bool,
permit_symlinks: bool,
is_prepare_only: bool,
}

impl<'a> Tarball<'a> {
Expand Down Expand Up @@ -148,6 +149,7 @@ impl<'a> Tarball<'a> {
include_target_in_component_name: false,
is_preview: false,
permit_symlinks: false,
is_prepare_only: false,
}
}

Expand All @@ -167,6 +169,10 @@ impl<'a> Tarball<'a> {
self.is_preview = is;
}

pub(crate) fn is_prepare_only(&mut self, is: bool) {
self.is_prepare_only = is;
}

pub(crate) fn permit_symlinks(&mut self, flag: bool) {
self.permit_symlinks = flag;
}
Expand Down Expand Up @@ -301,6 +307,10 @@ impl<'a> Tarball<'a> {
.arg(&self.overlay_dir)
.arg("--output-dir")
.arg(distdir(self.builder));

if self.is_prepare_only {
cmd.arg("--prepare-only");
}
}

fn run(self, build_cli: impl FnOnce(&Tarball<'a>, &mut Command)) -> GeneratedTarball {
Expand Down Expand Up @@ -355,6 +365,7 @@ impl<'a> Tarball<'a> {
path: distdir(self.builder).join(format!("{package_name}.tar.{ext}")),
decompressed_output,
work: self.temp_dir,
component: self.component,
}
}
}
Expand Down

0 comments on commit 8abfe2b

Please sign in to comment.