Skip to content
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

WIP Make Paket work with dotnet cli preview3 #1977

Merged
merged 354 commits into from
Mar 15, 2017
Merged

WIP Make Paket work with dotnet cli preview3 #1977

merged 354 commits into from
Mar 15, 2017

Conversation

forki
Copy link
Member

@forki forki commented Oct 24, 2016

  • - Make "paket install" hook into MSBuild 15 / dotnet cli preview3 restore
  • - Make Paket restore it's own PaketRestoreTask.dll
  • - Do not emit dll references for MSBuild 15 projects
  • - Use magic mode
  • - Make everything work in ionide
  • - Make Paket create it's own Nuget.Config or hook into that in MSBuild
  • - Convert from Nuget should read / remvoe PackageReferences from *proj - (@theimowski ?)

Copy link
Member

@matthid matthid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

build.sh Outdated
exit_code=$?
if [ $exit_code -ne 0 ]; then
certificate_count=$(certmgr -list -c Trust | grep X.509 | wc -l)
if [ $certificate_count -le 1 ]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we might still need this, just later at the paket.exe call...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for p in g.NugetPackages do
let k = groupName,p.Name
if usedPackages.ContainsKey k then
failwithf "Package %O is referenced more than once in %s within group %O." p.Name referencesFile.FileName groupName
usedPackages.Add(k,p)

