-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Windows contribution problems #21821
Comments
@n1hility PTAL |
To clarify: if those are fair points and the windows dev environment setup isn't already documented somewhere else I would like to work on this issue and specifically improve the windows part of |
the windows way to build podman is done with |
hyperv should really be enabled via containers.conf where you can define your machine provider ... the environment variable should only be for temporary, ci, or dev usage. |
i think #21765 will fix the policy problem. |
as for dependencies, we should probably advise folks to download prebuilt binaries as needed instead of building them. this is a good point you make. |
You can get Makefile based builds working under msys but there is likely always going to be gotchas with that env. the better appaoach is to, as @baude mentioned above use winmake.ps1, although it is still relatively new, so isnt yet providing a full distribution (just the podman-remote binary). You can also cross compile and build the zip dist on a linux vm, container, or host using WRT to helper binaries, most things are using sibling fs based lookups (helpers located in same dir as executing podman.exe), although there are a few cases whether thats not yet done. Just so you are aware Podman 5 is still under a high degree of change atm (after a big refactor), so if you work on any build related changes, keep in mind the odds of conflict will be higher than normal until the release is out the door. |
I will check the contribution docs, as I was the original author. I've been running MSYS builds in my dev VMs and in GH Actions for over the years w/o noticing any significant issues, so, this should be stable enough, but might be there were some not so well documented parts. |
This is the issue with the current work in progress with machine 5. It is very very new and will be sorted out. There is a ticket for this #21765 This is not documented, because it is very new - introduced with the change how machine images are fetched and it is not supposed to lasting, it is going to be fixed/documented when finalized. |
Plus one to this. I often just install the latest release to get all the needed binaries. May be it should be documented as an option. |
I have submitted #21910 to add a new section to build podman on windows without MSYS. |
The instructions in the PR I have submitted don't require anything other than go and git. I have created a separate issue to support linting on windows. |
A friendly reminder that this issue had no activity for 30 days. |
Current status:
Current goal is to not require MSYS2 (using winmake instead), require minimal system deps, and add improved portable tasks for specific needs (validation, lint etc)
Current plan is add a Hyper-V option to the installer (in progress - @lord is looking at it)
Fixed
This is one expected, and the error message tells you what to do. Although could also add a doc entry
Golang is an expected dependency at the moment.
Currently you need an installation of podman on your system to include this. Although I agree the build should fetch this for you and we should change the search path |
Add the following targets in winmake.ps1: - `installer`: builds the Windows installer - `docs`: builds the documentation HTML pages - `validatepr`: runs the Linux Makefile `.valiatepr` target using podman. - `lint`: faster validation that runs linter locally Update of `build_windows.md`: - removed every reference to the MSYS2 platform - added instructions to build the installer and linters Fix containers#21821 and containers#21911 Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
These are some notes of the issues faced while trying to follow the contributing instructions for windows (
build_windows.md
). The goal was to be able to build podman from source on windows and executepodman run
on both WSL and Hyper-v.The main question is if MSYS2 is still a requirement today as it complicates the setup of the dev environment. And if it is required how can we provide instructions to expose the tools installed via MSYS2 externally (to the IDE and Powershell).
Troubles when installing msys2 with chocolately
chocolately is a popular package manager for windows. I have used to install msys2 (
choco install msys2
) and started a mintty shell runningmsys2
from a terminal. But then the environment isMSYS2
rather thenUCRT64
and I spent some time to understand why commands were not working (e.g. go could not be found).MSYS2 VS Code integration (or other IDEs)
This is worth linking. And it's still unclear how to configure the golang VS Code extension to use the go version installed in MSYS2 environment.
build - RELEASE_NUMBER / RELEASE_VERSION issue
The first issue issue I faced trying to run
make podman-remote
was:I resolved that executing
export RELEASE_VERSION=5.0.0-dev
build - "file contains a virus" issue
To fix that "C:\msys64\tmp" should be added in the exlusions list in the Windows Security Virus & threat protection settings
hyper-v
It's difficult to find out how to configure podman to use hyper-v instead of the default wsl. Looking at the source code I found that we need to set
$env:CONTAINERS_MACHINE_PROVIDER="hyperv"
. Also hyper-v should be enabled first (doc).policy.json
The file
[/etc/containers/policy.json](https://podman.io/docs/installation#policyjson)
is required formachine init
to work when the provider is hyper-v. Interestingly it's not needed when the provider is wsl:To overcome that I had to use the powershell (not the MSYS2 shell) and create the file C:\etc\containers\policy.json copying https://src.fedoraproject.org/rpms/containers-common/raw/main/f/default-policy.json.
makefile and winmake.ps1
I found that CI uses
./winmake localmachine
(pkg\machine\e2e\README.md). The script ./winmake.ps1 requires powershell (rather than MSYS2) and it's not clear why there are 2 makefiles.Anyway I faced 2 problems to run it:
This was fixed by
Set-ExecutionPolicy -ExecutionPolicy Bypass
.And then I had another error because golang is missing (Powershell doesn't see the version installed by MSYS2):
I installed golang (
choco install golang
) and I was able to run./winmake podman-remote
.Could not find gvproxy
After running
$env:CONTAINERS_MACHINE_PROVIDER="hyperv"; ./podman.exe machine init
,./podman.exe machine start
fails:I run
make win-gvproxy
(using the MSYS2 shell):But podman machine start was still failing with the same error so I tried to build podman remote using the HELPER_BINARIES_DIR
make podman-remote HELPER_BINARIES_DIR=\Users\mario\Git\podman\bin\windows
but without success.Finally I created the following
C:\etc\containers\containers.conf
and the problem disappeared.The text was updated successfully, but these errors were encountered: