Skip to content

Commit

Permalink
Replace coapp with zip package (#4244)
Browse files Browse the repository at this point in the history
* Packaging with Windows zip package
* Use 7z instead of Compress-Archive
that uses backslashes in
Windows PowerShell 1.0
  • Loading branch information
emasab committed Apr 3, 2023
1 parent 8914c9b commit 2c6dd0a
Show file tree
Hide file tree
Showing 7 changed files with 228 additions and 236 deletions.
126 changes: 57 additions & 69 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -259,71 +259,62 @@ blocks:
commands:
- C:\msys64\usr\bin\bash -lc './packaging/mingw-w64/semaphoreci-build.sh --static ./artifacts/librdkafka.tgz'

# Disabled because of CoApp discontinuation, need to find an alternative
# before next release.
#
# - name: 'Windows x64: Windows SDK 10.0 / MSVC v142 / VS 2019'
# dependencies: []
# task:
# agent:
# machine:
# type: s1-prod-windows
# env_vars:
# # Disable vcpkg telemetry
# - name: VCPKG_DISABLE_METRICS
# value: 'yes'
# prologue:
# commands:
# # install vcpkg in the parent directory.
# - pwd
# - cd ..
# # Restore vcpkg caches, if any.
# - cache restore vcpkg-archives-$Env:ARTIFACT_KEY
# # Setup vcpkg
# - "& .\\librdkafka\\win32\\setup-vcpkg.ps1"
# - cd librdkafka
# - ..\vcpkg\vcpkg integrate install
# # Install required packages.
# - ..\vcpkg\vcpkg --feature-flags=versions install --triplet $Env:triplet
# - cd ..
# - pwd
# # Store vcpkg caches
# - ls vcpkg/
# - echo $Env:VCPKG_ROOT
# - cache delete vcpkg-archives-$Env:ARTIFACT_KEY
# - cache store vcpkg-archives-$Env:ARTIFACT_KEY C:/Users/semaphore/AppData/Local/vcpkg/archives
# - pwd
# - cd librdkafka
# # coapp is needed for creating the intermediary nuget packages.
# #- "& .\\win32\\install-coapp.ps1"
# epilogue:
# commands:
# - Get-ChildItem . -include *.dll -recurse
# - Get-ChildItem . -include *.lib -recurse
# - if ($env:SEMAPHORE_GIT_TAG_NAME -ne "") { artifact push workflow artifacts/ --destination artifacts/$Env:ARTIFACT_KEY/ }
# jobs:
# - name: 'Build: MSVC x64'
# env_vars:
# - name: triplet
# value: x64-windows
# - name: ARTIFACT_KEY
# value: p-librdkafka__plat-windows__dist-msvc__arch-x64__lnk-std
# commands:
# - "& .\\win32\\msbuild.ps1 -config Release -platform x64"
# # Disabled because of CoApp discontinuation, need to find an alternative
# # before next release.
# #- "& .\\win32\\package-nuget.ps1 -destdir .\\artifacts\\"
# - name: 'Build: MSVC x86'
# env_vars:
# - name: triplet
# value: x86-windows
# - name: ARTIFACT_KEY
# value: p-librdkafka__plat-windows__dist-msvc__arch-x86__lnk-std
# commands:
# - "& .\\win32\\msbuild.ps1 -config Release -platform Win32"
# # Disabled because of CoApp discontinuation, need to find an alternative
# # before next release.
# #- "& .\\win32\\package-nuget.ps1 -destdir .\\artifacts\\"
- name: 'Windows x64: Windows SDK 10.0 / MSVC v142 / VS 2019'
dependencies: []
task:
agent:
machine:
type: s1-prod-windows
env_vars:
# Disable vcpkg telemetry
- name: VCPKG_DISABLE_METRICS
value: 'yes'
prologue:
commands:
# install vcpkg in the parent directory.
- pwd
- cd ..
# Restore vcpkg caches, if any.
- cache restore vcpkg-archives-$Env:ARTIFACT_KEY
# Setup vcpkg
- "& .\\librdkafka\\win32\\setup-vcpkg.ps1"
- cd librdkafka
- ..\vcpkg\vcpkg integrate install
# Install required packages.
- ..\vcpkg\vcpkg --feature-flags=versions install --triplet $Env:triplet
- cd ..
- pwd
# Store vcpkg caches
- ls vcpkg/
- echo $Env:VCPKG_ROOT
- cache delete vcpkg-archives-$Env:ARTIFACT_KEY
- cache store vcpkg-archives-$Env:ARTIFACT_KEY C:/Users/semaphore/AppData/Local/vcpkg/archives
- pwd
- cd librdkafka
epilogue:
commands:
- Get-ChildItem . -include *.dll -recurse
- Get-ChildItem . -include *.lib -recurse
- if ($env:SEMAPHORE_GIT_TAG_NAME -ne "") { artifact push workflow artifacts/ --destination artifacts/$Env:ARTIFACT_KEY/ }
jobs:
- name: 'Build: MSVC x64'
env_vars:
- name: triplet
value: x64-windows
- name: ARTIFACT_KEY
value: p-librdkafka__plat-windows__dist-msvc__arch-x64__lnk-std
commands:
- "& .\\win32\\msbuild.ps1 -platform x64"
- "& .\\win32\\package-zip.ps1 -platform x64"
- name: 'Build: MSVC x86'
env_vars:
- name: triplet
value: x86-windows
- name: ARTIFACT_KEY
value: p-librdkafka__plat-windows__dist-msvc__arch-x86__lnk-std
commands:
- "& .\\win32\\msbuild.ps1 -platform Win32"
- "& .\\win32\\package-zip.ps1 -platform Win32"

- name: 'Packaging'
dependencies:
Expand All @@ -333,10 +324,7 @@ blocks:
- 'Linux x64: release artifact docker builds'
- 'Linux arm64: release artifact docker builds'
- 'Windows x64: MinGW-w64'
# Disabled because of CoApp discontinuation, need to find an alternative
# before next release.
#
#- 'Windows x64: Windows SDK 10.0 / MSVC v142 / VS 2019'
- 'Windows x64: Windows SDK 10.0 / MSVC v142 / VS 2019'
run:
when: "tag =~ '^v[0-9]\\.'"
task:
Expand Down
236 changes: 118 additions & 118 deletions packaging/nuget/nugetpackage.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,128 +109,128 @@ class NugetPackage (Package):
'./usr/local/lib/librdkafka.so.1',
'runtimes/linux-x64/native/alpine-librdkafka.so'),

