Skip to content

Commit ad27422

Browse files
committed
[release] src/goInstallTools: unpin dlv-dap version, and pick master
This partially reverts commit d1d61bc. Pinning made it difficult for users to use newer versions with bug fixes. Use the stable version as the latestVersion for now. Fixes #1687 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/344789 Trust: Hyang-Ah Hana Kim <[email protected]> Run-TryBot: Hyang-Ah Hana Kim <[email protected]> TryBot-Result: kokoro <[email protected]> Reviewed-by: Polina Sokolova <[email protected]> Change-Id: Ib35791c99b77dc1be24906875f3e039dec96c830 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/346094 Reviewed-by: Suzy Mueller <[email protected]>
1 parent 0888ba5 commit ad27422

File tree

5 files changed

+8
-31
lines changed

5 files changed

+8
-31
lines changed

src/goInstallTools.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ export async function installTools(
162162
const toInstall: Promise<{ tool: Tool; reason: string }>[] = [];
163163
for (const tool of missing) {
164164
const modulesOffForTool = modulesOff;
165+
165166
const reason = installTool(tool, goVersion, envForTools, !modulesOffForTool);
166167
toInstall.push(Promise.resolve({ tool, reason: await reason }));
167168
}

src/goToolsInformation.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,10 @@ export const allToolsInformation: { [key: string]: Tool } = {
223223
replacedByGopls: false,
224224
isImportant: true,
225225
description: 'Go debugger & debug adapter (Delve DAP)',
226-
defaultVersion: 'f95340ae1bf9', // pinned version
226+
defaultVersion: 'master', // Always build from the master.
227227
minimumGoVersion: semver.coerce('1.12'), // dlv requires 1.12+ for build
228-
latestVersion: semver.parse('v1.7.1-0.20210804080032-f95340ae1bf9'),
229-
latestVersionTimestamp: moment('2021-08-04', 'YYYY-MM-DD')
228+
latestVersion: semver.parse('v1.7.1'),
229+
latestVersionTimestamp: moment('2021-08-18', 'YYYY-MM-DD')
230230
},
231231
'fillstruct': {
232232
name: 'fillstruct',

test/integration/install.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ suite('Installation Tests', function () {
160160
{ name: 'guru', versions: ['v1.0.0'], wantVersion: 'v1.0.0' },
161161
{
162162
name: 'dlv-dap',
163-
versions: ['v1.0.0', getTool('dlv-dap').defaultVersion!],
163+
versions: ['v1.0.0', 'master'],
164164
wantVersion: 'v' + getTool('dlv-dap').latestVersion!.toString()
165165
}
166166
],
@@ -175,7 +175,7 @@ suite('Installation Tests', function () {
175175
{ name: 'guru', versions: ['v1.0.0'], wantVersion: 'v1.0.0' },
176176
{
177177
name: 'dlv-dap',
178-
versions: ['v1.0.0', getTool('dlv-dap').defaultVersion!],
178+
versions: ['v1.0.0', 'master'],
179179
wantVersion: 'v' + getTool('dlv-dap').latestVersion!.toString()
180180
}
181181
],

tools/allTools.ts.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ export const allToolsInformation: { [key: string]: Tool } = {
221221
replacedByGopls: false,
222222
isImportant: true,
223223
description: 'Go debugger & debug adapter (Delve DAP)',
224-
defaultVersion: '%s', // pinned version
224+
defaultVersion: 'master', // Always build from the master.
225225
minimumGoVersion: semver.coerce('1.12'), // dlv requires 1.12+ for build
226226
latestVersion: semver.parse('%s'),
227227
latestVersionTimestamp: moment('%s', 'YYYY-MM-DD')

tools/generate.go

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ package main
1515
import (
1616
"bytes"
1717
"encoding/json"
18-
"errors"
1918
"flag"
2019
"fmt"
2120
"io"
@@ -24,7 +23,6 @@ import (
2423
"os"
2524
"os/exec"
2625
"path/filepath"
27-
"regexp"
2826
"sort"
2927
"strings"
3028

@@ -237,12 +235,6 @@ func main() {
237235
if err != nil {
238236
log.Fatal(err)
239237
}
240-
// Due to https://github.com/golang/vscode-go/issues/1682, we cannot use
241-
// pseudo-version as the pinned version reliably.
242-
dlvRevOrStable := dlvVersion.Version
243-
if rev, err := pseudoVersionRev(dlvVersion.Version); err == nil { // pseudo-version
244-
dlvRevOrStable = rev
245-
}
246238

247239
// Check for the latest gopls version.
248240
versions, err := listAllModuleVersions("golang.org/x/tools/gopls")
@@ -277,7 +269,7 @@ func main() {
277269
}
278270

279271
// TODO(suzmue): change input to json and avoid magic string printing.
280-
toolsString := fmt.Sprintf(string(data), goplsVersion.Version, goplsVersion.Time[:len("YYYY-MM-DD")], goplsVersionPre.Version, goplsVersionPre.Time[:len("YYYY-MM-DD")], dlvRevOrStable, dlvVersion.Version, dlvVersion.Time[:len("YYYY-MM-DD")])
272+
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")])
281273

282274
// Write tools section.
283275
b.WriteString(toolsString)
@@ -693,19 +685,3 @@ func describeDebugProperty(p *Property) string {
693685
}
694686
return b.String()
695687
}
696-
697-
// pseudoVersionRev extracts the revision info if the given version is pseudo version.
698-
// We wanted to use golang.org/x/mod/module.PseudoVersionRev, but couldn't due to
699-
// an error in the CI. This is a workaround.
700-
//
701-
// It assumes the version string came from the proxy, so a valid, canonical version
702-
// string. Thus, the check for pseudoversion is not as robust as golang.org/x/mod/module
703-
// offers.
704-
func pseudoVersionRev(ver string) (rev string, _ error) {
705-
var pseudoVersionRE = regexp.MustCompile(`^v[0-9]+\.(0\.0-|\d+\.\d+-([^+]*\.)?0\.)\d{14}-[A-Za-z0-9]+(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$`)
706-
if strings.Count(ver, "-") < 2 || !pseudoVersionRE.MatchString(ver) {
707-
return "", errors.New("not a pseudo version")
708-
}
709-
j := strings.LastIndex(ver, "-")
710-
return ver[j+1:], nil
711-
}

0 commit comments

Comments
 (0)