Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
Version 17.18.0
---------------
* Make sure debug tools/data get queued to be built (#3373)
* Implement reverse parameter for `sorted` built-in function (#3372)
* Implement key parameter for `sorted` built-in function (#3371)
* Add `//` operator (#3370)
* fix(query.deps): memoize provided labels rather than declared targets (#3369)

Version 17.17.0
---------------
* Make export work when it hits something in the repository root (#3364)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
17.17.0
17.18.0
1 change: 1 addition & 0 deletions src/BUILD.plz
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ go_binary(
"//src/help",
"//src/metrics",
"//src/output",
"//src/parse",
"//src/plz",
"//src/plzinit",
"//src/process",
Expand Down
3 changes: 3 additions & 0 deletions src/core/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@ type BuildState struct {
// EnableBreakpoints enablese the breakpoint() build-in, and drops Please into an interactive debugger when
// they're encountered.
EnableBreakpoints bool
// NeedDebugDeps is true if we're doing a `plz debug` and we need to build the debug tools and
// data
NeedDebugDeps bool

// initOnce is used to control loading the subrepo .plzconfig
initOnce *sync.Once
Expand Down
1 change: 1 addition & 0 deletions src/please.go
Original file line number Diff line number Diff line change
Expand Up @@ -1153,6 +1153,7 @@ func Please(targets []core.BuildLabel, config *core.Configuration, shouldBuild,
state.ShowAllOutput = opts.OutputFlags.ShowAllOutput
state.ParsePackageOnly = opts.ParsePackageOnly
state.EnableBreakpoints = opts.BehaviorFlags.Debug
state.NeedDebugDeps = debug

// What outputs get downloaded in remote execution.
if debug {
Expand Down
21 changes: 21 additions & 0 deletions src/plz/plz.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ func findOriginalTasks(state *core.BuildState, preTargets, targets []core.BuildL
}
findOriginalTaskSet(state, targets, true, arch)
log.Debug("Original target scan complete")
if state.NeedDebugDeps {
if len(targets) != 1 {
log.Fatalf("expected exactly 1 target in debug mode; got %d", len(targets))
}
queueTargetsForDebug(state, targets[0])
}
state.TaskDone() // initial target adding counts as one.
}

Expand All @@ -166,6 +172,21 @@ func findOriginalTaskSet(state *core.BuildState, targets []core.BuildLabel, addT
}
}

func queueTargetsForDebug(state *core.BuildState, target core.BuildLabel) {
parse.Parse(state, target, core.OriginalTarget, core.ParseModeNormal)
t := state.Graph.TargetOrDie(target)
for _, tool := range t.AllDebugTools() {
if l, ok := tool.Label(); ok {
state.AddOriginalTarget(l, false)
}
}
for _, data := range t.AllDebugData() {
if l, ok := data.Label(); ok {
state.AddOriginalTarget(l, false)
}
}
}

func stripHostRepoName(config *core.Configuration, label core.BuildLabel) core.BuildLabel {
if label.Subrepo == "" {
return label
Expand Down
Loading