Skip to content
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

CI: Produce package zip files with 7-zip #2096

Open
martin-strecker-sonarsource opened this issue Jul 23, 2024 · 1 comment
Open

CI: Produce package zip files with 7-zip #2096

martin-strecker-sonarsource opened this issue Jul 23, 2024 · 1 comment

Comments

@martin-strecker-sonarsource
Copy link
Contributor

martin-strecker-sonarsource commented Jul 23, 2024

Follow up to #2086 and #2087

In #2086, we documented that the Compress-Archive PowerShell command produces invalid zip files. In #2087, we fixed this by using the Windows built-in tool tar.exe. We also tried:

  • Using Powershell core (which isn't affected by the Compress-Archive bug).
  • Using 7zip

Both attempts failed because the tools in question were not installed on our images. Instead, we used tar.exe in #2087 as a quick fix. tar.exe works fine but we should replace it because:

  • We use the -a flag, which is undocumented (it isn't listed in tar --help
  • zip support isn't officially mentioned as well
  • The GNU tar doesn't support the zip format, only bsdtar does.
  • The only source for this functionality is "The windows tar.exe is derived from bsdtar and you can find the switches used there".

All of the points mentioned above will bite us sooner than later. We should settle for a more stable/supported solution. Using 7-zip seems the appropriate choice to avoid the brittle Compress-Archive and the obscure tar.exe.
For this, we need to install 7-zip on our ci image (https://github.com/SonarSource/dotnet-ci-images/issues/24).

@martin-strecker-sonarsource
Copy link
Contributor Author

martin-strecker-sonarsource commented Jul 29, 2024

We also should mak sure that the cli executables have the same file permissions than what we find in the original dowloaded from jfrog:
image

We may use ZipEntry ExternalAttributes and this calculation:
https://unix.stackexchange.com/questions/14705/the-zip-formats-external-file-attribute

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants