NatLabRockies / NatLabRockies/OpenStudio

Tar Ball Fixes

Open
#5,591 1 comment 0 reactions 1 assignee View on GitHub

@anchapin is already working on this.

Since Jan 16, 2026.

Continuous Integration Enhancement Request Triage
Dominant language
C++
Stars
646
Forks
237
Avg merge
3d 11h
Merged PRs (30d)
10

Description

General Summary

Address the issue that occurs now and needs manual correction to remove a hidden copy of the files by doing something similar to the following plan. The following plan is windows specific but an example to follow.

Detailed Description

The tar balls are currently including a hidden copy of all the files with an '.' prepended to the file name.

Possible Implementation

Exact Code Changes Required to Fix Windows Tarball Issue (Revised)

Change 1: Modify CMakeLists.txt to Switch Windows Generator

File: CMakeLists.txt
Location: Before line 1485 (before include(CPack))

# Platform-specific CPack generators
if(WIN32)
  # Windows: Generate IFW (installer) and ZIP (portable)
  # Note: TGZ disabled in CPack to avoid including hidden build artifacts/ADS.
  # We will generate a clean TGZ from the ZIP in the CI workflow.
  set(CPACK_GENERATOR "IFW;ZIP" CACHE STRING "CPack generators")
elseif(APPLE)
  set(CPACK_GENERATOR "IFW;TGZ" CACHE STRING "CPack generators")
else()
  set(CPACK_GENERATOR "IFW;TGZ;DEB;RPM" CACHE STRING "CPack generators")
endif()

if (NOT DELAY_INCLUDE_CPACK)
  include(CPack)
endif()

Change 2: Modify Workflow to Convert ZIP to Clean TGZ

File: .github/workflows/full-build.yml
Location: After "Create packages" step (around line 1611)

      - name: Create packages
        if: ${{ success() && !cancelled() }}
        working-directory: ${{ env.OPENSTUDIO_BUILD }}
        run: |
          & $env:ComSpec /c "call conanbuild.bat && cpack -C ${{ env.BUILD_TYPE }}"

      - name: Create clean tar.gz from zip
        if: ${{ success() && !cancelled() }}
        working-directory: ${{ env.OPENSTUDIO_BUILD }}
        run: |
          # Convert clean ZIP to TAR.GZ to avoid Windows ADS/hidden file issues
          $zipDir = "${{ env.OPENSTUDIO_BUILD }}/_CPack_Packages/win64/ZIP"
          $tgzDir = "${{ env.OPENSTUDIO_BUILD }}/_CPack_Packages/win64/TGZ"
          
          if (Test-Path $zipDir) {
            New-Item -ItemType Directory -Force -Path $tgzDir | Out-Null
            $zips = Get-ChildItem -Path $zipDir -Filter "*.zip"
            foreach ($zip in $zips) {
              Write-Host "Converting $($zip.Name) to tar.gz..."
              $extractPath = Join-Path $zipDir ("extract_" + $zip.BaseName)
              Expand-Archive -Path $zip.FullName -DestinationPath $extractPath
              
              $tarName = $zip.Name.Replace(".zip", ".tar.gz")
              $tarPath = Join-Path $tgzDir $tarName
              
              # Create tar.gz using system tar (bsdtar)
              # -C changes to extract dir, so we archive the contents (which includes top-level folder)
              tar -czf $tarPath -C $extractPath .
              
              if ($LASTEXITCODE -ne 0) {
                Write-Error "Failed to create tar.gz for $($zip.Name)"
                exit 1
              }
              
              # Cleanup
              Remove-Item -Recurse -Force $extractPath
            }
          }

What Stays the Same

  • The "Upload Signed TGZ installer" step (lines 1706-1711) remains unchanged. It will pick up the new file because we put it in the TGZ folder.
  • The windows-publish job remains unchanged. It will continue to find and upload the tar.gz.

Result

  • CPack creates a clean .zip (no ADS/hidden metadata).
  • We script the conversion of .zip -> .tar.gz.
  • The resulting .tar.gz is clean because the source .zip was clean.
  • CI pipeline continues to work exactly as before, satisfying all requirements.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.