# Disabled before Coapp replacement
# # Common Win runtime
# Mapping({'arch': 'x64',
# 'plat': 'win'},
# 'msvcr140.zip',
# 'vcruntime140.dll',
# 'runtimes/win-x64/native/vcruntime140.dll'),
# Mapping({'arch': 'x64',
# 'plat': 'win'},
# 'msvcr140.zip',
# 'msvcp140.dll', 'runtimes/win-x64/native/msvcp140.dll'),
# # matches librdkafka.redist.{VER}.nupkg
# Mapping({'arch': 'x64',
# 'plat': 'win'},
# 'librdkafka.redist*',
# 'build/native/bin/v142/x64/Release/librdkafka.dll',
# 'runtimes/win-x64/native/librdkafka.dll'),
# Mapping({'arch': 'x64',
# 'plat': 'win'},
# 'librdkafka.redist*',
# 'build/native/bin/v142/x64/Release/librdkafkacpp.dll',
# 'runtimes/win-x64/native/librdkafkacpp.dll'),
# Mapping({'arch': 'x64',
# 'plat': 'win'},
# 'librdkafka.redist*',
# 'build/native/bin/v142/x64/Release/libcrypto-3-x64.dll',
# 'runtimes/win-x64/native/libcrypto-3-x64.dll'),
# Mapping({'arch': 'x64',
# 'plat': 'win'},
# 'librdkafka.redist*',
# 'build/native/bin/v142/x64/Release/libssl-3-x64.dll',
# 'runtimes/win-x64/native/libssl-3-x64.dll'),
# Mapping({'arch': 'x64',
# 'plat': 'win'},
# 'librdkafka.redist*',
# 'build/native/bin/v142/x64/Release/zlib1.dll',
# 'runtimes/win-x64/native/zlib1.dll'),
# Mapping({'arch': 'x64',
# 'plat': 'win'},
# 'librdkafka.redist*',
# 'build/native/bin/v142/x64/Release/zstd.dll',
# 'runtimes/win-x64/native/zstd.dll'),
# Mapping({'arch': 'x64',
# 'plat': 'win'},
# 'librdkafka.redist*',
# 'build/native/bin/v142/x64/Release/libcurl.dll',
# 'runtimes/win-x64/native/libcurl.dll'),
# # matches librdkafka.{VER}.nupkg
# Mapping({'arch': 'x64',
# 'plat': 'win'},
# 'librdkafka*.nupkg',
# 'build/native/lib/v142/x64/Release/librdkafka.lib',
# 'build/native/lib/win/x64/win-x64-Release/v142/librdkafka.lib', # noqa: E501
# artifact_fname_excludes=['redist', 'symbols']),
# Mapping({'arch': 'x64',
# 'plat': 'win'},
# 'librdkafka*.nupkg',
# 'build/native/lib/v142/x64/Release/librdkafkacpp.lib',
# 'build/native/lib/win/x64/win-x64-Release/v142/librdkafkacpp.lib', # noqa: E501
# artifact_fname_excludes=['redist', 'symbols']),
# Common Win runtime
Mapping({'arch': 'x64',
'plat': 'win'},
'msvcr140.zip',
'vcruntime140.dll',
'runtimes/win-x64/native/vcruntime140.dll'),
Mapping({'arch': 'x64',
'plat': 'win'},
'msvcr140.zip',
'msvcp140.dll', 'runtimes/win-x64/native/msvcp140.dll'),

