-
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
Bootstrapper magic mode & run #1961
Conversation
When this parameter is present the boostraper run paket.exe after downloading it. It also ignore all parameters after --run and pass them back to paket.exe
If the bootstraper is renamed to paket.exe it download the real paket.exe to the temporary folder instead. In addition if --run isn't specified on the command line it act as if it was passed and run paket.exe with all the arguments it received. The result is that it produce a paket.exe of 47Ko that act like the normal one (As long as an internet connection is available)
* As Process.Start isn't powerful enough to support our scenario PInvoke is used on both windows and unix to get the functionality of running a subprocess while keeping the console. * The bootstraper now get an icon, only a low resolution one but it look a little nicer.
Sad but 6KB on a 48KB executable is too much for an icon
Still WIP as the console ends up slightly corrupted on MacOSX, don't know if it's fixable. |
The code is tested on "Ubuntu on Windows" and i'll validate it also on MacOSX Sierra.
I think this PR is ready for being tested/checked @forki . It should be labeled as "alpha" or something like that until it's tested on more platforms / by more people. I had some problems on mono/unix but I think they are now solved with the latest commit working without problems on the systems I have access to. If anyone is interested in the murky little details Tested on:
|
Oh nice, lemme give this a spin on my own and windows boxen |
With the PR should we also update the paket.targets to use the new paket.exe convention? The paket.targets that get pulled in on init now also pull in another copy of the bootstrapper, which is redundant if the user has paket.bootstrapper.exe renamed in their solution/project root. |
@baronfel Ah yes I forgot about that feature :) A lot of things can be solved with the main executable knowing (via an argument) that it was started from a bootstraper already. I'll add that to the PR. |
Do you think it's ready for alpha release? Can you please add a bit of docs? |
Yes I think it's ready. When merged the version in PaketRunner might need adjustment but that's all. Regarding docs I documented it in the doc about bootstraper. |
thx I released it in alpha! |
can we get alpha versions of paket in magic mode? |
Yes you can but can't ask for "prerelease" in general you must specify a version for now. Even in magic mode the .config file is still supported for that, creating a <?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="PaketVersion" value="3.24.0-alpha002"/>
</appSettings>
</configuration> Will use the current alpha. If the magic mode is really useful and used a lot I was thinking to move paket version specification in
|
yes that would be awesome |
what I would need right now is a setting in appsettings that will take latest alpha |
Is it the recommended way to use it? Or is it advised to keep the bootstrapper, once renamed, in the Or perhaps update the lines at the beginning of
to verify if we use it as "magic mode" otherwise, continue as usual... (solution tested and that seems to work) |
@pmiossec for now i'd recommend to keep it in .paket for compatibility. Thanks for the .targets fix :) As I like having paket.exe in the root i'll continue to fix small details in this mode but I don't know if it'll ever be the recommended / default way 😸 (Magic mode itself might become the recommended / default in v4) |
It's now possible to do that with the magic mode and as disussed in fsprojects#1961 the targets file should support it
It's now possible to do that with the magic mode and as disussed in fsprojects#1961 the targets file should support it
Bootstraper Magic mode (And also
--run
but that's boring)It add 2 features to the bootstraper:
--run
when passed all arguments after it are ignored and whenpaket.exe
is downloaded it's started with the remaining argumentspaket.exe
behave just like it !--run
--run
is really passed, pass all it's arguments topaket.exe
as-is--max-file-age=720
)The end result is that the bootstraper paket.exe can be placed at the root of a repository avoiding the need of shell scripts, cmd scripts or even a .paket folder.
The "first time user" experience is also much better : place
paket.exe
in solution root thenpaket init
. You can commit it, it's small and keep itself up-to-date.PS: The bootstraper gain 4KB moving from 39KB to 43KB