Skip to content

Commit af00fd2

Browse files
Recompress after pruning
1 parent 3850779 commit af00fd2

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

src/main.rs

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,6 @@ impl Context {
161161
// to do. This represents a scenario where changes have been merged to
162162
// the stable/beta branch but the version bump hasn't happened yet.
163163
self.download_artifacts(&rev)?;
164-
// Generate recompressed artifacts from the input set.
165-
self.recompress(&self.dl_dir())?;
166164
// The bypass_startup_checks condition is after the function call since we need that
167165
// function to run even if we wan to discard its output (it fetches and stores the current
168166
// version we're about to release).
@@ -181,10 +179,22 @@ impl Context {
181179
let build_manifest = BuildManifest::new(self)?;
182180
let smoke_test = SmokeTester::new(&[self.smoke_manifest_dir(), self.dl_dir()])?;
183181

184-
// First of all, the real manifests are generated, pointing to the public download
185-
// endpoint. This will also collect the list of files shipped in the release (used
186-
// later to prune the files we're not shipping) and a cache of all the checksums
187-
// generated by build-manifest.
182+
// This step is just a discovery of unused files so we can prune them prior to
183+
// recompression...
184+
let execution = build_manifest.run(
185+
&format!("{}/{}", self.config.upload_addr, self.config.upload_dir),
186+
&self.real_manifest_dir(),
187+
)?;
188+
189+
// Removes files that we are not shipping from the files we're about to upload.
190+
self.prune_unused_files(&execution.shipped_files)?;
191+
192+
// Generate recompressed artifacts from the input set. This invalidates signatures etc
193+
// produced in the earlier step so we'll need to re-run the manifest building.
194+
self.recompress(&self.dl_dir())?;
195+
196+
// Now generate the real manifests, pointing to the public download endpoint. This will
197+
// also generate a cache of all the checksums generated by build-manifest.
188198
let execution = build_manifest.run(
189199
&format!("{}/{}", self.config.upload_addr, self.config.upload_dir),
190200
&self.real_manifest_dir(),
@@ -197,9 +207,6 @@ impl Context {
197207
&self.smoke_manifest_dir(),
198208
)?;
199209

200-
// Removes files that we are not shipping from the files we're about to upload.
201-
self.prune_unused_files(&execution.shipped_files)?;
202-
203210
// Sign both the downloaded artifacts and all the generated manifests. The signatures
204211
// of the downloaded files and the real manifests are permanent, while the signatures
205212
// for the smoke test manifests will be discarded later.

0 commit comments

Comments
 (0)