When executing corteca build on Windows with the build output set to rootfs, the command fails with the following error:
Error while validating rootfs: entrypoint lacks execute permissions: C:\Users\<user>\AppData\Local\Temp\<tmp dir>\rootfs\bin\<entrypoint>
This issue seems to be caused by this line, where the Docker output is set to type=local. On Windows, when using this output type, file permissions are lost because Windows and Unix handle file permissions differently.
As a result, the validation step fails when checking for the executable bit on the entrypoint inside the rootfs.
In version 31.1.0, I was able to work around this by changing the Docker output type to tar and then adjusting the way that the .tar.gz archive was created. However, in version 32.0.0, validation for the tarball was added, meaning additional changes are needed to fix it - modifying the validation to check permissions directly within the .tar file without extracting it.
The same error also occurs when using the --rootfs <rootfs.tar.gz path> option, because in this line, the tarball is extracted, again causing the loss of permissions.
Since switching from local to tar output is a significant change and may have broader implications, I'm opening this issue to discuss potential alternatives rather than submitting a (not fully tested) pull request right away.
Tar generated with version 32.0.0 on Linux (WSL):

test is the entrypoint. The image is generated successfully. (Local information like User and Group is present, not sure if this is desirable)
Tar generated with version 31.1.0 on windows (on version 32.0.0 it fails before generating it as explained)

test is the entrypoint. We can see that the permissions are lost. Additionally the symbolic links will not work because of the use of \ instead of /. This can be solved changing this line, but since the proposed solution is to directly generate the tarball with Docker, this issue will be fixed too.
Tar generated with version 31.1.0 on windows with the (not fully tested) quick fix:

test is the entrypoint. The permissions are preserved (and no local information like User is stored).
When executing
corteca buildon Windows with the build output set torootfs, the command fails with the following error:This issue seems to be caused by this line, where the Docker output is set to
type=local. On Windows, when using this output type, file permissions are lost because Windows and Unix handle file permissions differently.As a result, the validation step fails when checking for the executable bit on the entrypoint inside the
rootfs.In version
31.1.0, I was able to work around this by changing the Docker output type totarand then adjusting the way that the.tar.gzarchive was created. However, in version32.0.0, validation for the tarball was added, meaning additional changes are needed to fix it - modifying the validation to check permissions directly within the.tarfile without extracting it.The same error also occurs when using the
--rootfs <rootfs.tar.gz path>option, because in this line, the tarball is extracted, again causing the loss of permissions.Since switching from
localtotaroutput is a significant change and may have broader implications, I'm opening this issue to discuss potential alternatives rather than submitting a (not fully tested) pull request right away.Tar generated with version

32.0.0on Linux (WSL):testis the entrypoint. The image is generated successfully. (Local information like User and Group is present, not sure if this is desirable)Tar generated with version

31.1.0on windows (on version 32.0.0 it fails before generating it as explained)testis the entrypoint. We can see that the permissions are lost. Additionally the symbolic links will not work because of the use of\instead of/. This can be solved changing this line, but since the proposed solution is to directly generate the tarball with Docker, this issue will be fixed too.Tar generated with version

31.1.0on windows with the (not fully tested) quick fix:testis the entrypoint. The permissions are preserved (and no local information like User is stored).