getporter / porter

Porter enables you to package your application artifact, client tools, configuration and deployment logic together as an installer that you can distribute, and install with a single command.
https://porter.sh
Apache License 2.0
1.23k stars 206 forks source link

Ensure that Windows users can build Porter #115

Closed jeremyrickard closed 2 years ago

jeremyrickard commented 5 years ago

We should ensure (and document how) Windows users can build Porter and contribute.

Implementation Notes:

itowlson commented 5 years ago

Output of make build I currently get after doing a clean build on a fresh copy of the repo at commit 91f8231a50:

The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
make[1]: Entering directory `D:/GoProjects/src/github.com/deislabs/porter'
mkdir -p bin/mixins/porter
The syntax of the command is incorrect.
make[1]: *** [build-client] Error 1
make[1]: Leaving directory `D:/GoProjects/src/github.com/deislabs/porter'
make: *** [build-client] Error 2
carolynvs commented 5 years ago

Is the goal to have this work on WSL or also powershell?

itowlson commented 5 years ago

I would like a Windows EXE build so I can invoke it from VS Code (which I have not tried running under WSL but which I will bet you a shiny groat no TWO shiny groats will not work). If the build has to happen in WSL rather than Windows/PS then so be it as long as what comes out is a Windows EXE... but things like Duffle build under Windows/PS (with make etc. installed) so it would be good to have parity.

carolynvs commented 5 years ago

Gotcha, then a Windows/PS compatible makefile you shall have! 🙇‍♀️

In the meantime, the CI builds churn out EXE's, you can grab them from:

https://deislabs.blob.core.windows.net/porter/canary/install-windows.ps1

See https://porter.sh/install/#windows for full install instructions and a PS instructions on Windows.

That link is for the canary build which is fresh from master, no waiting for a new tagged release. Otherwise change the URL to use latest if you want stable releases.

itowlson commented 5 years ago

Whoa, well that is even easier than building it in Windows! Thank you!

carolynvs commented 5 years ago

So sorry that I didn't share that sooner! When in doubt, yell and gesture wildly and demand that I live up to your expectations, @itowlson. 💖

itowlson commented 4 years ago

Tried to build from source just now because I wanted to send a PR, and got this output:

D:\GoProjects\src\github.com\deislabs\porter [master ≡ +0 ~1 -0 !]> make build install
process_begin: CreateProcess(NULL, command -v packr2, ...) failed.
process_begin: CreateProcess(NULL, command -v dep, ...) failed.
process_begin: CreateProcess(NULL, command -v ajv, ...) failed.
curl -SLo /tmp/packr.tar.gz https://github.com/gobuffalo/packr/releases/download/v2.6.0/packr_2.6.0_windows_amd64.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   622    0   622    0     0    622      0 --:--:-- --:--:-- --:--:--   925
100 3407k  100 3407k    0     0  1135k      0  0:00:03  0:00:03 --:--:-- 1346k
cd /tmp && tar -xzf /tmp/packr.tar.gz
install /tmp/packr2 D:\GoProjects/bin/
Enter the absolute path where the zip file is extracted/copied to:

(at this point the build stopped and waited for me to enter something, which I had no idea what to enter so I just hit return)

ERROR: Access to the registry path is denied.
ERROR: Access to the registry path is denied.

WARNING: The data being saved is truncated to 1024 characters.
ERROR: Access to the registry path is denied.

(at this point it stopped again and opened Notepad, and refused to continue until I closed Notepad. NOTEPAD FORSOOTH)

go generate ./...
cmd\porter\main.go:1: running "packr2": exec: "packr2": executable file not found in %PATH%
pkg\exec\exec.go:1: running "packr2": exec: "packr2": executable file not found in %PATH%
pkg\kubernetes\kubernetes.go:1: running "packr2": exec: "packr2": executable file not found in %PATH%
pkg\porter\porter.go:1: running "packr2": exec: "packr2": executable file not found in %PATH%
pkg\templates\templates.go:1: running "packr2": exec: "packr2": executable file not found in %PATH%
make: *** [generate] Error 1
carolynvs commented 3 years ago

The new plan is to move from make to mage. The preliminary work to support that, and have windows agents in our CI is in #1321. After that is merged, I will start converting our makefile to mage.