SonarSource / sonar-scanner-msbuild

SonarScanner for .NET
http://redirect.sonarsource.com/doc/msbuild-sq-runner.html
GNU Lesser General Public License v3.0
361 stars 143 forks source link

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

Open martin-strecker-sonarsource opened 2 months ago

martin-strecker-sonarsource commented 2 months ago

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:

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:

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 commented 1 month ago

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