Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Make tools re-compiling warnings scoped by toolsGopath #1589

Merged
merged 3 commits into from
Mar 28, 2019
Merged

Make tools re-compiling warnings scoped by toolsGopath #1589

merged 3 commits into from
Mar 28, 2019

Conversation

FiloSottile
Copy link
Contributor

When switching between workspaces with different goroot and toolsGopath
settings, the editor is suggesting that re-compiling tools is required
because the GOROOT state is global and not toolsGopath-aware.

This makes the global context a map keyed on toolsGopath.

@msftclas
Copy link

msftclas commented Mar 22, 2018

CLA assistant check
All CLA requirements met.

@FiloSottile
Copy link
Contributor Author

I signed and emailed the Google / Microsoft CLA. I think you'll need to tick that box manually.

@FiloSottile
Copy link
Contributor Author

@ramya-rao-a ping. I think you'll need to toggle CLA state manually.

@ramya-rao-a
Copy link
Contributor

@FiloSottile We usually dont need to do anything from our side. Did you click on the link "sign now" above and sign there?

@FiloSottile
Copy link
Contributor Author

@ramya-rao-a Microsoft has a custom CLA for Google employees, I can't use the online system when contributing as part of my job. But I already signed the non-standard CLA and emailed it to the relevant Microsoft address (I think cla-automation@) and I'm told that now you'll have to check it manually on your side.

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Apr 3, 2018

:) There is no button/link here for me to manually do anything in this area, I'll check with a few folks and get back to you.

#949 was a PR from another person from Google. I didnt have to manually check anything then

@stamblerre Can you share what you had to do for the cla?

@FiloSottile
Copy link
Contributor Author

I think something might have indeed happened behind the scenes in #949 because the bot marked it as "cla-already-signed" instead of just signed.

@FiloSottile FiloSottile closed this Apr 3, 2018
@FiloSottile FiloSottile reopened this Apr 3, 2018
@ramya-rao-a
Copy link
Contributor

@FiloSottile Our internal team for Open Source has reached out to the Google legal team which now has agreed that Google employees should use the normal CLA approach. Can you recheck your internal guidance in this matter?

src/goMain.ts Outdated Show resolved Hide resolved
src/goMain.ts Outdated Show resolved Hide resolved
src/goMain.ts Outdated Show resolved Hide resolved
goroot: string;
version: string;
}
const toolsGopath = getToolsGopath() || getCurrentGoPath();
Copy link
Contributor

Choose a reason for hiding this comment

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

In Go versions less than 1.8, it is possible that gopath will not be set, so toolsGopath here would be null or undefined

Copy link
Contributor

Choose a reason for hiding this comment

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

@ramya-rao-a is this still a concern given that 1.12 is out and we dont test for 1.8 anymore

Copy link
Member

Choose a reason for hiding this comment

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

Only thing that comes to mind is the future when modules have taken over and GOPATH becomes obsolete. It's a larger issue though and I don't think it needs to hold up this PR.

@njgraf512
Copy link

This would be a super helpful PR to land. I've been having to continuously patch every new release with this to be able to work with multiple workspaces. Are there plans to push this forward?

@ramya-rao-a
Copy link
Contributor

@njgraf512 I was just waiting @FiloSottile to get back on my comments. Feel free to jump aboard and address them if you got some time.

FiloSottile and others added 3 commits March 25, 2019 14:40
When switching between workspaces with different goroot and toolsGopath
settings, the editor is suggesting that re-compiling tools is required
because the GOROOT state is global and not toolsGopath-aware.

This makes the global context a map keyed on toolsGopath.
@vladbarosan
Copy link
Contributor

@ramya-rao-a @jhendrixMSFT made requested changes. please comment if there is anything else.
Still need to test the scenario. will let you know

@vladbarosan
Copy link
Contributor

Tested, everything seems fine.
How:

  • Installed 2 versions of Go and set the goroot and the gotoolspath and workspace settings and switched between them
  • Before: kept being asked every time.
  • Now: not anymore

@vladbarosan
Copy link
Contributor

@ramya-rao-a since you requested changes initially , all good on your side ?

ctx.globalState.update('goVersion', currVersionString);
const currentVersion = await getGoVersion();
if (currentVersion) {
const prevVersion = toolsGoInfo[toolsGopath].version;
Copy link
Contributor

Choose a reason for hiding this comment

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

When this update goes out, prevVersion will be null for the first time, and users will get the prompt for recompiling.
We need a null check for prevVersion just like we do for prevGoroot

Copy link
Contributor

Choose a reason for hiding this comment

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

yess, good catch

Copy link
Contributor

@vladbarosan vladbarosan Mar 28, 2019

Choose a reason for hiding this comment

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

we do, but just that is nested

Copy link
Contributor

@vladbarosan vladbarosan Mar 28, 2019

Choose a reason for hiding this comment

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

actually i think its fine how it is ? because we show the warning only if prev version exists

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah! I missed the nested check. looks good

@vladbarosan vladbarosan merged commit b597ae8 into microsoft:master Mar 28, 2019
@FiloSottile
Copy link
Contributor Author

Thanks everyone for picking this up. ✨ I kept meaning to get back to it but never managed to.

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Apr 23, 2019

This feature is out in the latest release(0.10.0) of the Go extension.
@FiloSottile, can you give it a try?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants