common icon indicating copy to clipboard operation
common copied to clipboard

Fix getLibpodTmpDir() on Windows

Open sebsoto opened this issue 8 months ago • 6 comments
trafficstars

Changes the function to return an absolute path. Without this, EngineConfig.Validate() will return an error on Windows when using the default values.

sebsoto avatar Mar 08 '25 16:03 sebsoto

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: sebsoto Once this PR has been reviewed and has the lgtm label, please assign mheon for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

openshift-ci[bot] avatar Mar 08 '25 16:03 openshift-ci[bot]

Before and after:

image

sebsoto avatar Mar 08 '25 16:03 sebsoto

Are you trying to port buildah on windows? It would be news to me that buildah can be used on windows. cc @nalind

Luap99 avatar Mar 10 '25 11:03 Luap99

Are you trying to port buildah on windows? It would be news to me that buildah can be used on windows.

@Luap99 I have an issue open for that: https://github.com/containers/buildah/issues/4010

This change is just fixing something in a shared library, that is obviously broken, and should probably done regardless of the buildah Windows issue.

Practically speaking this is a totally useless path on windows. If this should actually work on windows should this not return an actual standard windows temp dir path instead?

I don't know the full context as to why this path is being used, but the Linux function returns the same path. https://github.com/containers/common/blob/6e82793fd29d005b76f1243aaebdbc1a390b22e7/pkg/config/default_linux.go#L24-L26

There is also this other function which actually returns a temporary directory. https://github.com/containers/common/blob/6e82793fd29d005b76f1243aaebdbc1a390b22e7/pkg/config/default_windows.go#L23-L30

sebsoto avatar Mar 10 '25 12:03 sebsoto

@Luap99 I can change the value to be in the temp folder so it actually becomes temporary.

sebsoto avatar Mar 10 '25 13:03 sebsoto

The change itself should be fine BUT

I think it would likely best to start with some high level overview of what you are going to change and how buildah on windows should work. We have very little windows expertise so any actual review will be very difficult us. Thus I am not sure how that would work out. I am not strictly against it but I think this needs some actual plan first. How is going to do all that work and then also who is maintaining it going forward? (It would be best to keep that discussion on https://github.com/containers/buildah/issues/4010).

Luap99 avatar Mar 10 '25 13:03 Luap99