Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions THIRD-PARTY-NOTICES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
NOTICES AND INFORMATION
Do Not Translate or Localize

This software incorporates material from third parties.
Microsoft makes certain open source code available at https://3rdpartysource.microsoft.com,
or you may send a check or money order for US $5.00, including the product name,
the open source component name, platform, and version number, to:

Source Code Compliance Team
Microsoft Corporation
One Microsoft Way
Redmond, WA 98052
USA

Notwithstanding any other terms, you may reverse engineer this software to the extent
required to debug changes to any libraries licensed under the GNU Lesser General Public License.

libxml2
Comment thread
plnelson marked this conversation as resolved.
=======

Copyright (C) 1998-2012 Daniel Veillard. All Rights Reserved.
Copyright (C) The Libxml2 Contributors.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
81 changes: 81 additions & 0 deletions build/yaml/pipelines/build_images.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

# Build Pipeline: Linux Build Images
# Manually rebuilds and publishes the Ubuntu and Alpine images used by Linux CI.

trigger: none
pr: none

name: $(date:yyyyMMdd)$(rev:rr)

parameters:
- name: ImageTag
displayName: Container image tag
type: string
default: latest

variables:
TeamName: ClrInstrumentationEngine
RegistryName: proddiagbuild
RegistryServer: proddiagbuild.azurecr.io

jobs:
- job: BuildImages
displayName: Build Linux images

pool:
${{ if eq(variables['System.TeamProject'], 'devdiv') }}:
name: AzurePipelines-EO
image: 1ESPT-Ubuntu20.04
os: linux
${{ else }}:
vmImage: ubuntu-latest

steps:
- checkout: self
clean: true

- bash: |
set -e
if [[ ! "$IMAGE_TAG" =~ ^[A-Za-z0-9_.-]+$ ]]; then
echo "Invalid image tag: $IMAGE_TAG"
exit 1
fi
displayName: Validate image tag
env:
IMAGE_TAG: ${{ parameters.ImageTag }}

- task: AzureCLI@2
displayName: Docker login
inputs:
azureSubscription: 'VS Diagnostics Dev (ProdDiagBuild)'
scriptType: bash
scriptLocation: inlineScript
inlineScript: az acr login --name $(RegistryName)

- bash: |
set -e
image="$(RegistryServer)/clrie-build-ubuntu:$IMAGE_TAG"
docker build --pull \
--label "org.opencontainers.image.revision=$(Build.SourceVersion)" \
--tag "$image" \
--file src/unix/docker/dockerfiles/build/ubuntu/Dockerfile \
src/unix/docker/context
docker push "$image"
displayName: Build and push Ubuntu image
env:
IMAGE_TAG: ${{ parameters.ImageTag }}

- bash: |
set -e
image="$(RegistryServer)/clrie-build-alpine:$IMAGE_TAG"
docker build --pull \
--label "org.opencontainers.image.revision=$(Build.SourceVersion)" \
--tag "$image" \
--file src/unix/docker/dockerfiles/build/alpine/Dockerfile \
src/unix/docker/context
docker push "$image"
displayName: Build and push Alpine image
env:
IMAGE_TAG: ${{ parameters.ImageTag }}
11 changes: 11 additions & 0 deletions build/yaml/steps/linux/binaries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,23 @@ steps:
scriptLocation: inlineScript
inlineScript: 'az acr login --name proddiagbuild'

# Restore vcpkg source and binary caches
- task: Cache@2
displayName: Restore vcpkg cache
inputs:
key: '"vcpkg" | "$(Agent.OS)" | "$(Distro)" | src/vcpkg.json | src/unix/docker/context/components/vcpkg/cgmanifest.json'
restoreKeys: |
"vcpkg" | "$(Agent.OS)" | "$(Distro)"
path: $(Pipeline.Workspace)/vcpkg-cache

# Build binaries
- task: Bash@3
displayName: Docker Build
inputs:
filePath: src/unix/docker/docker-build.sh
arguments: $(Distro) $(Configuration) $(Platform) verbose
env:
VCPKG_CACHE_ROOT: $(Pipeline.Workspace)/vcpkg-cache

