Skip to content

Commit

Permalink
src/goInstallTools: pin dlv-dap version @ 89ed5a0b
Browse files Browse the repository at this point in the history
Building from master is too risky.

Eventually, we want to allow users to choose the version to install
or allow Nightly/Preview mode users to install from the master.
But that's not included in this CL.

Fixes #1661

Change-Id: Ib3d6a4b63b1084b30bc8a24e69453395e622810a
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/339449
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Suzy Mueller <suzmue@golang.org>
  • Loading branch information
hyangah committed Aug 4, 2021
1 parent 80c1009 commit d1d61bc
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
1 change: 0 additions & 1 deletion src/goInstallTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ export async function installTools(
const toInstall: Promise<{ tool: Tool; reason: string }>[] = [];
for (const tool of missing) {
const modulesOffForTool = modulesOff;

const reason = installTool(tool, goVersion, envForTools, !modulesOffForTool);
toInstall.push(Promise.resolve({ tool, reason: await reason }));
}
Expand Down
9 changes: 5 additions & 4 deletions src/goToolsInformation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,17 +213,18 @@ export const allToolsInformation: { [key: string]: Tool } = {
modulePath: 'github.com/go-delve/delve',
replacedByGopls: false,
isImportant: true,
description: 'Go debugger (Delve)'
description: 'Go debugger (Delve)',
minimumGoVersion: semver.coerce('1.12') // dlv requires 1.12+ for build
},
'dlv-dap': {
name: 'dlv-dap',
importPath: 'github.com/go-delve/delve/cmd/dlv',
modulePath: 'github.com/go-delve/delve',
replacedByGopls: false,
isImportant: true,
description: 'Go debugger (Delve built for DAP experiment)',
defaultVersion: 'master', // Always build from the master.
minimumGoVersion: semver.coerce('1.14'), // last 3 versions per delve policy
description: 'Go debugger & debug adapter (Delve DAP)',
defaultVersion: 'v1.7.1-0.20210729173401-89ed5a0b1972', // pinned version
minimumGoVersion: semver.coerce('1.12'), // dlv requires 1.12+ for build
latestVersion: semver.parse('v1.7.1-0.20210729173401-89ed5a0b1972'),
latestVersionTimestamp: moment('2021-07-29', 'YYYY-MM-DD')
},
Expand Down
4 changes: 2 additions & 2 deletions test/integration/install.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ suite('Installation Tests', function () {
{ name: 'guru', versions: ['v1.0.0'], wantVersion: 'v1.0.0' },
{
name: 'dlv-dap',
versions: ['v1.0.0', 'master'],
versions: ['v1.0.0', getTool('dlv-dap').defaultVersion!],
wantVersion: 'v' + getTool('dlv-dap').latestVersion!.toString()
}
],
Expand All @@ -175,7 +175,7 @@ suite('Installation Tests', function () {
{ name: 'guru', versions: ['v1.0.0'], wantVersion: 'v1.0.0' },
{
name: 'dlv-dap',
versions: ['v1.0.0', 'master'],
versions: ['v1.0.0', getTool('dlv-dap').defaultVersion!],
wantVersion: 'v' + getTool('dlv-dap').latestVersion!.toString()
}
],
Expand Down
11 changes: 6 additions & 5 deletions tools/allTools.ts.in
Original file line number Diff line number Diff line change
Expand Up @@ -211,17 +211,18 @@ export const allToolsInformation: { [key: string]: Tool } = {
modulePath: 'github.com/go-delve/delve',
replacedByGopls: false,
isImportant: true,
description: 'Go debugger (Delve)'
description: 'Go debugger (Delve)',
minimumGoVersion: semver.coerce('1.12') // dlv requires 1.12+ for build
},
'dlv-dap': {
name: 'dlv-dap',
importPath: 'github.com/go-delve/delve/cmd/dlv',
modulePath: 'github.com/go-delve/delve',
replacedByGopls: false,
isImportant: false,
description: 'Go debugger (Delve built for DAP experiment)',
defaultVersion: 'master', // Always build from the master.
minimumGoVersion: semver.coerce('1.14'), // last 3 versions per delve policy
isImportant: true,
description: 'Go debugger & debug adapter (Delve DAP)',
defaultVersion: '%s', // pinned version
minimumGoVersion: semver.coerce('1.12'), // dlv requires 1.12+ for build
latestVersion: semver.parse('%s'),
latestVersionTimestamp: moment('%s', 'YYYY-MM-DD')
},
Expand Down
2 changes: 1 addition & 1 deletion tools/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ func main() {
}

// TODO(suzmue): change input to json and avoid magic string printing.
toolsString := fmt.Sprintf(string(data), goplsVersion.Version, goplsVersion.Time[:len("YYYY-MM-DD")], goplsVersionPre.Version, goplsVersionPre.Time[:len("YYYY-MM-DD")], dlvVersion.Version, dlvVersion.Time[:len("YYYY-MM-DD")])
toolsString := fmt.Sprintf(string(data), goplsVersion.Version, goplsVersion.Time[:len("YYYY-MM-DD")], goplsVersionPre.Version, goplsVersionPre.Time[:len("YYYY-MM-DD")], dlvVersion.Version, dlvVersion.Version, dlvVersion.Time[:len("YYYY-MM-DD")])

// Write tools section.
b.WriteString(toolsString)
Expand Down

0 comments on commit d1d61bc

Please sign in to comment.