Skip to content

Commit

Permalink
Add support for mtime override to generate and combine rust-insta…
Browse files Browse the repository at this point in the history
…ller commands
  • Loading branch information
Kobzol committed Jun 29, 2024
1 parent c54a2a5 commit e1999f9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/tools/rust-installer/src/combiner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ actor! {
/// The formats used to compress the tarball
#[arg(value_name = "FORMAT", default_value_t)]
compression_formats: CompressionFormats,

/// Modification time that will be set for all files added to the archive.
/// The default is the date of the first Rust commit from 2006.
/// This serves for better reproducibility of the archives.
#[arg(value_name = "FILE_MTIME", default_value_t = 1153704088)]
override_file_mtime: u64,
}
}

Expand Down Expand Up @@ -145,7 +151,8 @@ impl Combiner {
.input(self.package_name)
.output(path_to_str(&output)?.into())
.compression_profile(self.compression_profile)
.compression_formats(self.compression_formats);
.compression_formats(self.compression_formats)
.override_file_mtime(self.override_file_mtime);
tarballer.run()?;

Ok(())
Expand Down
9 changes: 8 additions & 1 deletion src/tools/rust-installer/src/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ actor! {
/// The formats used to compress the tarball
#[arg(value_name = "FORMAT", default_value_t)]
compression_formats: CompressionFormats,

/// Modification time that will be set for all files added to the archive.
/// The default is the date of the first Rust commit from 2006.
/// This serves for better reproducibility of the archives.
#[arg(value_name = "FILE_MTIME", default_value_t = 1153704088)]
override_file_mtime: u64,
}
}

Expand Down Expand Up @@ -114,7 +120,8 @@ impl Generator {
.input(self.package_name)
.output(path_to_str(&output)?.into())
.compression_profile(self.compression_profile)
.compression_formats(self.compression_formats);
.compression_formats(self.compression_formats)
.override_file_mtime(self.override_file_mtime);
tarballer.run()?;

Ok(())
Expand Down

0 comments on commit e1999f9

Please sign in to comment.