# Cleanup containers
- task: Bash@3
Expand Down
9 changes: 9 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,15 @@ add_library_pal(coreclrpal true ${CORECLR_PAL_ROOT}/lib/${CMAKE_BUILD_TYPE}/libc
add_library_pal(palrt true ${CORECLR_PAL_ROOT}/lib/${CMAKE_BUILD_TYPE}/libpalrt.a)
add_library_pal(corguids false ${CORECLR_PAL_ROOT}/lib/${CMAKE_BUILD_TYPE}/libcorguids.a)

if(CMAKE_SYSTEM_NAME STREQUAL Linux)
find_package(LibXml2 CONFIG REQUIRED)
target_link_options(LibXml2::LibXml2 INTERFACE
"LINKER:--exclude-libs,libxml2.a"
)
else()
find_package(LibXml2 REQUIRED)
endif()

add_subdirectory(unix/src)
add_subdirectory(unix/src/atl)
add_subdirectory(Common.Lib)
Expand Down
8 changes: 6 additions & 2 deletions src/Common.Lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@

cmake_minimum_required(VERSION 3.14)
project(Common.Lib)
find_package(LibXml2 REQUIRED)

include_directories(. ${LIBXML2_INCLUDE_DIR})
include_directories(.)
build_init(CPP Common.Lib)

#note: we purposfully exclude windows-only files,
Expand All @@ -28,4 +27,9 @@ add_lib(${PROJECT_NAME}
${src_files}
)

target_link_libraries(${PROJECT_NAME}
PUBLIC
LibXml2::LibXml2
)

#target_compile_options(Common.Lib PUBLIC "-H")
10 changes: 7 additions & 3 deletions src/InstrumentationEngine.Lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@

cmake_minimum_required(VERSION 3.14)
project(InstrumentationEngine.Lib)
find_package(LibXml2 REQUIRED)

include_directories(. ${LIBXML2_INCLUDE_DIR})
include_directories(.)

build_init(CPP InstrumentationEngine.Lib)

Expand All @@ -30,4 +29,9 @@ add_lib(${PROJECT_NAME}
true # use_redefines
false # hide_symbols
${src_files}
)
)

target_link_libraries(${PROJECT_NAME}
PRIVATE
LibXml2::LibXml2
)
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

<!-- Licensing -->
<file src="$enlistmentroot$\$licenseFile$*" target="" />
<file src="$enlistmentroot$\THIRD-PARTY-NOTICES.txt" target="" />

<!-- Icon -->
<file src="$enlistmentroot$\src\SharedNuGetAssets\icon.png" target="" />
Expand Down
5 changes: 1 addition & 4 deletions src/InstrumentationEngine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
cmake_minimum_required(VERSION 2.8.12)
project(InstrumentationEngine)

find_package(LibXml2 REQUIRED)

include_directories(. ../InstrumentationEngine.Lib ${LIBXML2_INCLUDE_DIR})
include_directories(. ../InstrumentationEngine.Lib)

build_init(CPP InstrumentationEngine)

