Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reimplement debugger acquisition to use Package Manager #873

Merged
merged 4 commits into from
Nov 7, 2016

Conversation

chuckries
Copy link
Contributor

  1. Remove all code related to calling dotnet restore/dotnet publish
  2. Remove coreclr-debug directory
  3. Add debugger runtime packages to package manifest
  4. Add an install.Begin file to the package manager so we can detect that
    it is in progress
  5. Rework the debugger proxy so that it understands the package manager
  6. Add knowledge of the dotnet cli on the path to the debugger proxy

TODO:

  1. Lots and lots of testing
  2. Offline package creation

1. Remove all code related to calling dotnet restore/dotnet publish
2. Remove coreclr-debug directory
3. Add debugger runtime packages to package manifest
4. Add an install.Begin file to the package manager so we can detect that
it is in progress
5. Rework the debugger proxy so that it understands the package manager
6. Add knowledge of the dotnet cli on the path to the debugger proxy

TODO:
1. Lots and lots of testing
2. Offline package creation
@chuckries
Copy link
Contributor Author

@gregg-miskelly @wesrupert @DustinCampbell

I need to test this all over the place and offline package creation is still incoming.

]
},
{
"description": ".NET Core Debugger (OSX / x64)",
Copy link
Member

@DustinCampbell DustinCampbell Nov 4, 2016

Choose a reason for hiding this comment

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

"macOS"? #Pending

Copy link
Contributor Author

@chuckries chuckries Nov 4, 2016

Choose a reason for hiding this comment

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

I was basing it off omnisharp: "description": "OmniSharp (.NET Core - OSX / x64)",
I'll change it in both places. #Closed

Copy link
Member

Choose a reason for hiding this comment

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

fine be me. I was just working on my own local branch when I wrote "macOS". I don't much care. 😄

export function getBinPath() {
return path.resolve(getExtensionPath(), "bin");
}

Copy link
Member

@DustinCampbell DustinCampbell Nov 4, 2016

Choose a reason for hiding this comment

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

I'll be using this again in my next PR. #Pending

Copy link
Contributor Author

@chuckries chuckries Nov 4, 2016

Choose a reason for hiding this comment

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

I'll put it back. #Closed

return new Promise<void>((resolve, reject) => {
fs.writeFile(getInstallFilePath(type), '', err => {
if (err) {
reject(err);
Copy link
Member

@DustinCampbell DustinCampbell Nov 4, 2016

Choose a reason for hiding this comment

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

I'd return here so that it doesn't carry on to the resolve below. #Pending


import { CoreClrDebugUtil } from './util';
import * as fs from 'fs';
import * as path from 'path';
import * as fs_extra from 'fs-extra-promise';
Copy link
Member

@DustinCampbell DustinCampbell Nov 4, 2016

Choose a reason for hiding this comment

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

is this the last reference? Can we remove the dependency from package.json?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not quite, looks like this is used in assets.ts and features/commands.ts


In reply to: 86635042 [](ancestors = 86635042)

return dotnetInfo;
});
}

public spawnChildProcess(process: string, args: string[], workingDirectory: string, onStdout?: (data: Buffer) => void, onStderr?: (data: Buffer) => void): Promise<void> {
Copy link
Member

@DustinCampbell DustinCampbell Nov 4, 2016

Choose a reason for hiding this comment

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

Does spawnChildProcess in common.ts work for this? #Pending

moreErrors = error.hasMoreErrors ? 'true' : 'false';
}).then(() => {
// log telemetry and delete install begin file
logTelemetry('Acquisition', {
Copy link
Member

Choose a reason for hiding this comment

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

Should we move this into main.activate()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is still an open question surrounding how we want to handle telemetry now that we have moved to the package manager.


In reply to: 86636070 [](ancestors = 86636070)

})
.then(() => {
installationStage = 'deleteBeginFile';
return util.deleteInstallFile(util.InstallFileType.Begin)
Copy link
Contributor

@gregg-miskelly gregg-miskelly Nov 4, 2016

Choose a reason for hiding this comment

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

Should this be in the catch block (or using the temp file stuff) so that we delete the begin file no matter what? #Pending

// We have been activated but it looks like our package was not installed. This is bad.
logger.appendLine("[ERROR]: C# Extension failed to install the debugger package");
showInstallErrorMessage();
} else if (!CoreClrDebugUtil.existsSync(_util.installCompleteFilePath())) {
Copy link
Contributor

@gregg-miskelly gregg-miskelly Nov 4, 2016

Choose a reason for hiding this comment

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

Since we also have an install complete file for the package manager, I wonder if we should rename some part of this to make the distinction more clear (ex: debugUtil instead of util, or debuggerInstallCompleteFilePath...) #Pending

// This function checks for the presence of dotnet on the path and ensures the Version
// is new enough for us.
// Returns: a promise that returns a DotnetInfo class
// Throws: An CotNetCliError() from the return promise if either dotnet does not exist or is too old.
Copy link
Contributor

@gregg-miskelly gregg-miskelly Nov 4, 2016

Choose a reason for hiding this comment

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

CotNetCliError is wrong #Pending

@chuckries
Copy link
Contributor Author

@DustinCampbell I think this is ready to be merged. Can you take another look?

]
},
{
"description": ".NET Core Debugger (OSX / x64)",
Copy link
Member

Choose a reason for hiding this comment

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

fine be me. I was just working on my own local branch when I wrote "macOS". I don't much care. 😄

@@ -91,7 +91,7 @@
]
},
{
"description": "OmniSharp (.NET Core - OSX / x64)",
"description": "OmniSharp (.NET Core - macOS / x64)",
Copy link
Member

Choose a reason for hiding this comment

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

Thanks!

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

Successfully merging this pull request may close these issues.

4 participants