Paket depends now on .NET framework (win) and mono (unix/mac).
This is really good because the normal paket.exe console app can run xplat if mono/.net is installed.
For some scenario, like .net core development (or fable) with new dotnet/sdk (new csproj/fsproj), the mono/.net shouldnt be needed.
To remove that deps of paket in these scenario there are some points to address:
net/netcore) because old sdk project can also use .net core based paketAtm ihmo boostrapping and auto-updates are the real issue
Paket nuget both paket .net core FDD (in tools/netcoreapp2.0) and paket .net fw (in tools/net451)paket in PATHOptions are:
dotnet paket.dll, so require a wrapper script to execute for UX (paket.cmd/paket.sh)dotnet? is the right version installed?dotnet paketpaket.cmd/paket.sh)File size:
| | DotnetCliTool | FDD | SCD |
|--|---|---|--|
| File Size | 0,1 MB | 1MB | 60 MB |
| Requirements | .net sdk + runtime + runtime deps (120MB) | .net core runtime + runtime deps (60mb) | .net core runtime deps (native pkg) |
paket is a strange tool, because atm for restore process, need to be there BEFORE the restore.
or at least a target file to override default nuget implementation in dotnet/sdk
instead old sdk require the exe to restore/update projs
But lots of challenges are shared with normal tools in .net ecosystem
There is no builtin per repo tools. or a way to script (like an fsx).
AFAIK the most similar to per repo tools are the cli tools or the FDD.
AFAIK the most similar to script is an msbuild target + optional task in assembly
How now .net sdk support external tools? or custom execute code xplat.
dotnet new + override Program.cs + dotnet publishOther package manager expect the dev sdk installed, and use that to boostrap:
My current ideas, not in preference order.
support tools at repo level natively in dotnet/sdk. ref https://github.com/dotnet/cli/issues/4723
PRO:
CONS:
Why: paket deps doesnt change a lot. paket does.
like now, using native app (SCD) but smarter update mechanism
dotnet msbuild (target + dll), to just download paket.boostrapper.exePRO:
net version like now, if want to support that tooCONS:
Why: support and enhance .net cli tools. use that support for paket itself.
Add support of repo level tools to paket and .net cli tools. Use a built paket native (SCD) to boostrap paket (replace previous paket.boostrapper.exe).
The chicked/egg solution.
dotnet-fable), so small and easy to pack/versionpaket.depencies who contains paket-cli as tooldotnet fable) just invoke dotnet with args and a file with deps. paket generate these args/files neededdotnet hello tool can be invoked as hello. and paket as paketdotnet msbuild to just download native paket per OSPRO:
dotnet fable as fable. will work in whole repo not just the proj dir.CONS:
boostrapper paket schedule <> paket schedule, so doesnt need to update often. more maintance.Atm i prefer plan C, while is longer than B to implement, add a lot more value with less maintenance long term.
Plan A is ok, but doesnt help paket in medium term, because cannot replace current way.
as a note, i volounteer to implement the choosen solution. if someone want to help, will be nice, because tasks can be split
Is there a way to put bootstrapper directly into sdk?
Is there a way to put bootstrapper directly into sdk?
yes that's another way. two options afaik:
Technically, yes. we have done that for fsharp.net.sdk, and put inside sdk is just a packaging thing (cli/sdk build script restore a pinned package and unzip in release dir).
But depends if .net cli/sdk team want to do that.
For example with fsharp.net.sdk, was just possibile to put in dotnet cli, but not in nuget packages distribuited in the sdk installed with VS because of policy. so it will had worked with dotnet sdk (the cli) but not in msbuild bundled with VS. This was strange because some package were there, like newtonsoft or others by aspnet deps, but that it.
Issue is, if there is an error in boostrapper, you need another release of sdk to fix that (and just sdk team can schedule that).
Another possibility, the real issue, is if Sdk attribute can be extended, like by restored packages.
that is the real extensibility paket need afaik.
So will be possibile to use like Sdk="Paket.Sdk;Microsoft.NET.Sdk".
Is somewhat tracked in https://github.com/Microsoft/msbuild/issues/1493 but is now stalled afaik, because noone in MS need that (they can just continue to bundle things..)
Both mean will work only with new msbuild/cli/sdks versions.. and given the churn in sdk tooling and the need for stability, ihmo is not going to be implemented soon..
ok, dotnet cli is adding tools (sdk scooped) in v2.2 (ref https://github.com/dotnet/cli/issues/8067 )
we can use that later for boostrapper. meanwhile need another options for that
And paket can manage tools too, because should be easy. adding per repo tools (who can be used to self-update itself, if the boostrapper is just paket)
the tools are just .net core fdd app published in the tools/netcoreapp2.1 dir of a nupkg.
ref a nuspec
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>global.tool.console.demo</id>
<version>1.0.4</version>
<description>test app</description>
<authors>testauthor</authors>
</metadata>
<files>
<file src="bin\Release\netcoreapp2.1\publish\*.*" target="tools\netcoreapp2.1\" />
<file src="DotnetToolsConfig.xml" target="tools\DotnetToolsConfig.xml" />
</files>
</package>
and an xmlfile to read the entry points, so commands can be renamed and multiple
<?xml version="1.0" encoding="utf-8" ?>
<DotNetCliTool>
<Commands>
<Command Name="demo" EntryPoint="consoledemo.dll" Runner="dotnet" />
</Commands>
</DotNetCliTool>
For interested ppl, there is a demo version on a ready to use repository ( more info https://github.com/fsprojects/Paket/pull/2918#issuecomment-351434648 ).
is ok to beta test (just the boostrapper require mono atm, but is temporary)
based on the PR wip, will be updated
By @0x53A in https://github.com/fsprojects/Paket/issues/2418#issue-235527842
MSBuild will add a package-based SDK resolving mechanism.
MSBuild spec: https://github.com/Microsoft/msbuild/issues/1493
NuGet work item: https://github.com/NuGet/Home/issues/5220
There is nothing to do at the moment - but as soon as NuGet actually implements this stuff, we should also start so we don't hang behind.
From the empty checklists in both issues, I would expect this to land in 16.0 maybe.
The important question is how the resolving works when we don't control the host (VS or Rider, or VS Code, ...).
Can we pass-in our paket resolver, or will VS always hardcoded use the NuGet resolver?
Just a sanity check. Currently it is not possible to use only dotnetcore with Paket? You need to have .net framework or mono installed?
yes to run paket you still need that. but @enricosada is working on it...
ok, new WIP of install flow (maintaingn bootstrapper or not) in https://github.com/fsprojects/Paket/pull/3183 based on sdk tools ( .net core sdk >= 2.1.300 ).
Any changes to this recently?
@aggieben yes, latest (just today, i was working on it these days), is in https://github.com/enricosada/paket-netcore-testing-as-tool/
should be somewhat done (minus known bugs). please review the PR
@enricosada @forki this seems to be done now that it can be used via dotnet tool install paket -g. Should this issue remain open for any reason?
The -g is global, not per repo.
It鈥檚 not the final solution to the problem
True, you can choose not to install it globally and use --tool-path to do it just in your repo. What else is needed for the solution you have in mind?
Hi @enricosada @ninjarobot
Is there a status update and/or getting-started guide for using Paket without either .NET Framework or Mono installed? The current docs all talk heavily about "paket.exe" and I'm wondering if we need to do a refresh?
Thanks!
don
@dsyme Atm i think not, because with .net core sdk 2.0 there were some issues to install paket locally in the repo (-g doesnt matter because the build is not deterministic) supporting all scenarios (dotnet restore, paket restore, bootstrapping, versioned etc)
if really needed, afaik like https://github.com/enricosada/paket-netcore-testing-as-tool/ works sort of, but i dont reccoment it yet.
I am playing with .NET Core sdk 3.x who support local tools (two preview ago wasnt ok), i'll send a PR soon and that probably will be ok to use, based on prior experience with paket-netcore-testing-as-tool repo
Given that nuget is much less reproducible, I still think it is worth people using paket as a .NET Core tool rather than having only nuget or paket+mono (with a few HTTP client issues).
What are the specific issues @enricosada?
Hi,
First of all - thanks for your great work, Paket team!
I've just stumbled upon this problem - I was trying to run paket with only .net core installed. Was there any recent progress on this one?
You should be installing paket as a .net sdk tool. If you do, it fits right into a dotnet SDK based pipeline:
dotnet new tool-manifest
dotnet tool install paket
dotnet paket init
dotnet restore
dotnet build
dotnet publish
This is how I use it with all of my work and OSS packages, and it works great.
I should clarify here that this workflow is complete mono/.net framework-free, relying only on having dotnet sdk 3.0 or greater.
It was supposed to be dotnet tool install paket, right? Sorry, I'm still new to the .net ecosystem...
Yeah, that's right. I'll edit my answer to be correct :)
Most helpful comment
yes to run paket you still need that. but @enricosada is working on it...