# matches x64 librdkafka.redist.zip
Mapping({'arch': 'x64',
'plat': 'win'},
'librdkafka.redist*',
'build/native/bin/v142/x64/Release/librdkafka.dll',
'runtimes/win-x64/native/librdkafka.dll'),
Mapping({'arch': 'x64',
'plat': 'win'},
'librdkafka.redist*',
'build/native/bin/v142/x64/Release/librdkafkacpp.dll',
'runtimes/win-x64/native/librdkafkacpp.dll'),
Mapping({'arch': 'x64',
'plat': 'win'},
'librdkafka.redist*',
'build/native/bin/v142/x64/Release/libcrypto-3-x64.dll',
'runtimes/win-x64/native/libcrypto-3-x64.dll'),
Mapping({'arch': 'x64',
'plat': 'win'},
'librdkafka.redist*',
'build/native/bin/v142/x64/Release/libssl-3-x64.dll',
'runtimes/win-x64/native/libssl-3-x64.dll'),
Mapping({'arch': 'x64',
'plat': 'win'},
'librdkafka.redist*',
'build/native/bin/v142/x64/Release/zlib1.dll',
'runtimes/win-x64/native/zlib1.dll'),
Mapping({'arch': 'x64',
'plat': 'win'},
'librdkafka.redist*',
'build/native/bin/v142/x64/Release/zstd.dll',
'runtimes/win-x64/native/zstd.dll'),
Mapping({'arch': 'x64',
'plat': 'win'},
'librdkafka.redist*',
'build/native/bin/v142/x64/Release/libcurl.dll',
'runtimes/win-x64/native/libcurl.dll'),
# matches x64 librdkafka.redist.zip, lib files
Mapping({'arch': 'x64',
'plat': 'win'},
'librdkafka.redist*',
'build/native/lib/v142/x64/Release/librdkafka.lib',
'build/native/lib/win/x64/win-x64-Release/v142/librdkafka.lib' # noqa: E501
),
Mapping({'arch': 'x64',
'plat': 'win'},
'librdkafka.redist*',
'build/native/lib/v142/x64/Release/librdkafkacpp.lib',
'build/native/lib/win/x64/win-x64-Release/v142/librdkafkacpp.lib' # noqa: E501
),

# Mapping({'arch': 'x86',
# 'plat': 'win'},
# 'msvcr140.zip',
# 'vcruntime140.dll',
# 'runtimes/win-x86/native/vcruntime140.dll'),
# Mapping({'arch': 'x86',
# 'plat': 'win'},
# 'msvcr140.zip',
# 'msvcp140.dll', 'runtimes/win-x86/native/msvcp140.dll'),
# # matches librdkafka.redist.{VER}.nupkg
# Mapping({'arch': 'x86',
# 'plat': 'win'},
# 'librdkafka.redist*',
# 'build/native/bin/v142/Win32/Release/librdkafka.dll',
# 'runtimes/win-x86/native/librdkafka.dll'),
# Mapping({'arch': 'x86',
# 'plat': 'win'},
# 'librdkafka.redist*',
# 'build/native/bin/v142/Win32/Release/librdkafkacpp.dll',
# 'runtimes/win-x86/native/librdkafkacpp.dll'),
# Mapping({'arch': 'x86',
# 'plat': 'win'},
# 'librdkafka.redist*',
# 'build/native/bin/v142/Win32/Release/libcrypto-3.dll',
# 'runtimes/win-x86/native/libcrypto-3.dll'),
# Mapping({'arch': 'x86',
# 'plat': 'win'},
# 'librdkafka.redist*',
# 'build/native/bin/v142/Win32/Release/libssl-3.dll',
# 'runtimes/win-x86/native/libssl-3.dll'),
Mapping({'arch': 'x86',
'plat': 'win'},
'msvcr140.zip',
'vcruntime140.dll',
'runtimes/win-x86/native/vcruntime140.dll'),
Mapping({'arch': 'x86',
'plat': 'win'},
'msvcr140.zip',
'msvcp140.dll', 'runtimes/win-x86/native/msvcp140.dll'),

