-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add templated probing path to store for developer scenarios #1306
Conversation
@@ -220,7 +220,7 @@ Copyright (c) .NET Foundation. All rights reserved. | |||
<PropertyGroup> | |||
<DefaultComposeDir>$(HOME)</DefaultComposeDir> | |||
<DefaultComposeDir Condition="'$(OS)' == 'Windows_NT'">$(USERPROFILE)</DefaultComposeDir> | |||
<DefaultComposeDir>$([System.IO.Path]::Combine($(DefaultComposeDir), '.dotnet', $(PlatformTarget), 'store'))</DefaultComposeDir> | |||
<DefaultComposeDir>$([System.IO.Path]::Combine($(DefaultComposeDir), '.dotnet', 'store'))</DefaultComposeDir> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does Store output folder get the architecture now from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we removing this? I would not have expected this to happen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously userprofile store was in
<user_profile><arch>\store
since we have removed both sdk and shared Fx from user_profile, this location no longer makes sense. I have moved store now under <user_profile>
The tooling adds and and passes this path as an additional probing path for developer scenarios
I see. the arch under store subfolder remains, right?
Thanks,
Gaurav
-------- Original message --------
From: Rama krishnan Raghupathy <notifications@github.com>
Date: 6/5/17 4:57 PM (GMT-08:00)
To: dotnet/sdk <sdk@noreply.github.com>
Cc: "Gaurav Khanna (CLR)" <Gaurav.Khanna@microsoft.com>, Mention <mention@noreply.github.com>
Subject: Re: [dotnet/sdk] Add templated probing path to store for developer scenarios (#1306)
@ramarag commented on this pull request.
________________________________
In src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.ComposeStore.targets<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdotnet%2Fsdk%2Fpull%2F1306%23discussion_r120238087&data=02%7C01%7CGaurav.Khanna%40microsoft.com%7Ce2c34ddaa1094b674f9708d4ac6e9c22%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636323038447869681&sdata=pZ1H6Mw86LmhlywRjmUslY3ucWrzZHmUCQqffJ1MB0g%3D&reserved=0>:
@@ -220,7 +220,7 @@ Copyright (c) .NET Foundation. All rights reserved.
<PropertyGroup>
<DefaultComposeDir>$(HOME)</DefaultComposeDir>
<DefaultComposeDir Condition="'$(OS)' == 'Windows_NT'">$(USERPROFILE)</DefaultComposeDir>
- <DefaultComposeDir>$([System.IO.Path]::Combine($(DefaultComposeDir), '.dotnet', $(PlatformTarget), 'store'))</DefaultComposeDir>
+ <DefaultComposeDir>$([System.IO.Path]::Combine($(DefaultComposeDir), '.dotnet', 'store'))</DefaultComposeDir>
Previously userprofile store was in
<user_profile><arch>\store
since we have removed both sdk and shared Fx from user_profile, this location no longer makes sense. I have moved store now under <user_profile>
The tooling adds and and passes this path as an additional probing path for developer scenarios
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdotnet%2Fsdk%2Fpull%2F1306%23discussion_r120238087&data=02%7C01%7CGaurav.Khanna%40microsoft.com%7Ce2c34ddaa1094b674f9708d4ac6e9c22%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636323038447869681&sdata=pZ1H6Mw86LmhlywRjmUslY3ucWrzZHmUCQqffJ1MB0g%3D&reserved=0>, or mute the thread<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAJA3wc6cJd6FXYfcllV5u06R5XpyfKMGks5sBJXhgaJpZM4Nwr0a&data=02%7C01%7CGaurav.Khanna%40microsoft.com%7Ce2c34ddaa1094b674f9708d4ac6e9c22%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636323038447869681&sdata=NskWkwhrjzgaQm%2BylxHSPaY0NoH92e7l0xX0zb7BZXw%3D&reserved=0>.
|
In reply to #1306 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eerhardt PTAL as well.
@@ -108,6 +109,16 @@ public void It_targets_the_right_framework_depending_on_output_type(bool selfCon | |||
actualRuntimeFrameworkVersion.Should().Be(expectedRuntimeVersion); | |||
} | |||
|
|||
string devruntimeConfigFile = Path.Combine(outputDirectory.FullName, testProject.Name + ".runtimeconfig.dev.json"); | |||
if (File.Exists(devruntimeConfigFile)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should assert that the file exists, not silently ignore when the file doesn't exist.
} | ||
|
||
//Add developer profile store location as the first path to probe | ||
var developerProfileStore = DeveloperStoreLocation + "/.dotnet/store/|arch|/|tfm|"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels odd that we are passing part of the path in on a parameter named DeveloperStoreLocation
, and then the C# code appends more folders to the path.
Instead, I would expect the whole path to be built in one location (the MSBuild targets), and then passed in. That way if, for whatever reason, someone can modify the whole path, if necessary.
Also, maybe it would be more extensible to have the parameter be "AdditionalProbingPaths" and take a list of paths. Then the MSBuild targets just passes in one, but we can add more later (or someone else can). Thoughts?
@@ -140,6 +140,11 @@ Copyright (c) .NET Foundation. All rights reserved. | |||
Inputs="$(ProjectAssetsFile);$(UserRuntimeConfig)" | |||
Outputs="$(ProjectRuntimeConfigFilePath);$(ProjectRuntimeConfigDevFilePath)"> | |||
|
|||
<PropertyGroup> | |||
<DeveloperStoreLocation>$(HOME)</DeveloperStoreLocation> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to reuse DefaultComposeDir
here? Instead of duplicating this location between here and ComposeStore.targets.
@ramarag Can you get the feedback incorporated so that we can get the PR ready for approval? |
If necessary, I can make the updates if @ramarag doesn't have the time. |
@eerhardt Will you be able to get the changes for this? |
Just started working on them now. |
Does this need to be reflected in documentation? |
Do we have the multi-level lookup locations listed in the documentation? If so, yes. By default, the host only knows how to look next to itself and in the "global" (ProgramFiles) location for 'runtime stores'. We removed the |
GenerateRuntimeConfigurationFiles should take the list of additional probling paths. Use a common property for the user profile store. Test should assert the runtimeconfig.dev.json file is created.
Currently, we don't, so I'll leave it that way, at least for now. Thanks. |
See Proposed Changes section at https://github.com/dotnet/core-setup/blob/master/Documentation/design-docs/multilevel-sharedfx-lookup.md - they are documented. |
Thanks, this is great. I meant on the docs.microsoft.com topic. |
@@ -43,6 +43,8 @@ public class GenerateRuntimeConfigurationFiles : TaskBase | |||
|
|||
public ITaskItem[] HostConfigurationOptions { get; set; } | |||
|
|||
public ITaskItem[] AdditionalProbingPaths { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can use string[] here instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a slight preference to keeping ITaskItem in case we ever want to add metadata to these items.
LGTM |
@eerhardt @nguerrera @livarcocc What are the next steps to get this merged? |
@MattGertz for approval Customer scenario With the introduction of the Bugs this fixes: Workarounds, if any Developers would have to manually pass the Risk Low - this re-enables the behavior that the host used to have, but only in dev time scenarios. Performance impact One new location is probed during Is this a regression from a previous update? This behavior was consciously removed from the host and added to the SDK. Root cause analysis: This behavior was flagged as part of a security push for the new multi-level lookup feature. How was the bug found? Design/security review. |
I agree & will take to JoC today. |
@MattGertz for approval. This is not a in-box change Matt. |
dotnet/sdk#1306 brought in templated probing paths into the runtime.config.json. These are breaking dotnet test because we assume the paths are valid. Skipping any invalid paths by catching exceptions from Path.Combine. Fixes microsoft#847
dotnet/sdk#1306 brought in templated probing paths into the runtime.config.json. These are breaking dotnet test because we assume the paths are valid. Skipping any invalid paths by catching exceptions from Path.Combine. Fixes #847
dotnet/sdk#1306 brought in templated probing paths into the runtime.config.json. These are breaking dotnet test because we assume the paths are valid. Skipping any invalid paths by catching exceptions from Path.Combine. Fixes #847
…0200221.13 (dotnet#1306) - Microsoft.AspNetCore.Analyzers - 5.0.0-preview.2.20121.13 - Microsoft.AspNetCore.Components.Analyzers - 5.0.0-preview.2.20121.13 - Microsoft.AspNetCore.Mvc.Analyzers - 5.0.0-preview.2.20121.13 - Microsoft.AspNetCore.Mvc.Api.Analyzers - 5.0.0-preview.2.20121.13
This is a followup of dotnet/core-setup#2539
Fixes #1298
@eerhardt @gkhanna79 PTAL