-
Notifications
You must be signed in to change notification settings - Fork 525
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
Proper runtime support #2255
Proper runtime support #2255
Conversation
OK this is crazy. If I got that correct some nuget packages can specify additional dependencies for a specific runtime in a file called
This means Paket needs to restore How do we do that in paket? I don't want to change the current resolver (as it is complicated enough). For now I'd try to implement this as a second phase (after regular restore has happened). This means that paket will ignore any @forki please advise if that sounds like going into the wrong direction... |
Runtime.json is a brain fart. I never understood what people were thinking
to implement that hack.
Am 17.04.2017 16:13 schrieb "Matthias Dittrich" <[email protected]>:
… OK this is crazy. If I got that correct some nuget packages can specify
additional dependencies for a specific runtime in a file called
runtime.json.
This looks like:
"runtimes": {
"win": {
"Microsoft.Win32.Primitives": {
"runtime.win.Microsoft.Win32.Primitives": "4.3.0"
},
This means Paket needs to restore runtime.win.Microsoft.Win32.Primitives
(which is not known through the regular dependency tree) to support the
"win" rid (or any rid importing "win").
How do we do that in paket? I don't want to change the current resolver
(as it is complicated enough). For now I'd try to implement this as a
second phase (after regular restore has happened). This means that paket
will ignore any runtime.json in the second layer (but doing this is
insanity IMHO anyway)...
@forki <https://github.com/forki> please advise if that sounds like going
into the wrong direction...
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2255 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADgNBBzS0ndDDx5WsR1NfVA1arInvt9ks5rw3OVgaJpZM4M_IIr>
.
|
And now what? |
Ok this is an interesting start. I think I'll do the integration in the following way:
This way restore doesn't need to be changed at all and the new packages will be in the regular resolution (I guess I need a new flag in the lockfile to "detect" if a package is in the regular resolution or if its picked because of runtime). Still not sure if the default should be installing all packages for all runtimes OR no runtime at all. Currently I'm favoring all runtimes... |
I'm not sure that it should default to installing for all runtimes (there are a ton of them) and in the absence of a specified runtime, isn't the default behavior to produce a |
@@ -63,6 +63,11 @@ | |||
<FSharpTargetsPath>$(MSBuildProgramFiles32)\Microsoft SDKs\F#\4.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath> | |||
</PropertyGroup> | |||
</When> | |||
<When Condition="$(TargetFSharpCoreVersion) >= 4.4.1.0 AND $(TargetFSharpCoreVersion) < 4.4.1.0 "> |
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.
These kinds of conditions don't work with xbuild, it's ridiculous that they don't and I'd rather write them this way too, but they end up causing more headaches than they're worth.
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.
Maybe once mono 5.0 drops (replacing xbuild with msbuild 15 by default) this can be considered, though
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.
The target F# core version is a lot less useful when you're actually relying on paket and the fsharp.core nupkg to determine the version you're using
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.
the travis build worked ...
Yes, but I'm not sure how they handle native dependencies in that case. From observing I'd say they ignore runtime deps (as in runtime.json) but they still copy stuff in the regular resolution.... |
@@ -0,0 +1,185 @@ | |||
namespace Paket | |||
|
|||
open Domain |
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.
@matthid can you add some doccoms for the functions in this file? I already know i'll have forgotten what half of this does in a few days
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.
Yes, I added some with c71d62b
RuntimeDependencies = dependencies } | ||
| _ -> failwithf "unknwn stuff in runtime-description: %O" t.Value ] | ||
|
||
let readRuntimeGraphJ (json:JObject) = |
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.
@matthid do you think it's possible to generalize this json graph structure a bit so we can use it to create the project.assets.json
file as well?
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.
can you link an example?
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.
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.
No I don't we should generalize here. But of course that info helps in generating those files as well.
Why do we need runtime in deps file? Shouldn't it just install the runtime we just use? |
Good point. But do you really want to read the fsproj file for info and then use that for resolving packages? What about multiple or no fsproj file? csproj? What about "old-style" fsproj? I don't even want to go into that. At least not in the first step (this PR) tbh... |
No not fsproj. I meant the following: install should lock everything, but
restore only needs to download the stuff for the target it currently runs
on
Am 18.04.2017 9:57 vorm. schrieb "Matthias Dittrich" <
[email protected]>:
… Why do we need runtime in deps file? Shouldn't it just install the runtime
we just use?
Good point. But do you really want to read the fsproj file for info and
then use that for resolving packages? What about multiple or no fsproj
file? csproj? What about "old-style" fsproj? I don't even want to go into
that. At least not in the first step (this PR) tbh...
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#2255 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADgNKu_EtBNZguqU3z1dOtXdN3NvOOnks5rxGzZgaJpZM4M_IIr>
.
|
What is "the target it currently runs on"? |
The OS if the machine |
And what if I run on windows and want to publish my project for unix? |
Hook in restore into dotnet publish?
Am 18.04.2017 10:05 vorm. schrieb "Matthias Dittrich" <
[email protected]>:
… And what if I run on windows and want to publish my project for unix?
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#2255 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADgNDXTGRqOVFJszMB1nnuBQsKjuzsBks5rxG6ygaJpZM4M_IIr>
.
|
So its the same problem you do another resolver step on "restore" to resolve the runtime deps. I think in pakets philosophy we should have already done that at that phase (IMHO) ... But it's up to you |
I'd prefer the following when we get called by dotnet restore with an unknown runtime:
|
No not resolver. Only restore
For resolving (during install/update) we would check everything.
Am 18.04.2017 10:12 vorm. schrieb "Matthias Dittrich" <
[email protected]>:
… I'd prefer the following when we get called by dotnet restore with an
unknown runtime:
- If in CI/noninteractive mode we fail when a runtime is not in the
deps file and we are called
- In interactive mode we ask the user if we should update the deps
file and do an "install"
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#2255 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADgNBBZI-zOeeITT8XoXemUczSaenIgks5rxHB8gaJpZM4M_IIr>
.
|
@forki So we always resolve and lock every runtime down (during install/update). I'm fine with that, lets see how that works. But isn't install/update currently downloading the packages as well? Why would we change the behavior for the runtime deps? I agree that our hook can have this behavior to only download whats needed. It is really confusing, and I don't know if there is a good way how this fits into our world view... |
It does not fit our world view. That's the whole point. |
[<assembly: AssemblyInformationalVersionAttribute("4.4.0")>] | ||
[<assembly: AssemblyVersionAttribute("4.4.1")>] | ||
[<assembly: AssemblyFileVersionAttribute("4.4.1")>] | ||
[<assembly: AssemblyInformationalVersionAttribute("4.4.1")>] |
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.
@forki one suggestion across all your projects. Can you commit this immediately when you release (at the same time when you change release notes)? This way this doesn't always pop-up and makes merge conflicts.
Another way would be to gitignore
those files and having only a default version (like 0.0.0.0) checked in for Visual Studio users...
| [ a; b ] -> k, f a b | ||
| [ a ] -> k, a | ||
| _ -> failwithf "This should never happen") | ||
|> Map.ofSeq |
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.
Is there really no build-in function for that?
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.
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.
@0x53A thanks :)
…eDependency: true'
assert (optionsString = "isRuntimeDependency: true") | ||
true, "" | ||
else false, optionsString | ||
parts.[0],isRuntimeDependency,InstallSettings.Parse(optionsString) |
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.
Maybe the parser and generator code should be cleaned up a bit in the future...
Part of #2256 but extra PR to make it easier to review.