-
Notifications
You must be signed in to change notification settings - Fork 232
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
Use something else than Make to build on Windows #2396
Comments
We never supported building on Windows directly due to these issues with make, ssh inconsistencies etc. Recommended is to use WSL or Linux with However, Appveyor's image is the baseline for this as it includes Visual Studio and the needed |
For the MSI, we need to build on Windows so this needs to change. |
As I understood it was investigated to use generally available tools to build the MSI. https://github.com/code-ready/crc/wiki/Building-the-msi-package This includes wix-toolset, which also runs on appveyor: https://github.com/code-ready/crc/blob/66e85bb1a1be7bfbbf4ef4ac46eee9eb5c0dd1a0/appveyor.yml#L11 The only requirement is that Note: There is work on getting this (wix-toolset) to run from Linux, more can be found here: wixtoolset/issues#4381 Docker images have been attempted before, but I'd prefer to stick with |
The content of the https://github.com/code-ready/crc/blob/66e85bb1a1be7bfbbf4ef4ac46eee9eb5c0dd1a0/appveyor.yml#L7-L12 |
PS C:\Users\anath\redhat\crc> make cross
GOARCH=amd64 GOOS=darwin go build -ldflags="-X github.com/code-ready/crc/pkg/crc/version.crcVersion=1.27.0 -X github.com/code-ready/crc/pkg/crc/version.bundleVersion=4.7.11 -X github.com/code-ready/crc/pkg/crc/version.commitSha=40f235bb -extldflags='-static' " -o out/macos-amd64/crc ./cmd/crc
GOOS=linux GOARCH=amd64 go build -ldflags="-X github.com/code-ready/crc/pkg/crc/version.crcVersion=1.27.0 -X github.com/code-ready/crc/pkg/crc/version.bundleVersion=4.7.11 -X github.com/code-ready/crc/pkg/crc/version.commitSha=40f235bb -extldflags='-static' " -o out/linux-amd64/crc ./cmd/crc
GOARCH=amd64 GOOS=windows go build -ldflags="-X github.com/code-ready/crc/pkg/crc/version.crcVersion=1.27.0 -X github.com/code-ready/crc/pkg/crc/version.bundleVersion=4.7.11 -X github.com/code-ready/crc/pkg/crc/version.commitSha=40f235bb -extldflags='-static' " -o out/windows-amd64/crc.exe ./cmd/crc I recently setup my new windows machine, so i have cygwin installed and PS C:\Users\anath\redhat\crc> make clean
rm -rf /cygdrive/c/Users/anath/redhat/crc/docs/build
rm -f packaging/darwin/Distribution
rm -f packaging/darwin/Resources/welcome.html
rm -f packaging/darwin/scripts/postinstall
rm -rf packaging/root/
rm -rf packaging/windows/msi
rm -f out/windows-amd64/split
rm -f packaging/rpm/crc.spec images/rpmbuild/Containerfile
rm -rf out
rm -f C:\Users\anath\go/bin/crc <-- like this one
rm -rf release |
same here, and also on AppVeyor, so this sounds like configuration issues. Especially not understanding where this comes from:
|
Instead of changing the tool, these can be fixed. The additional overhead and maintenance that a new build script introduces does not sounds appealing. But that would be cygwin, right @anjannath. This has never been a recommendation as that also resulted in people running the tool from the bash prompt and then issues arose with the hyper-v driver, the ssh implementation. I believe the recommendation has always been to use PowerShell with |
Let's close this for the moment. I found a way to get everything working. I would prefer to only use PowerShell and not have to mess with Cygwin, etc. |
Maybe CMake is the way to go instead of Make. VS2019 has support for cmake according to this article, and it would facilitate building in Linux as well (wixtoolset/issues#4381): https://docs.microsoft.com/en-us/cpp/linux/create-a-new-linux-project?view=msvc-160 |
Make is not really made to run on Windows.
Many reasons:
I understand it is not easy to maintain 2 scripts but the current solution doesn't work well and is inefficient.
I would prefer to run a single .ps1 script that does everything (install dependencies and build everything).
The text was updated successfully, but these errors were encountered: