Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Probe paths #2039

Merged
merged 2 commits into from
Apr 15, 2017
Merged

Probe paths #2039

merged 2 commits into from
Apr 15, 2017

Conversation

ramarag
Copy link
Member

@ramarag ramarag commented Apr 12, 2017

The host passes the provided probing paths to AppContext and these can be queried by the DependencyModel when it is resolving the assemblies

@ramarag
Copy link
Member Author

ramarag commented Apr 12, 2017

@gkhanna79 @eerhardt PTAL

@eerhardt
Copy link
Member

Fixes #624 and dotnet/sdk#1002

@@ -24,8 +24,8 @@ public void ShouldUseEnvironmentVariableToGetDefaultLocation()
.AddVariable("NUGET_PACKAGES", PackagesPath)
.Build();

var result = PackageCompilationAssemblyResolver.GetDefaultPackageDirectory(Platform.Unknown, environment);
result.Should().Be(PackagesPath);
var result = PackageCompilationAssemblyResolver.GetDefaultProbeDirectories(Platform.Unknown, environment);

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.


if (!string.IsNullOrEmpty(listOfDirectories))
{
return listOfDirectories.Split(new char [] {Path.PathSeparator}, StringSplitOptions.RemoveEmptyEntries );

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@@ -60,7 +60,7 @@ public void ResolvesAllAssemblies()
.Build();
var library = F.Create(assemblies: F.TwoAssemblies);

var resolver = new PackageCompilationAssemblyResolver(fileSystem, PackagesPath);
var resolver = new PackageCompilationAssemblyResolver(fileSystem, new string[] {PackagesPath});

This comment was marked as spam.


if (!string.IsNullOrEmpty(packageDirectory))
{
return new string[] {packageDirectory};

This comment was marked as spam.

var packageDirectory = environment.GetEnvironmentVariable("NUGET_PACKAGES");
#if !NETSTANDARD1_3
#if NETSTANDARD1_6
var probeDirectories = AppContext.GetData("PROBING_DIRECTORIES");

This comment was marked as spam.

}

public bool TryResolveAssemblyPaths(CompilationLibrary library, List<string> assemblies)
{
if (string.IsNullOrEmpty(_nugetPackageDirectory) ||
if (_nugetPackageDirectories == null || _nugetPackageDirectories.Length < 1 ||

This comment was marked as spam.

return new string[] {packageDirectory};
}

string basePath;

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

pal::string_t deps_resolver_t::get_probe_directories()
{
pal::string_t directories;
for (const auto& pc : m_probes)

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@mlorbetske
Copy link

Do we think we'll be able to get this in in time for this to be depended on for the assemblies that go in the ASP.NET package cache tomorrow? /cc @Eilon

@danroth27 danroth27 added the blocking Marks issues that we want to fast track in order to unblock other important work label Apr 14, 2017
@ramarag ramarag force-pushed the probe_paths branch 2 times, most recently from bef8155 to 22544db Compare April 14, 2017 23:24
@gkhanna79
Copy link
Member

@ramarag have you looked at the non-Windows failures above?

@ramarag
Copy link
Member Author

ramarag commented Apr 15, 2017

@gkhanna79 non windows builds apart from portable linux are not producing packages for Microsoft.Extensions.DependencyModel. Is it explicitly disabled for non-windows ?

@gkhanna79
Copy link
Member

I vaguely recall so.

@ramarag
Copy link
Member Author

ramarag commented Apr 15, 2017

2 options here:

  1. Find how the packaging is disabled and enable it, Is there a reason it is disabled?
  2. Check in without the end to end functional test

@ramarag
Copy link
Member Author

ramarag commented Apr 15, 2017

@dotnet-bot test Ubuntu x64 Release Build

@gkhanna79
Copy link
Member

gkhanna79 commented Apr 15, 2017 via email

@ramarag
Copy link
Member Author

ramarag commented Apr 15, 2017

done

@ramarag ramarag merged commit be235df into dotnet:master Apr 15, 2017
@mikeharder
Copy link

This issue is blocking ASP.NET so we are eager to test the fix. Which build of the SDK and/or Runtime should have this fix?

@Petermarcu
Copy link
Member

Looks like the last good build of the runtime was the commit right before this and the subsequent ones failed with what looks like infra issues. I just kicked off another build. Hopefully it will be green.

@Petermarcu
Copy link
Member

Petermarcu commented Apr 17, 2017

The build I kicked off completed with these changes in it. You can grab the latest from here: https://github.com/dotnet/core-setup . Note this is a runtime build. Not sure when it will get into the SDK but should be able to happen quickly.

@mikeharder
Copy link

The ASP.NET build fetches the latest runtime version from https://dotnetcli.blob.core.windows.net/dotnet/master/dnvm/latest.sharedfx.win.x64.version, which still contains build 2013. We can workaround this in the ASP.NET build for now.

@mikeharder
Copy link

The latest version of Microsoft.NETCore.App at https://dotnet.myget.org/feed/dotnet-core/package/nuget/Microsoft.NETCore.App is also 2013, so I don't think there's any workaround.

@rakeshsinghranchi
Copy link
Member

There seems to be issue with build Finalize step where packages are pushed to NuGet Feed and update the latest version. However,all the latest build artifacts are available in Azure blob storage. You can find the latest build from
http://dotnetcli.blob.core.windows.net/dotnet/master/Binaries/2.0.0-preview1-002020-00/Microsoft.NETCore.App.2.0.0-preview1-002020-00.nupkg . Let me know if this unblocks you for now.

@mikeharder
Copy link

mikeharder commented Apr 17, 2017

If the issue with the finalize step can be resolved tomorrow we would rather wait. The ASP.NET build relies on the MyGet feed and it would be some work to change this.

@danroth27
Copy link
Member

I just installed the latest CLI, but I'm still seeing this issue:

~\Desktop\templates2\WebApp2> dotnet --info
.NET Command Line Tools (2.0.0-preview1-005815)

Product Information:
 Version:            2.0.0-preview1-005815
 Commit SHA-1 hash:  a150055dfb

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.14393
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\2.0.0-preview1-005815\

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.0-preview1-002021-00
  Build    : e9456614cfe65b6dc7c5326a597337159142c84c
~\Desktop\templates2\WebApp2> dotnet new mvc
...
The template "ASP.NET Core Web App" was created successfully.
...
Restore succeeded.
~\Desktop\templates2\WebApp2> dotnet run

Unhandled Exception: System.InvalidOperationException: Can not find compilation library location for package 'Microsoft.NETCore.App'

@ramarag
Copy link
Member Author

ramarag commented Apr 19, 2017

@danroth27 please check the version of Microsoft.Extensions.DependencyModel, it should be at least 2.0.0-preview1-002021 for this feature to kick in.

You can find the version in the generated app.deps.json

@danroth27
Copy link
Member

Ah, I'm actually getting the 1.1.0 version of that package. Looks like this is being cased by a bad dependency in MVC:

      "Microsoft.AspNetCore.Mvc.Core/2.0.0-preview1-final": {
        "dependencies": {
          "Microsoft.AspNetCore.Authorization": "2.0.0-preview1-final",
          "Microsoft.AspNetCore.Hosting.Abstractions": "2.0.0-preview1-final",
          "Microsoft.AspNetCore.Http": "2.0.0-preview1-final",
          "Microsoft.AspNetCore.Mvc.Abstractions": "2.0.0-preview1-final",
          "Microsoft.AspNetCore.ResponseCaching.Abstractions": "2.0.0-preview1-final",
          "Microsoft.AspNetCore.Routing": "2.0.0-preview1-final",
          "Microsoft.Extensions.DependencyModel": "1.1.0",
          "Microsoft.Extensions.FileProviders.Abstractions": "2.0.0-preview1-final",
          "Microsoft.Extensions.Logging.Abstractions": "2.0.0-preview1-final",
          "Microsoft.Extensions.PlatformAbstractions": "2.0.0-preview1-final",
          "NETStandard.Library": "2.0.0-preview1-25211-01",
          "System.Buffers": "4.3.0",
          "System.Diagnostics.DiagnosticSource": "4.4.0-preview1-25205-01"
        },

@eerhardt
Copy link
Member

eerhardt commented Apr 19, 2017

Yes, MVC will have to update its dependency to Microsoft.Extensions.DependencyModel to be the latest 2.0.0 build. It looks like it did according to https://dotnet.myget.org/feed/aspnetcore-ci-dev/package/nuget/Microsoft.AspNetCore.Mvc.Core. The latest builds have a dependency to the new DependencyModel version.

An optional workaround, in the meantime, is to add <PackageReference Include="Microsoft.Extensions.DependencyModel" Version="2.0.0-preview1-*" /> to your .csproj.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
blocking Marks issues that we want to fast track in order to unblock other important work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants