sdk icon indicating copy to clipboard operation
sdk copied to clipboard

Tool dependecies versioning issues

Open moozzyk opened this issue 10 years ago • 35 comments

When you build a tool that uses NetCore.App version that you don't have installed the tool does not work at all. Example: I compiled the tool against NetCore.App 23911 and 23923 ( "Microsoft.NETCore.App": { "type": "platform", "version": "1.0.0-rc2-23911" } } ) and it did not work because: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\1.0.0-rc2-23924

When I compiled against 23924 the tool worked.

Since projects using tools don't control what versions of dependency a tool is using it defeats the purpose of a shared framework since in the end you will need a version of a framework that corresponds to the dependency of the tool.

Also the message is quite confusing as well:

Could not load host policy library []

moozzyk avatar Mar 25 '16 22:03 moozzyk

/cc @NTaylorMullen

moozzyk avatar Mar 25 '16 22:03 moozzyk

/cc @natemcmaster

moozzyk avatar Mar 25 '16 22:03 moozzyk

@gkhanna79 @schellap what are your thoughts here?

I discussed this with @schellap last week. The problem goes away for a while once we ship 1.0.0, but until then it means that using a tool requires installing the shared framework the tool was built for. We can make this a bit better by allowing roll-forward for pre-release versions. However, this is in a fairly sensitive portion of the host.

Is this something we can pursue once the host is stabilized?

TheRealPiotrP avatar Mar 28 '16 09:03 TheRealPiotrP

@piotrpMSFT - can you elaborate a bit more on how this is fixed with 1.0.0? What happens once 1.0.1 ships? Won't the 1.0.0 tools stop working if only 1.0.1 sdk installed? Given that dotnet follows semver I think it is reasonable to roll tools forward (and possibly backward?) within the minor or maybe even major version. Also, not sure if this is reasonable but maybe it should also be possible to create self contained tools that would bring the runtime with themselves if the one they need is not already installed.

moozzyk avatar Mar 28 '16 16:03 moozzyk

For pre-release scenarios like this, there is no auto-roll forward by design as there are no compat guarantees between even daily builds. This issue is specific to such intermediary scenarios where the underlying platform is still being developed.

For actual production scenarios, the tool would be built against a shipping version of the framework and would just work. It should be kept in mind that any tool, targeting .NET Core, is a .NET Core app and like any such app, would need to have its dependencies present for it to work. If the dependency is on .NET Core 1.0.0 for the tool and the onyl FX present is 1.2.0, there is not going to be an auto-roll forward for the same as well.

The question here would be how .NET Core apps get installed and declare their (production scenario) dependencies. I think this is a dev-scenario issue and I will have @blackdwarf think about enabling the intended developer experiences.

gkhanna79 avatar Mar 28 '16 16:03 gkhanna79

Looping in a few others. /cc @DamianEdwards @Eilon

NTaylorMullen avatar Mar 28 '16 17:03 NTaylorMullen

We need to try our best to make sure that NuGet packages such as Razor Tooling don't break when a newer .NET CLI is installed, even though it could have work.

Is there a reason to be restrictive on which versions are compatible, when there's probably a decent change it'll just work?

Eilon avatar Mar 28 '16 17:03 Eilon

It's worth noting that ASP.NET went to great lengths to ensure that N+1 runtimes worked with N tooling as long as possible, even with pre-releases (it often eventually breaks, but only when there's no reasonable alternative).

Eilon avatar Mar 28 '16 17:03 Eilon

Is there a reason to be restrictive on which versions are compatible, when there's probably a decent change it'll just work?

This constraint is only applicable to pre-release versions for the reason called out above.

It's worth noting that ASP.NET went to great lengths to ensure that N+1 runtimes worked with N tooling as long as possible, even with pre-releases

This is less of a host issue but rather overall policy/scenario question - in the past discussions, the concern was always about breaking across pre-releases.

CC @weshaggard

gkhanna79 avatar Mar 28 '16 17:03 gkhanna79

It seems that this rule makes it also virtually impossible for early adopters to use the tools. They typically install the latest cli. To use a tool they would have to know the version of the Microsoft.NETCore.App version the tool depends on (probably means they need to crack open the package) and install the shared runtime that corresponds to this version (and it's not easy to install not the latest).

moozzyk avatar Mar 28 '16 18:03 moozzyk

I just wonder if such a policy is a bit too restrictive for pre-releases. It certainly might break, but normally we leave that to people on the bleeding edge to experience, and it's part of what they expect (that's the "blood" part of "bleeding edge").

Eilon avatar Mar 28 '16 18:03 Eilon

What's the plan for RC2? How do the tools work in RC2?

muratg avatar Apr 04 '16 19:04 muratg

@davidfowl mentioned on Friday that he is working on a tool to address this. Have you chatted with him on this?

gkhanna79 avatar Apr 04 '16 19:04 gkhanna79

@gkhanna79 what kind of a tool would this be? This seems to me to be an issue that would also require guidance for people writing the tools, no?

thesmithee avatar Apr 04 '16 20:04 thesmithee

This issue is larger than tools, it is true for portable apps in general.

In production we will have some form of roll forward in place (as I understand it) but with prerelease bits, portable apps can only work against the sharedfx that they target. The fact that project tools are now portable apps is the cause here.

I'd like to get thoughts on whether we be looking at solutions for tools in specific, or portable apps in general?

brthor avatar Apr 04 '16 21:04 brthor

Hm, that's true. But with portable apps, isn't the statement that you've made a very deliberate call on what you depend on?

thesmithee avatar Apr 04 '16 21:04 thesmithee

We will either need a guidance doc for tool writers, or enable roll-forward now. Otherwise experience will be really bad. RC2 users will need to have matching CLI versions everywhere (command line, VS, CI, ...)

muratg avatar Apr 04 '16 21:04 muratg

But with portable apps, isn't the statement that you've made a very deliberate call on what you depend on?

This is correct.

@davidfowl Can you please share the details of the tool you were referring to on Friday?

RC2 users will need to have matching CLI versions everywhere (command line, VS, CI, ...)

@muratg Can you please elaborate? Are you suggesting that developers using RC2 final bits will update their dependencies to depend upon a pre-release build? Is this going to happen in a production usage of the tool?

gkhanna79 avatar Apr 04 '16 21:04 gkhanna79

@muratg for the guidance, I will be writing that regardless. But @gkhanna79 has a good point above: for RC2, you should only depend on the version of the NETCore.App that is RC2, right? Why would you depend on before or after if you want to run on RC2?

thesmithee avatar Apr 04 '16 21:04 thesmithee

@blackdwarf We'll be rolling newer versions between RC2 and RTM. Don't we want to keep RC2 users be able to update the CLI so that they can use newer bits?

I feel like the current design is too restrictive. Ideally risk of breaking due to roll-forward is more acceptable than forcing folks to use exact versions.

muratg avatar Apr 04 '16 21:04 muratg