Expand Down Expand Up @@ -90,7 +88,6 @@ endif()
target_link_libraries(${PROJECT_NAME}
pthread
stdc++
${LIBXML2_LIBRARIES}
${CORECLRPAL}
${LINUXPAL}
${ATL}
Expand Down
4 changes: 1 addition & 3 deletions src/Tests/CommonLibTests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ cmake_minimum_required(VERSION 3.14)
fetch_google_test()

project(Common.LibTests)
find_package(LibXml2 REQUIRED)

# the midl directory is needed to replace the rpc headers referenced by midl generated headers.
include_directories(. ${REPOSITORY_ROOT}/src/unix/inc/midl ${REPOSITORY_ROOT}/src ${LIBXML2_INCLUDE_DIR})
include_directories(. ${REPOSITORY_ROOT}/src/unix/inc/midl ${REPOSITORY_ROOT}/src)

build_init(CPP Common.LibTests)

Expand All @@ -29,7 +28,6 @@ add_executable(

target_link_libraries(
${PROJECT_NAME}
${LIBXML2_LIBRARIES}
Common.Lib
gtest_main
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
cmake_minimum_required(VERSION 3.14)

project(NaglerInstrumentationEngine)
find_package(LibXml2 REQUIRED)

include_directories(. ${REPOSITORY_ROOT}/src ${LIBXML2_INCLUDE_DIR})
include_directories(. ${REPOSITORY_ROOT}/src)

# don't use the PAL for tests
build_init(CPP InstrumentationEngine)
Expand Down Expand Up @@ -47,7 +46,6 @@ target_link_libraries(
${PROJECT_NAME}
pthread
stdc++
${LIBXML2_LIBRARIES}
Common.Lib
)

Expand Down
4 changes: 1 addition & 3 deletions src/Tests/InstrumentationEngineLibTests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ cmake_minimum_required(VERSION 3.14)
fetch_google_test()

project(InstrumentationEngine.LibTests)
find_package(LibXml2 REQUIRED)

include_directories(. ${REPOSITORY_ROOT}/src ${LIBXML2_INCLUDE_DIR})
include_directories(. ${REPOSITORY_ROOT}/src)

# don't use the PAL for tests
build_init(CPP InstrumentationEngine.LibTests)
Expand Down Expand Up @@ -58,7 +57,6 @@ target_link_libraries(
${PROJECT_NAME}
pthread
stdc++
${LIBXML2_LIBRARIES}
${CORECLRPAL}
${LINUXPAL}
${ATL}
Expand Down
59 changes: 53 additions & 6 deletions src/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,10 @@ get_cmake()
echo "found cmake version $cmakeVersion"
cmakeMajor=$(echo $cmakeVersion | sed 's/^.*[^0-9]\([0-9]*\)\..*$/\1'/)
cmakeMinor=$(echo $cmakeVersion | sed 's/^.*[^0-9]*\.\([0-9]*\)\..*$/\1'/)
if (( $cmakeMajor > 3 )); then
if (( $cmakeMinor >= 14 )); then
# found sufficient cmake, continue.
echo $cmakeLocation
return
fi
if (( $cmakeMajor > 3 || ($cmakeMajor == 3 && $cmakeMinor >= 14) )); then
# found sufficient cmake, continue.
echo $cmakeLocation
return
fi

echo "Insufficient cmake version. Ensure cmake version 3.14 or later is installed"
Expand Down Expand Up @@ -190,6 +188,10 @@ locate_build_tools()
cmake_extra_defines="$cmake_extra_defines -DCLR_CMAKE_LINUX_ID=$ID"
fi

if [[ -n "$__VcpkgInstalledDir" ]]; then
cmake_extra_defines="$cmake_extra_defines -DCMAKE_PREFIX_PATH=$__VcpkgInstalledDir/$__VcpkgTriplet"
fi

locate_google_test
$echo "found google version '$__GoogleTestTag' test at '$__GoogleTestUrl'"
}
Expand Down Expand Up @@ -359,6 +361,47 @@ restore_build_dependencies()
fi
}

restore_vcpkg_dependencies()
{
if [ -z "$VCPKG_ROOT" ] || [ ! -x "$VCPKG_ROOT/vcpkg" ]; then
echo "ERROR: VCPKG_ROOT must point to a bootstrapped vcpkg installation."
exit 1
fi

__VcpkgInstalledDir="$__IntermediatesDir/vcpkg_installed"
__VcpkgTriplet=x64-linux

"$VCPKG_ROOT/vcpkg" install \
--x-manifest-root="$EnlistmentRoot/src" \
--x-install-root="$__VcpkgInstalledDir" \
--triplet="$__VcpkgTriplet" \
--clean-after-build

if [ $? -ne 0 ]; then
echo "ERROR: vcpkg dependency restore failed."
exit 1
fi
}

configure_vcpkg_cache()
{
local cacheRoot="${VCPKG_CACHE_ROOT:-$EnlistmentRoot/out/vcpkg-cache}"

mkdir -p "$cacheRoot/assets" "$cacheRoot/archives"
if [ $? -ne 0 ]; then
echo "ERROR: Unable to create vcpkg cache at '$cacheRoot'."
exit 1
fi

if [ -z "$X_VCPKG_ASSET_SOURCES" ]; then
export X_VCPKG_ASSET_SOURCES="clear;x-azurl,file://$cacheRoot/assets/,,readwrite"
fi

if [ -z "$VCPKG_BINARY_SOURCES" ]; then
export VCPKG_BINARY_SOURCES="clear;files,$cacheRoot/archives,readwrite"
fi
}

# Set default clang version
set_clang_path_and_version()
{
Expand Down Expand Up @@ -570,6 +613,10 @@ setup_dirs
check_prereqs

restore_build_dependencies
if [ "$OSName" == "Linux" ]; then
configure_vcpkg_cache
restore_vcpkg_dependencies
fi

pwd

Expand Down
6 changes: 3 additions & 3 deletions src/unix/docker/context/components/cmake/cgmanifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"Type": "other",
"other": {
"Name": "cmake",
"Version": "3.20.2",
"DownloadUrl": " https://github.com/Kitware/CMake/releases/download/v3.20.2/cmake-3.20.2.tar.gz",
"SHA256CHECK": "aecf6ecb975179eb3bb6a4a50cae192d41e92b9372b02300f9e8f1d5f559544e"
"Version": "3.31.10",
"DownloadUrl": "https://github.com/Kitware/CMake/releases/download/v3.31.10/cmake-3.31.10.tar.gz",
"SHA256CHECK": "cf06fadfd6d41fa8e1ade5099e54976d1d844fd1487ab99942341f91b13d3e29"
}
},
"DevelopmentDependency": true
Expand Down
Loading
Loading