-
Notifications
You must be signed in to change notification settings - Fork 252
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
dotnet restore
should have an option for the runtimes to restore
#2534
Comments
This is by design, we had I would be in favor of reviving |
@anurse that seems reasonable. It would return consistency with other |
By the way, the lack of this trim-down functionality is causing serious issues for CLI. During x64 builds we don't have access to x86 packages and thus are unable to do a local package restore of the NetCoreApp metapackage. Could this issue get fixed soon so we don't go too far down the path of workarounds? |
@piotrpMSFT I would fix your build, rather than force this issue through right now. You should have access to all packages on the feeds. |
This is not the case. The packages are getting built during the same build that is consuming them.
The issue isn't dotnet/cli's build. The issue is any repo that tries building native and managed assets. The CLI isn’t a special case. There can and will be plenty other teams/repos/etc that will be building native and managed code together. We do it in CoreFX and CoreCLR too. I can imagine many of our customers will have native libraries that they want to build in harmony with their managed code/apps. When doing a full build of a repo, it needs to build the native assets, which are architecture specific. After the native assets, other projects are going to consume the "runtime" packages built during the native part of the build. However, the way Putting the RIDs in the project.json file (and having to restore all RIDs at the same time) makes it even worse. How can I build osx, ubuntu and windows native assemblies during my single build on a single machine? The ask is to have a way to tell |
Does this mean that I have to list all supported runtimes in my project.json even if I have portable code that will run on any runtime that supports the given netstandard? If it is the case, it looks pretty broken to me. |
I do agree here |
This might be crazy, but it seems to me like |
This is indeed an eventual goal (take a "portable" project and publish for On Wed, Apr 27, 2016 at 4:07 PM, Davis Goodin notifications@github.com
Cheers, |
We need a lock file per runtime instead of listing all targets in a single lock file. That way publish can just run restore for that specific RID |
I just hit this today. I have an application that targets .NET 4.61 as well as .NET Core. Today I had to add a nuget.config file because "dotnet restore" on a tiny Linux worker node is pulling down all the Windows binaries, then failed trying to talk to the overloaded MyGet server attempting to pull down a different Windows-only binary that's clearly referenced as a net461-only dependency in project.json. This was unexpected behavior for a number of reasons but at a minimum I expected to find a dotnet restore -r option that matches the dotnet publish -r option. As an aside "dotnet restore" appears to have a hardcoded 60 second timeout for package retrieval. Not sure when that would be optimal or desirable. |
Currently
dotnet restore
supports two modes for restoring runtime assets.--infer-runtimes
, which is a temporaryIf you don't have a "runtimes" section in your project.json,
dotnet restore
will do a "RID-less" restore, which means that it is impossible to publish your app as a stand-alone (i.e. not portable) .NET Core app. Publishing a stand-alone app needs to have a runtime restored.However, if you call
dotnet restore --infer-runtimes
, it will infer too many runtimes. For example, on a Windows x64 machine, it will infer both x64 and x86. This is broken because:To solve these problems, I propose we add a new option to
dotnet restore
:-r --runtimes
that takes a list of RIDs to restore. Going one step further, there can be a "use the current RID" (and only the current RID), so I don't need to find what the current RID is. I just calldotnet restore --runtimes current
and it does a restore for "win7-x64" if I'm on windows x64, "rhel.7-x64" if I'm on Red Hat, etc.The text was updated successfully, but these errors were encountered: