sdk icon indicating copy to clipboard operation
sdk copied to clipboard

Add additionalProbingPath to runtimeconfig.json

Open gkhanna79 opened this issue 10 years ago • 14 comments

For the development time scenarios of doing "dotnet build" followed by "dotnet ", without publishing the app as Portable or Standalone, there is need to reference a shared location where any dependencies (not present in SharedFX and appLocal) can be found.

CLI infrastructure should add a "additionalProbingPath" property to runtimeconfig.json that the host can read to support this scenario.

Assigning to @brthor per discussion.

CC @Petermarcu @piotrpMSFT @blackdwarf @schellap

gkhanna79 avatar Mar 28 '16 17:03 gkhanna79

@gkhanna79 @schellap

So this will be a top level property in the runtimeconfig.json?

Quick mockup of how I envision it:

{
  "runtimeOptions": {
    "additionalProbingPaths": ["~/.nuget/packages"],
    ...
  },
  "frameworks": ....
}

This will also be set regardless of app type? For both portable and standalone.

brthor avatar Mar 28 '16 17:03 brthor

I would suggest this would be part of the runtimeOptions section.

gkhanna79 avatar Mar 28 '16 17:03 gkhanna79

Yeah that makes more sense. Updated above

brthor avatar Mar 28 '16 17:03 brthor

@schellap @gkhanna79 can we reach a consensus on how we want to do this? Should we create a separate .devruntimeconfig.json or go with a separate session for this information or just follow @brthor's suggestion above?

livarcocc avatar Mar 29 '16 00:03 livarcocc

I think it is fine to keep this in runtimeOptions section. Additionally, @brthor please plumb "dotnet build" to insert this property and "rollforward:false" and plumb "dotnet publish" to remove both of them.

gkhanna79 avatar Mar 29 '16 01:03 gkhanna79

@gkhanna79 I will do this work. So, I will add "additionalProbingPaths": ["..."] and "rollforward": "false" to runtimeconfig.json only when doing dotnet build. They will not be present when doing dotnet publish.

Also, do we need this for both standalone and portable or just standalone?

livarcocc avatar Mar 29 '16 01:03 livarcocc

@livarcocc yes, this is done when running a development time artifact (which is the output of dotnet build) and not set when running the published output.

I presume doing this for development time also addresses it for the xunit discussion we had today?

gkhanna79 avatar Mar 29 '16 01:03 gkhanna79

"additionalProbingPaths": ["~/.nuget/packages"],

Just a clarification, additionalprobingpath is a single entity not an array. It should be a string. This has a special (internal) meaning and comes low in the precedence unlike other shared paths.

schellap avatar Mar 29 '16 10:03 schellap

@livarcocc can you please name the property as "applyPatch" instead of "rollForward"? @schellap Please make appropriate changes for the property name in the host as well.

@blackdwarf @leecow Thoughts on the property name?

gkhanna79 avatar Mar 29 '16 14:03 gkhanna79

This has a special (internal) meaning and comes low in the precedence unlike other shared paths.

@schellap Per our discussion yesterday, if the additionalProbePaths are processed after dotnetextensions and FX, there will be nothing special about them. And order of probing is an implementation detail. Also, this will work for the standalone xunit like scenario (post dotnet build) since there will be no FX path at that point and flow will fall into probe paths.

Any reason why the property shouldnt carry multiple paths?

gkhanna79 avatar Mar 29 '16 14:03 gkhanna79

@gkhanna79 I would leave rollForward since it is clearer what is happening.

thesmithee avatar Mar 29 '16 15:03 thesmithee

@blackdwarf, @gkhanna79 - what specifically is rollForward / applyPatch controlling? I have some ideas but would rather see it written down than making stuff up ;-)

leecow avatar Mar 29 '16 16:03 leecow

@gkhanna79, then I don't get in what sense it is additional. Additional, as per user means after app local. Shared paths means we can set the precedence and educate the user.

schellap avatar Mar 29 '16 17:03 schellap

So, this is how we are going to do this:

  • Additional probing path: Will be put inside a runtimeconfig.dev.json and it will be an array. This file will only be generated by build and won't be copied over for publish.
  • Rollfoward: the host will implement a policy where it will look for the runtimeconfig.dev.json file. If it is present, roll forward will always be false and it will ignore whatever is inside runtimeoptions of the runtimeconfig.json file.
  • We will copy over the properties from project.json runtimeoptions to runtimeoptions of runtimeconfig.json, including additionalprobingpath and rollforward.

livarcocc avatar Mar 29 '16 21:03 livarcocc