Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the comments around the build target state #3217

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
20 changes: 11 additions & 9 deletions src/core/build_target.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,20 +321,22 @@ func (o OutputDirectory) ShouldAddFiles() bool {
// or not. Targets only move forwards through this (i.e. the state of a target only ever increases).
type BuildTargetState uint8

// The available states for a target.
// The available states for a target. States with higher integer values are always later on, or at the same point in the
// target lifecycle. This property is used to make sure we never transition a target backwards i.e. you can't go back
// to Active from Built.
const (
Inactive BuildTargetState = iota // Target isn't used in current build
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: please add trailing full stops consistently

Semiactive // Target would be active if we needed a build
Active // Target is going to be used in current build
Pending // Target is ready to be built but not yet started.
Active // Target is going to be used in current build, but we're waiting for its dependencies to build
Pending // Target has been added to the build queue built but not yet started.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Pending // Target has been added to the build queue built but not yet started.
Pending // Target has been added to the build queue but not yet started.

Building // Target is currently being built
Stopped // We stopped building the target because we'd gone as far as needed.
Built // Target has been successfully built
Cached // Target has been retrieved from the cache
Unchanged // Target has been built but hasn't changed since last build
Reused // Outputs of previous build have been reused.
Stopped // We stopped building the target because we'd gone as far as needed i.e. because we're only preparing the build dir for --shell
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: is "we're only preparing the build dir for --shell" actually the only case where we'd see this statement?

If so, I suggest "We stopped building the target because we're only preparing the build dir for --shell"

If not, "i.e." should be "e.g."

Built // Target has been successfully built. The target wasn't cached in any way.
Cached // Target has been retrieved from the build cache, but was not found in plz-out
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but was not found in plz-out

It's unclear why this is relevant? Is this in comparison to Reused, where it was found in plz-out?

Unchanged // Target has been re-built (e.g. because the input or rule hash changed) but the outputs didn't change since last build
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Unchanged // Target has been re-built (e.g. because the input or rule hash changed) but the outputs didn't change since last build
Unchanged // Target has been re-built (e.g. because the input or rule hash changed) but the outputs didn't change since the last build

Reused // Outputs of previous build have been reused i.e. the outputs in plz-out were up-to-date
BuiltRemotely // Target has been built but outputs are not necessarily local.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does "not necessarily local" mean? Not necessarily available in plz-out?

ReusedRemotely // Outputs of previous remote action have been reused.
ReusedRemotely // Outputs of previous remote action have been reused. This could be locally or remotely cached.
DependencyFailed // At least one dependency of this target has failed.
Failed // Target failed for some reason
)
Expand Down
Loading