Label more build steps.

Currently the output of a command like `./x.py build --stage 0 library/std` is this:
```
Updating only changed submodules
Submodules updated in 0.02 seconds
extracting [...]
   Compiling [...]
    Finished dev [unoptimized] target(s) in 17.53s
Building stage0 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
   Compling [...]
    Finished release [optimized + debuginfo] target(s) in 21.99s
Copying stage0 std from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Build completed successfully in 0:00:51
```
I find the part before the "Building stage0 std artifacts" a bit confusing.

After this commit, it looks like this:
```
Updating only changed submodules
  Submodules updated in 0.02 seconds
extracting [...]
Building rustbuild
   Compiling [...]
    Finished dev [unoptimized] target(s) in 17.53s
Building stage0 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
   Compling [...]
    Finished release [optimized + debuginfo] target(s) in 21.99s
Copying stage0 std from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Build completed successfully in 0:00:51
```
The "Building rustbuild" label makes it clear what the first cargo build
invocation is for. The indentation of the "Submodules updated" line
indicates it is a sub-step of a parent task.
This commit is contained in:
Nicholas Nethercote 2021-12-22 06:41:26 +11:00
parent ddabe0775c
commit 10e3d92306

View File

@ -974,6 +974,7 @@ class RustBuild(object):
def build_bootstrap(self): def build_bootstrap(self):
"""Build bootstrap""" """Build bootstrap"""
print("Building rustbuild")
build_dir = os.path.join(self.build_dir, "bootstrap") build_dir = os.path.join(self.build_dir, "bootstrap")
if self.clean and os.path.exists(build_dir): if self.clean and os.path.exists(build_dir):
shutil.rmtree(build_dir) shutil.rmtree(build_dir)
@ -1133,7 +1134,7 @@ class RustBuild(object):
recorded_submodules[data[3]] = data[2] recorded_submodules[data[3]] = data[2]
for module in filtered_submodules: for module in filtered_submodules:
self.update_submodule(module[0], module[1], recorded_submodules) self.update_submodule(module[0], module[1], recorded_submodules)
print("Submodules updated in %.2f seconds" % (time() - start_time)) print(" Submodules updated in %.2f seconds" % (time() - start_time))
def set_dist_environment(self, url): def set_dist_environment(self, url):
"""Set download URL for normal environment""" """Set download URL for normal environment"""