# Mapping({'arch': 'x86',
# 'plat': 'win'},
# 'librdkafka.redist*',
# 'build/native/bin/v142/Win32/Release/zlib1.dll',
# 'runtimes/win-x86/native/zlib1.dll'),
# Mapping({'arch': 'x86',
# 'plat': 'win'},
# 'librdkafka.redist*',
# 'build/native/bin/v142/Win32/Release/zstd.dll',
# 'runtimes/win-x86/native/zstd.dll'),
# Mapping({'arch': 'x86',
# 'plat': 'win'},
# 'librdkafka.redist*',
# 'build/native/bin/v142/Win32/Release/libcurl.dll',
# 'runtimes/win-x86/native/libcurl.dll'),
# matches Win32 librdkafka.redist.zip
Mapping({'arch': 'x86',
'plat': 'win'},
'librdkafka.redist*',
'build/native/bin/v142/Win32/Release/librdkafka.dll',
'runtimes/win-x86/native/librdkafka.dll'),
Mapping({'arch': 'x86',
'plat': 'win'},
'librdkafka.redist*',
'build/native/bin/v142/Win32/Release/librdkafkacpp.dll',
'runtimes/win-x86/native/librdkafkacpp.dll'),
Mapping({'arch': 'x86',
'plat': 'win'},
'librdkafka.redist*',
'build/native/bin/v142/Win32/Release/libcrypto-3.dll',
'runtimes/win-x86/native/libcrypto-3.dll'),
Mapping({'arch': 'x86',
'plat': 'win'},
'librdkafka.redist*',
'build/native/bin/v142/Win32/Release/libssl-3.dll',
'runtimes/win-x86/native/libssl-3.dll'),

# # matches librdkafka.{VER}.nupkg
# Mapping({'arch': 'x86',
# 'plat': 'win'},
# 'librdkafka*.nupkg',
# 'build/native/lib/v142/Win32/Release/librdkafka.lib',
# 'build/native/lib/win/x86/win-x86-Release/v142/librdkafka.lib', # noqa: E501
# artifact_fname_excludes=['redist', 'symbols']),
Mapping({'arch': 'x86',
'plat': 'win'},
'librdkafka.redist*',
'build/native/bin/v142/Win32/Release/zlib1.dll',
'runtimes/win-x86/native/zlib1.dll'),
Mapping({'arch': 'x86',
'plat': 'win'},
'librdkafka.redist*',
'build/native/bin/v142/Win32/Release/zstd.dll',
'runtimes/win-x86/native/zstd.dll'),
Mapping({'arch': 'x86',
'plat': 'win'},
'librdkafka.redist*',
'build/native/bin/v142/Win32/Release/libcurl.dll',
'runtimes/win-x86/native/libcurl.dll'),

# Mapping({'arch': 'x86',
# 'plat': 'win'},
# 'librdkafka*.nupkg',
# 'build/native/lib/v142/Win32/Release/librdkafkacpp.lib',
# 'build/native/lib/win/x86/win-x86-Release/v142/librdkafkacpp.lib', # noqa: E501
# artifact_fname_excludes=['redist', 'symbols'])
# matches Win32 librdkafka.redist.zip, lib files
Mapping({'arch': 'x86',
'plat': 'win'},
'librdkafka.redist*',
'build/native/lib/v142/Win32/Release/librdkafka.lib',
'build/native/lib/win/x86/win-x86-Release/v142/librdkafka.lib' # noqa: E501
),
Mapping({'arch': 'x86',
'plat': 'win'},
'librdkafka.redist*',
'build/native/lib/v142/Win32/Release/librdkafkacpp.lib',
'build/native/lib/win/x86/win-x86-Release/v142/librdkafkacpp.lib' # noqa: E501
)
]

def __init__(self, version, arts):
Expand Down
5 changes: 2 additions & 3 deletions win32/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Build guide for Windows

* build.bat - Build for all combos of: Win32,x64,Release,Debug using the current msbuild toolset
* build-package.bat - Build NuGet packages (wrapper for package-nuget.ps1)
* package-nuget.ps1 - Build NuGet packages (using build.bat artifacts)
* push-package.bat - Push NuGet packages to NuGet (edit script for version)
* package-zip.ps1 - Build zip package (using build.bat artifacts)

Loading

0 comments on commit 2c6dd0a

Please sign in to comment.