g.NugetPackages
|> List.iter (fun package ->
|> List.iter (fun package ->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?


namespace Paket.Build.Tasks
{
public class PaketRestoreTask : Task
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some crasy thinking: Would it make sense to think about extension points in paket?

Considering all those different use cases we might have soon (dotnetcore, toml, legacy, fable?) shouldn't we try to get things like these out of paket core into modules or something like that?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure. bringe them on

@forki
Copy link
Member Author

forki commented Oct 25, 2016

paketcore

@theimowski
Copy link
Member

Re convert - there's no packages.config anymore, but rather every dep is moved to *proj? Is it a 1-1 mapping?

@forki
Copy link
Member Author

forki commented Oct 25, 2016

It's looking like this now:

<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp1.0</TargetFramework>
  </PropertyGroup>
  <ItemGroup>
    <Compile Include="**\*.cs" />
    <EmbeddedResource Include="**\*.resx" />
  </ItemGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.NETCore.App">
      <Version>1.0.1</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.NET.Sdk">
      <Version>1.0.0-alpha-20161019-1</Version>
      <PrivateAssets>All</PrivateAssets>
    </PackageReference>
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

@theimowski
Copy link
Member

I can give it a try, but can take a week or two - little spare time right now

@forki
Copy link
Member Author

forki commented Oct 25, 2016

yeah don't worry. no need to hurry

@theimowski
Copy link
Member

which dotnet core build you're using? Is it 1.0.0-preview3-003884?
How to download that build @enricosada ?
I tried https://dotnetcli.blob.core.windows.net/dotnet/Sdk/rel-1.0.0/dotnet-dev-win-x64.1.0.0-preview3-003884.zip but that was a miss

With the latest dotnet (https://dotnetcli.blob.core.windows.net/dotnet/Sdk/rel-1.0.0/dotnet-dev-win-x64.latest.zip), when I try to repro your showcase, I get

image

@forki
Copy link
Member Author

forki commented Nov 1, 2016

@theimowski you must run paket install once before you can restore.

@theimowski
Copy link
Member

Thanks, that was the case. Also turns out, in latest dotnet core there's no more "3" suffix for commands https://github.com/dotnet/cli/issues/4205

@theimowski
Copy link
Member

I'm hacking around convert - pushing changes directly to this branch - is it fine with you?
What I'm struggling with is:
Paket failed with: Could not find versions for package Microsoft.NET.Sdk on any of ["https://www.nuget.org/api/v2"; "http://api.nuget.org/v3/index.json"].
which should probably work, as dotnet restore outputs: Feeds used: https://api.nuget.org/v3/index.json

@forki
Copy link
Member Author

forki commented Nov 3, 2016

Yes that's fine. Maybe we need another feed. @enricosada?

@forki
Copy link
Member Author

forki commented Nov 3, 2016

@enricosada
Copy link
Collaborator

https://github.com/dotnet/netcorecli-fsc/blob/master/examples/preview3/lib/NuGet.Config

Sent from mobile


From: Steffen Forkmann [email protected]
Sent: Thursday, November 3, 2016 7:39:01 AM
To: fsprojects/Paket
Cc: Enrico Sada; Mention
Subject: Re: [fsprojects/Paket] WIP Make Paket work with dotnet cli preview3 (#1977)

Yes that's fine. Maybe we need another feed. @enricosadahttps://github.com/enricosada?

You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com//pull/1977#issuecomment-258073022, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAI_Ky2zzbqroMH9hJjaaMg4EII-hfduks5q6YGFgaJpZM4Keq6C.

@enricosada
Copy link
Collaborator

Also the dotnet sdk feeds

https://github.com/dotnet/cli/blob/rel/1.0.0/NuGet.Config

Sent from mobile


From: Steffen Forkmann [email protected]
Sent: Thursday, November 3, 2016 1:01:30 PM
To: fsprojects/Paket
Cc: Enrico Sada; Mention
Subject: Re: [fsprojects/Paket] WIP Make Paket work with dotnet cli preview3 (#1977)

maybe https://github.com/dotnet/netcorecli-fsc/blob/master/examples/preview3/console/NuGet.Config#L4 ?

You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com//pull/1977#issuecomment-258124337, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAI_K0jDV_NNHdHqC9fEaNX8c47Jmw9_ks5q6c0agaJpZM4Keq6C.

@forki
Copy link
Member Author

forki commented Nov 3, 2016

@theimowski we can consume v3 API. just make sure all the nuget feeds are added to paket.deps and I think it's without the last part of the url

@theimowski
Copy link
Member

yeah sorry my fault - didn't spot last @enricosada comment. It seems it's resolving deps now with those 4 additional feeds, but taking ages...

@forki
Copy link
Member Author

forki commented Nov 3, 2016

@theimowski welcome to the brave new world of dotnet shipping via nuget

@theimowski
Copy link
Member

Huh...

c:\sandbox\core3paket (master)
λ paket convert-from-nuget --force
Paket version 4.0.0-alpha021
Adding Microsoft.NET.Sdk 1.0.0-alpha-20161026-2 to c:\sandbox\core3paket\paket.dependencies into group Main
Adding Microsoft.NETCore.App 1.0.1 to c:\sandbox\core3paket\paket.dependencies into group Main
Dependencies files saved to c:\sandbox\core3paket\paket.dependencies
Resolving packages for group Main:
 - Microsoft.NETCore.App is pinned to 1.0.1
 - Microsoft.NET.Sdk is pinned to 1.0.0-alpha-20161026-2
 - newtonsoft.json 9.0.1
 - ...
Locked version resolution written to c:\sandbox\core3paket\paket.lock
Downloading ...
Garbage collecting ...
34 minutes, 5 seconds - ready.

and that's for just 3 deps:

source https://www.nuget.org/api/v2
source https://api.nuget.org/v3/index.json
source https://www.myget.org/F/xunit/api/v3/index.json
source https://www.myget.org/F/netcorecli-fsc-preview3/api/v3/index.json
source https://dotnet.myget.org/F/dotnet-core/api/v3/index.json
source https://dotnet.myget.org/F/cli-deps/api/v3/index.json
nuget Microsoft.NET.Sdk 1.0.0-alpha-20161026-2 alpha
nuget Microsoft.NETCore.App 1.0.1
nuget newtonsoft.json

@forki
Copy link
Member Author

forki commented Nov 3, 2016

how fast is second update?

@theimowski
Copy link
Member

you mean running now paket install --force ?

@enricosada
Copy link
Collaborator

Cold cache.
The sdk and packages ship with .net core sdk package so usually is not a problem.

And other packages are from nuget.orghttp://nuget.org so faster.
It's possible to tweak the feeds, and use less big feeds.
Or create a new feed for paket-dev with mirror of useful packages.
Pretty much all are in nuget.orghttp://nuget.orgv (minus msbuild/xunit dev/fsharp.sdk)

Sent from mobile


From: Tomasz Heimowski [email protected]
Sent: Thursday, November 3, 2016 2:13:18 PM
To: fsprojects/Paket
Cc: Enrico Sada; Mention
Subject: Re: [fsprojects/Paket] WIP Make Paket work with dotnet cli preview3 (#1977)

Huh...

c:\sandbox\core3paket (master)
? paket convert-from-nuget --force
Paket version 4.0.0-alpha021
Adding Microsoft.NET.Sdk 1.0.0-alpha-20161026-2 to c:\sandbox\core3paket\paket.dependencies into group Main
Adding Microsoft.NETCore.App 1.0.1 to c:\sandbox\core3paket\paket.dependencies into group Main
Dependencies files saved to c:\sandbox\core3paket\paket.dependencies
Resolving packages for group Main:

  • Microsoft.NETCore.App is pinned to 1.0.1
  • Microsoft.NET.Sdk is pinned to 1.0.0-alpha-20161026-2
  • newtonsoft.json 9.0.1
  • ...
    Locked version resolution written to c:\sandbox\core3paket\paket.lock
    Downloading ...
    Garbage collecting ...
    34 minutes, 5 seconds - ready.

and that's for just 3 deps:

source https://www.nuget.org/api/v2
source https://api.nuget.org/v3/index.json
source https://www.myget.org/F/xunit/api/v3/index.json
source https://www.myget.org/F/netcorecli-fsc-preview3/api/v3/index.json
source https://dotnet.myget.org/F/dotnet-core/api/v3/index.json
source https://dotnet.myget.org/F/cli-deps/api/v3/index.json
nuget Microsoft.NET.Sdk 1.0.0-alpha-20161026-2 alpha
nuget Microsoft.NETCore.App 1.0.1
nuget newtonsoft.json

You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com//pull/1977#issuecomment-258138209, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAI_K9Y8SIJz7RD4mHY04te9cYIkm5IXks5q6d3ugaJpZM4Keq6C.

@forki
Copy link
Member Author

forki commented Nov 3, 2016

@theimowski no --force would take same time (since it skips cache). just run paket update

@theimowski
Copy link
Member

theimowski commented Nov 3, 2016

56 seconds - ready.
much better ;)

How does it work now? Paket downloads the nupkgs to ./packages dir and then copies them to %HOME%.nuget.packages ?
Or do we somehow tell dotnet to take deps from "./packages"?

@forki
Copy link
Member Author

forki commented Nov 3, 2016

Currently we download to both locations.

Am 03.11.2016 14:27 schrieb "Tomasz Heimowski" [email protected]:

56 seconds - ready.
much better ;)

How does it work now? Paket downloads the nupkgs to ./packages dir and
then copies them to %HOME%.nuget.packages ?
Or do we somehow tell dotnet to take deps from "./packages"?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#1977 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AADgNHaPgRs3i1f177zqcLHIDX96qRnBks5q6eEzgaJpZM4Keq6C
.

@enricosada
Copy link
Collaborator

enricosada commented Nov 4, 2016

ok i started the work in #2004
so Paket.Core is ok atm, working on Paket

@forki forki merged commit e198b7f into master Mar 15, 2017
@matthid matthid deleted the core3 branch May 6, 2017 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants