diff --git a/.azure/azure-pipelines.qns.yml b/.azure/azure-pipelines.qns.yml index 7c1a94799..e91aa4a43 100644 --- a/.azure/azure-pipelines.qns.yml +++ b/.azure/azure-pipelines.qns.yml @@ -60,7 +60,7 @@ jobs: ${{ if eq(variables['Build.Reason'], 'BatchedCI') }}: tags: | latest - v1.10.0.$(Build.BuildId) + v2.0.0.$(Build.BuildId) ${{ if ne(variables['Build.Reason'], 'BatchedCI') }}: tags: custom-$(Build.BuildId) - template: .\templates\run-qns.yml diff --git a/.azure/obtemplates/push-vpack.yml b/.azure/obtemplates/push-vpack.yml index cc9e55823..82e76b67b 100644 --- a/.azure/obtemplates/push-vpack.yml +++ b/.azure/obtemplates/push-vpack.yml @@ -27,8 +27,8 @@ jobs: pushPkgName: msquic.${{ parameters.platform }} owner: quicdev@microsoft.com vpackToken: $(VPACK_PAT) - majorVer: 1 - minorVer: 10 + majorVer: 2 + minorVer: 0 patchVer: 0 prereleaseVer: $(Build.BuildId) diff --git a/CMakeLists.txt b/CMakeLists.txt index e72d18fc4..2c3f3b698 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,6 +54,9 @@ message(STATUS "System version: ${CMAKE_SYSTEM_VERSION}") message(STATUS "Platform version: ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}") message(STATUS "Build type: ${CMAKE_BUILD_TYPE}") +set(QUIC_MAJOR_VERSION 2) +set(QUIC_FULL_VERSION 2.0.0) + if (WIN32) set(CX_PLATFORM "windows") elseif (APPLE) diff --git a/scripts/make-packages.sh b/scripts/make-packages.sh index 3237ec4f2..278a3211a 100755 --- a/scripts/make-packages.sh +++ b/scripts/make-packages.sh @@ -82,8 +82,8 @@ else fi ARTIFACTS="artifacts/bin/${OS}/${ARCH}_${CONFIG}_openssl" -if [ ! -e "$ARTIFACTS/libmsquic.${LIBEXT}" ]; then - echo "$ARTIFACTS/libmsquic.${LIBEXT}" does not exist. Run build first. +if [ ! -e "$ARTIFACTS/libmsquic.${LIBEXT}.${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}" ]; then + echo "$ARTIFACTS/libmsquic.${LIBEXT}.${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}" does not exist. Run build first. exit 1 fi @@ -94,15 +94,19 @@ fi mkdir -p ${OUTPUT} if [ "$OS" == "linux" ]; then + # Create symlink + ln -s "${ARTIFACTS}/libmsquic.${LIBEXT}.${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}" "${ARTIFACTS}/libmsquic.${LIBEXT}.${VER_MAJOR}" + # RedHat/CentOS - FILES="${ARTIFACTS}/libmsquic.${LIBEXT}=/usr/${LIBDIR}/libmsquic.${LIBEXT}" - if [ -e "$ARTIFACTS/libmsquic.lttng.${LIBEXT}" ]; then - FILES="${FILES} ${ARTIFACTS}/libmsquic.lttng.${LIBEXT}=/usr/${LIBDIR}/libmsquic.lttng.${LIBEXT}" + FILES="${ARTIFACTS}/libmsquic.${LIBEXT}.${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}=/usr/${LIBDIR}/libmsquic.${LIBEXT}.${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}" + FILES="${FILES} ${ARTIFACTS}/libmsquic.${LIBEXT}.${VER_MAJOR}=/usr/${LIBDIR}/libmsquic.${LIBEXT}.${VER_MAJOR}" + if [ -e "$ARTIFACTS/libmsquic.lttng.${LIBEXT}.${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}" ]; then + FILES="${FILES} ${ARTIFACTS}/libmsquic.lttng.${LIBEXT}.${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}=/usr/${LIBDIR}/libmsquic.lttng.${LIBEXT}.${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}" fi fpm -f -s dir -t rpm -n ${NAME} -v ${VER_MAJOR}.${VER_MINOR}.${VER_PATCH} --license MIT --url https://github.com/microsoft/msquic \ --package "$OUTPUT" --log error \ --description "${DESCRIPTION}" \ - --provides libmsquic.so \ + --provides libmsquic.so.${VER_MAJOR}.${VER_MINOR}.${VER_PATCH} \ ${CONFLICTS} \ ${FILES} @@ -110,14 +114,15 @@ if [ "$OS" == "linux" ]; then if [ "$LIBDIR" == 'lib64' ]; then LIBDIR="lib/x86_64-linux-gnu" fi - FILES="${ARTIFACTS}/libmsquic.${LIBEXT}=/usr/${LIBDIR}/libmsquic.${LIBEXT}" - if [ -e "$ARTIFACTS/libmsquic.lttng.${LIBEXT}" ]; then - FILES="${FILES} ${ARTIFACTS}/libmsquic.lttng.${LIBEXT}=/usr/${LIBDIR}/libmsquic.lttng.${LIBEXT}" + FILES="${ARTIFACTS}/libmsquic.${LIBEXT}.${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}=/usr/${LIBDIR}/libmsquic.${LIBEXT}.${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}" + FILES="${FILES} ${ARTIFACTS}/libmsquic.${LIBEXT}.${VER_MAJOR}=/usr/${LIBDIR}/libmsquic.${LIBEXT}.${VER_MAJOR}" + if [ -e "$ARTIFACTS/libmsquic.lttng.${LIBEXT}.${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}" ]; then + FILES="${FILES} ${ARTIFACTS}/libmsquic.lttng.${LIBEXT}.${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}=/usr/${LIBDIR}/libmsquic.lttng.${LIBEXT}.${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}" fi fpm -f -s dir -t deb -n ${NAME} -v ${VER_MAJOR}.${VER_MINOR}.${VER_PATCH} --license MIT --url https://github.com/microsoft/msquic \ --package "$OUTPUT" --log error \ --description "${DESCRIPTION}" \ - --provides libmsquic.so \ + --provides libmsquic.so.${VER_MAJOR}.${VER_MINOR}.${VER_PATCH} \ ${CONFLICTS} \ ${FILES} fi @@ -125,6 +130,6 @@ if [ "$OS" == "macos" ]; then fpm -f -s dir -t osxpkg -n ${NAME} -v ${VER_MAJOR}.${VER_MINOR}.${VER_PATCH} --license MIT --url https://github.com/microsoft/msquic \ --package "$OUTPUT" --log error \ --description "${DESCRIPTION}" \ - --provides libmsquic.dylib \ - "$ARTIFACTS/libmsquic.dylib"=/usr/local/lib/libmsquic.dylib + --provides libmsquic.${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}.dylib \ + "$ARTIFACTS/libmsquic.${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}.dylib"=/usr/local/lib/libmsquic.${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}.dylib fi diff --git a/scripts/package-distribution.ps1 b/scripts/package-distribution.ps1 index 345e1d9d9..251689937 100644 --- a/scripts/package-distribution.ps1 +++ b/scripts/package-distribution.ps1 @@ -19,6 +19,8 @@ $ArtifactsBinDir = Join-Path $BaseArtifactsDir "bin" # All direct subfolders are OS's $Platforms = Get-ChildItem -Path $ArtifactsBinDir +$Version = "2.0.0" + $WindowsBuilds = @() $AllBuilds = @() @@ -81,19 +83,24 @@ foreach ($Build in $AllBuilds) { # Find Binaries $Binaries = @() + $DebugFolders = @() if ($Platform -eq "windows" -or $Platform -eq "uwp" -or $Platform -eq "gamecore_console") { $Binaries += Join-Path $ArtifactsDir "msquic.dll" $Binaries += Join-Path $ArtifactsDir "msquic.pdb" } elseif ($Platform -eq "linux") { - $Binaries += Join-Path $ArtifactsDir "libmsquic.so" - $LttngBin = Join-Path $ArtifactsDir "libmsquic.lttng.so" + $Binaries += Join-Path $ArtifactsDir "libmsquic.so.$Version" + $LttngBin = Join-Path $ArtifactsDir "libmsquic.lttng.so.$Version" if (Test-Path $LttngBin) { $Binaries += $LttngBin } } else { # macos - $Binaries += Join-Path $ArtifactsDir "libmsquic.dylib" + $Binaries += Join-Path $ArtifactsDir "libmsquic.$Version.dylib" + $DebugFolder = Join-Path $ArtifactsDir "libmsquic.$Version.dylib.dSYM" + if (Test-Path $DebugFolder) { + $DebugFolders += $DebugFolder + } } $Libraries = @() @@ -125,6 +132,10 @@ foreach ($Build in $AllBuilds) { Copy-Item -LiteralPath $Binary -Destination $CopyToFolder -Force } + foreach ($DebugFolder in $DebugFolders) { + Copy-Item -Path $DebugFolder -Destination $BinFolder -Recurse + } + foreach ($Library in $Libraries) { $FileName = Split-Path -Path $Library -Leaf $CopyToFolder = (Join-Path $LibFolder $FileName) diff --git a/scripts/package-nuget.ps1 b/scripts/package-nuget.ps1 index 17988e960..d601c6687 100644 --- a/scripts/package-nuget.ps1 +++ b/scripts/package-nuget.ps1 @@ -141,7 +141,7 @@ $DistDir = Join-Path $BaseArtifactsDir "dist" $CurrentCommitHash = Get-GitHash -RepoDir $RootDir $RepoRemote = Get-GitRemote -RepoDir $RootDir -$Version = "1.10.0" +$Version = "2.0.0" $BuildId = $env:BUILD_BUILDID if ($null -ne $BuildId) { diff --git a/scripts/update-version.ps1 b/scripts/update-version.ps1 index 37158ce63..9f4783da6 100644 --- a/scripts/update-version.ps1 +++ b/scripts/update-version.ps1 @@ -28,7 +28,9 @@ $MsQuicVerFilePath = Join-Path $RootDir "src" "inc" "msquic.ver" $CreateVPackFilePath = Join-Path $RootDir ".azure" "obtemplates" "push-vpack.yml" $QnsFilePath = Join-Path $RootDir ".azure" "azure-pipelines.qns.yml" $NugetPackageFile = Join-Path $RootDir "scripts" "package-nuget.ps1" +$DistributionFile = Join-Path $RootDir "scripts" "package-distribution.ps1" $FrameworkInfoFile = Join-Path $RootDir "src" "distribution" "Info.plist" +$CMakeFile = Join-Path $RootDir "CMakeLists.txt" $VersionsWriteFile = Join-Path $RootDir "scripts" "write-versions.ps1" # Get the current version number from the msquic.ver file. @@ -55,11 +57,6 @@ Write-Host " New version: $NewVerMajor.$NewVerMinor.$NewVerPatch" -replace "#define VER_MINOR (.*)", "#define VER_MINOR $NewVerMinor" ` -replace "#define VER_PATCH (.*)", "#define VER_PATCH $NewVerPatch" |` Out-File $MsQuicVerFilePath -(Get-Content $CreatePackageFilePath) ` - -replace "majorVer: (.*)", "majorVer: $NewVerMajor" ` - -replace "minorVer: (.*)", "minorVer: $NewVerMinor" ` - -replace "patchVer: (.*)", "patchVer: $NewVerPatch" |` - Out-File $CreatePackageFilePath (Get-Content $CreateVPackFilePath) ` -replace "majorVer: (.*)", "majorVer: $NewVerMajor" ` -replace "minorVer: (.*)", "minorVer: $NewVerMinor" ` @@ -74,6 +71,15 @@ Write-Host " New version: $NewVerMajor.$NewVerMinor.$NewVerPatch" (Get-Content $FrameworkInfoFile) ` -replace "$VerMajor.$VerMinor.$VerPatch", "$NewVerMajor.$NewVerMinor.$NewVerPatch" |` Out-File $FrameworkInfoFile +(Get-Content $DistributionFile) ` + -replace "$VerMajor.$VerMinor.$VerPatch", "$NewVerMajor.$NewVerMinor.$NewVerPatch" |` + Out-File $DistributionFile +(Get-Content $CMakeFile) ` + -replace "`set\(QUIC_MAJOR_VERSION $VerMajor\)", "set(QUIC_MAJOR_VERSION $NewVerMajor)" |` + Out-File $CMakeFile +(Get-Content $CMakeFile) ` + -replace "set\(QUIC_FULL_VERSION $VerMajor.$VerMinor.$VerPatch\)", "set(QUIC_FULL_VERSION $NewVerMajor.$NewVerMinor.$NewVerPatch)" |` + Out-File $CMakeFile (Get-Content $VersionsWriteFile) ` -replace "$VerMajor.$VerMinor.$VerPatch", "$NewVerMajor.$NewVerMinor.$NewVerPatch" |` Out-File $VersionsWriteFile diff --git a/scripts/write-versions.ps1 b/scripts/write-versions.ps1 index b6b647583..35ae41b44 100644 --- a/scripts/write-versions.ps1 +++ b/scripts/write-versions.ps1 @@ -26,7 +26,7 @@ $ArtifactsDir = $BuildConfig.ArtifactsDir $SourceVersion = $env:BUILD_SOURCEVERSION; $SourceBranch = $env:BUILD_SOURCEBRANCH; $BuildId = $env:BUILD_BUILDID; -$VersionNumber = "1.10.0"; +$VersionNumber = "2.0.0"; class BuildData { [string]$SourceVersion; diff --git a/src/bin/CMakeLists.txt b/src/bin/CMakeLists.txt index da355d805..238a983f5 100644 --- a/src/bin/CMakeLists.txt +++ b/src/bin/CMakeLists.txt @@ -13,6 +13,9 @@ if(BUILD_SHARED_LIBS) add_library(msquic SHARED ${SOURCES}) target_link_libraries(msquic PRIVATE core platform inc warnings logging base_link main_binary_link_args) set_target_properties(msquic PROPERTIES OUTPUT_NAME ${QUIC_LIBRARY_NAME}) + if (NOT WIN32) + set_target_properties(msquic PROPERTIES SOVERSION ${QUIC_MAJOR_VERSION} VERSION ${QUIC_FULL_VERSION}) + endif() else() add_library(msquic_static STATIC static/empty.c) target_link_libraries(msquic_static PRIVATE core platform inc logging main_binary_link_args) diff --git a/src/distribution/Info.plist b/src/distribution/Info.plist index 31dce4e73..8912a567f 100644 --- a/src/distribution/Info.plist +++ b/src/distribution/Info.plist @@ -19,7 +19,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleVersion - 1.10.0 + 2.0.0 NSHumanReadableCopyright MIT CFBundleGetInfoString diff --git a/src/generated/CMakeLists.txt b/src/generated/CMakeLists.txt index c3e58b526..a75a4abe7 100644 --- a/src/generated/CMakeLists.txt +++ b/src/generated/CMakeLists.txt @@ -21,6 +21,7 @@ if(QUIC_ENABLE_LOGGING) target_compile_definitions(msquic.lttng PRIVATE BUILDING_TRACEPOINT_PROVIDER) target_link_libraries(msquic.lttng PRIVATE logging_inc inc) target_link_libraries(msquic.lttng PRIVATE ${LTTNGUST_LIBRARIES}) + set_target_properties(msquic.lttng PROPERTIES SOVERSION ${QUIC_FULL_VERSION} VERSION ${QUIC_FULL_VERSION}) install(TARGETS msquic.lttng DESTINATION lib) endif() diff --git a/src/inc/msquic.ver b/src/inc/msquic.ver index 096523950..bbc581e75 100644 --- a/src/inc/msquic.ver +++ b/src/inc/msquic.ver @@ -4,11 +4,11 @@ // #ifndef VER_MAJOR -#define VER_MAJOR 1 +#define VER_MAJOR 2 #endif #ifndef VER_MINOR -#define VER_MINOR 10 +#define VER_MINOR 0 #endif #ifndef VER_PATCH diff --git a/src/platform/platform_posix.c b/src/platform/platform_posix.c index efbe9c196..631fb0a41 100644 --- a/src/platform/platform_posix.c +++ b/src/platform/platform_posix.c @@ -21,6 +21,8 @@ Environment: #include #include #include +#define QUIC_VERSION_ONLY 1 +#include "msquic.ver" #ifdef QUIC_CLOG #include "platform_posix.c.clog.h" #endif @@ -31,7 +33,12 @@ CX_PLATFORM CxPlatform = { NULL }; int RandomFd; // Used for reading random numbers. QUIC_TRACE_RUNDOWN_CALLBACK* QuicTraceRundownCallback; -static const char TpLibName[] = "libmsquic.lttng.so"; +#define STR_HELPER(x) #x +#define STR(x) STR_HELPER(x) + +#define LIBRARY_VERSION STR(VER_MAJOR) "." STR(VER_MINOR) "." STR(VER_PATCH) + +static const char TpLibName[] = "libmsquic.lttng.so." LIBRARY_VERSION; uint32_t CxPlatProcessorCount; @@ -112,7 +119,7 @@ CxPlatSystemLoad( } if (!ShouldLoad) { - return; + goto Exit; } // @@ -121,7 +128,7 @@ CxPlatSystemLoad( Dl_info Info; int Succeeded = dladdr((void *)CxPlatSystemLoad, &Info); if (!Succeeded) { - return; + goto Exit; } size_t PathLen = strlen(Info.dli_fname); @@ -138,7 +145,7 @@ CxPlatSystemLoad( } if (LastTrailingSlashLen == -1) { - return; + goto Exit; } size_t TpLibNameLen = strlen(TpLibName); @@ -146,7 +153,7 @@ CxPlatSystemLoad( char* ProviderFullPath = CXPLAT_ALLOC_PAGED(ProviderFullPathLength, QUIC_POOL_PLATFORM_TMP_ALLOC); if (ProviderFullPath == NULL) { - return; + goto Exit; } CxPlatCopyMemory(ProviderFullPath, Info.dli_fname, LastTrailingSlashLen); @@ -161,6 +168,8 @@ CxPlatSystemLoad( CXPLAT_FREE(ProviderFullPath, QUIC_POOL_PLATFORM_TMP_ALLOC); +Exit: + QuicTraceLogInfo( PosixLoaded, "[ dso] Loaded");