PTVS icon indicating copy to clipboard operation
PTVS copied to clipboard

Non-Microsoft developer unable to build PTVS

Open AdamYoblick opened this issue 2 years ago • 4 comments

From gitter chat:

Seems quiet, but here we go. I'm trying to build load in VS2022 a cloned repo of PTVS with no success, following instructions there and other hints. My (non-corporate) MS account login required to get the creds to access the NuGet repo is rejected. Any help? Here's some CLI things I've tried:

C:\xxx\xxxxx\PTVS>vsts-npm-auth -config .npmrc -force

vsts-npm-auth v0.42.1.0
-----------------------
Getting new credentials for source:https://pkgs.dev.azure.com/devdiv/_packaging/Pylance/npm/registry/, scope:vso.packaging_write vso.drop_write
Couldn't get an authentication token for https://pkgs.dev.azure.com/devdiv/_packaging/Pylance/npm/registry/.
Couldn't get an authentication token for https://pkgs.dev.azure.com/devdiv/_packaging/Pylance/npm/registry/.

C:\xxx\xxxxx\PTVS>c:\users\xxxxxxxxx\.nuget\plugins\netfx\CredentialProvider.Microsoft\CredentialProvider.Microsoft.exe -I -V Verbose -U "https://pkgs.dev.azure.com/devdiv/_packaging/Pylance/npm/registry/nuget/v3/index.json"
[Verbose] [CredentialProvider]Running in stand-alone mode
[Verbose] [CredentialProvider]Command-line v1.0.0+94af8126cf520805dd7e213b92cdecd9d8728d1f: c:\users\xxxxxxxxx\.nuget\plugins\netfx\CredentialProvider.Microsoft\CredentialProvider.Microsoft.exe  -I -V Verbose -U "https://pkgs.dev.azure.com/devdiv/_packaging/Pylance/npm/registry/nuget/v3/index.json"
[Verbose] [CredentialProvider]Handling auth request, Uri: https://pkgs.dev.azure.com/devdiv/_packaging/Pylance/npm/registry/nuget/v3/index.json, IsRetry: True, IsNonInteractive: False, CanShowDialog: False
[Verbose] [CredentialProvider]URI: https://pkgs.dev.azure.com/devdiv/_packaging/Pylance/npm/registry/nuget/v3/index.json
[Verbose] [CredentialProvider]VstsBuildTaskServiceEndpointCredentialProvider - This credential provider must be run under the Team Build tasks for NuGet with external endpoint credentials. Appropriate environment variable needs to be set.
[Verbose] [CredentialProvider]Skipping NuGetCredentialProvider.CredentialProviders.VstsBuildTaskServiceEndpoint.VstsBuildTaskServiceEndpointCredentialProvider, cannot provide credentials for https://pkgs.dev.azure.com/devdiv/_packaging/Pylance/npm/registry/nuget/v3/index.json
[Verbose] [CredentialProvider]VstsBuildTaskCredentialProvider - This credential provider must be run under the Team Build tasks for NuGet. Appropriate environment variables must be set.
[Verbose] [CredentialProvider]Skipping NuGetCredentialProvider.CredentialProviders.VstsBuildTask.VstsBuildTaskCredentialProvider, cannot provide credentials for https://pkgs.dev.azure.com/devdiv/_packaging/Pylance/npm/registry/nuget/v3/index.json
[Verbose] [CredentialProvider]GET https://pkgs.dev.azure.com/devdiv/_packaging/Pylance/npm/registry/nuget/v3/index.json
[Verbose] [CredentialProvider]VstsCredentialProvider - Detected an on premise Azure DevOps Server.
[Verbose] [CredentialProvider]Skipping NuGetCredentialProvider.CredentialProviders.Vsts.VstsCredentialProvider, cannot provide credentials for https://pkgs.dev.azure.com/devdiv/_packaging/Pylance/npm/registry/nuget/v3/index.json
[Verbose] [CredentialProvider]Unable to acquire credentials.

We need to do the following:

  • [x] Create a public azure artifacts feed for pylance * This feed is available at https://dev.azure.com/azure-public/vside/_artifacts/feed/pylance * The npm registry URL for pulling from this feed is https://pkgs.dev.azure.com/azure-public/vside/_packaging/pylance/npm/registry/
  • [x] Add a step in the pylance release process to push STABLE releases to this new feed (Erik is doing this)
  • [x] Manually push the latest pylance to the public feed for testing (Erik is doing this)
  • [x] Update the pylance feed in .npmrc * The public feed we'll be using is the super public feed for microsoft, which is https://pkgs.dev.azure.com/azure-public/vside/_packaging/msft_consumption/nuget/v3/index.json * This feed has our new pylance feed as an upstream source
  • [x] Update the nuget feed in nuget.config to something public facing, like https://pkgs.dev.azure.com/azure-public/vside/_packaging/msft_consumption/nuget/v3/index.json * Run PreBuild.ps1 to make sure it works. Update missing package versions as appropriate. * Report any failures to Andrew Arnott, he will add the appropriate upstreams needed
  • [x] Test on a fresh VM to make sure everything works as it should * On the VM, with no authentication setup done, try to run PreBuild.ps1. This should fail because the public feed doesn't have packages we need. * On your local machine, WITH authentications setup done, run PreBuild.ps1. This SHOULD pull packages from upstream sources into the public feed. Once this is done, the public can pull from the public feed, no further authentication should be required unless new package versions are released. * On the VM again, try to run PreBuild.ps1. The package restore for both npm and nuget should now succeed.
  • [x] Add a step in the pylance release process to populate the public feed by pulling the just released pylance version with authentication. * This will automate the previous step and it won't need to be done manually anymore except in rare circumstances when we upgrade nuget packages.
  • [x] Update the build docs at https://github.com/microsoft/PTVS/wiki/Build-and-Debug-Instructions-for-PTVS. * All the authentication steps for the public will go away once we are using public package sources. * Keep auth docs there for OUR team so we can pull them to the public feed once new versions are released

AdamYoblick avatar Sep 21 '22 16:09 AdamYoblick

Thanks, wasn't sure if this was appropriate here.

walterpg avatar Sep 21 '22 16:09 walterpg

Definitely yes :)

The repo is public so the public should be able to build. Let me investigate the best way to handle this and I’ll reply back

AdamYoblick avatar Sep 21 '22 16:09 AdamYoblick

@walterpg I'm working on this now, there are a few infra tasks we need to do first to enable this. This is my current task :)

AdamYoblick avatar Sep 28 '22 20:09 AdamYoblick

@walterpg https://github.com/microsoft/PTVS/pull/7178 fixes this problem. Just pull latest from main once this issue is closed. I've updated the build instructions to indicate that the authentication stuff should only be run by microsoft employees. The public should never have to do it.

AdamYoblick avatar Sep 30 '22 22:09 AdamYoblick

Thanks, finally got back to this. The PythonTools.sln Debug/Any CPU build works in VS 17.4 pre2.1 with some massaging.

walterpg avatar Oct 16 '22 20:10 walterpg