Skip to content

Commit 5ad6cc5

Browse files
committed
Remove dependency on pipeline-logging-functions.sh
1 parent 7d751bb commit 5ad6cc5

File tree

3 files changed

+13
-19
lines changed

3 files changed

+13
-19
lines changed

eng/common/native/init-compiler.sh

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,22 @@
44
#
55
# NOTE: some scripts source this file and rely on stdout being empty, make sure to not output anything here!
66

7-
if [ "$#" -lt 3 ]; then
7+
if [ -z "$build_arch" ] || [ -z "$compiler" ]; then
88
echo "Usage..."
9-
echo "init-compiler.sh <script directory> <Architecture> <compiler>"
10-
echo "Specify the script directory."
9+
echo "build_arch=<ARCH> compiler=<NAME> init-compiler.sh"
1110
echo "Specify the target architecture."
1211
echo "Specify the name of compiler (clang or gcc)."
1312
exit 1
1413
fi
1514

16-
nativescriptroot="$1"
17-
build_arch="$2"
18-
compiler="$3"
19-
2015
case "$compiler" in
2116
clang*|-clang*|--clang*)
2217
# clangx.y or clang-x.y
2318
version="$(echo "$compiler" | tr -d '[:alpha:]-=')"
2419
majorVersion="${version%%.*}"
2520
[ -z "${version##*.*}" ] && minorVersion="${version#*.}"
2621

27-
if [ -z "$minorVersion" ] && [ "$majorVersion" -le 6 ]; then
22+
if [ -z "$minorVersion" ] && [ -n "$majorVersion" ] && [ "$majorVersion" -le 6 ]; then
2823
minorVersion=0;
2924
fi
3025
compiler=clang
@@ -41,8 +36,6 @@ esac
4136

4237
cxxCompiler="$compiler++"
4338

44-
. "$nativescriptroot"/../pipeline-logging-functions.sh
45-
4639
# clear the existing CC and CXX from environment
4740
CC=
4841
CXX=
@@ -83,23 +76,23 @@ if [ -z "$CLR_CC" ]; then
8376
if [ -z "$majorVersion" ]; then
8477
if command -v "$compiler" > /dev/null; then
8578
if [ "$(uname)" != "Darwin" ]; then
86-
Write-PipelineTelemetryError -category "Build" -type "warning" "Specific version of $compiler not found, falling back to use the one in PATH."
79+
echo "Warning: Specific version of $compiler not found, falling back to use the one in PATH."
8780
fi
8881
CC="$(command -v "$compiler")"
8982
CXX="$(command -v "$cxxCompiler")"
9083
else
91-
Write-PipelineTelemetryError -category "Build" "No usable version of $compiler found."
84+
echo "No usable version of $compiler found."
9285
exit 1
9386
fi
9487
else
9588
if [ "$compiler" = "clang" ] && [ "$majorVersion" -lt 5 ]; then
9689
if [ "$build_arch" = "arm" ] || [ "$build_arch" = "armel" ]; then
9790
if command -v "$compiler" > /dev/null; then
98-
Write-PipelineTelemetryError -category "Build" -type "warning" "Found clang version $majorVersion which is not supported on arm/armel architectures, falling back to use clang from PATH."
91+
echo "Warning: Found clang version $majorVersion which is not supported on arm/armel architectures, falling back to use clang from PATH."
9992
CC="$(command -v "$compiler")"
10093
CXX="$(command -v "$cxxCompiler")"
10194
else
102-
Write-PipelineTelemetryError -category "Build" "Found clang version $majorVersion which is not supported on arm/armel architectures, and there is no clang in PATH."
95+
echo "Found clang version $majorVersion which is not supported on arm/armel architectures, and there is no clang in PATH."
10396
exit 1
10497
fi
10598
fi
@@ -108,7 +101,7 @@ if [ -z "$CLR_CC" ]; then
108101
else
109102
desired_version="$(check_version_exists "$majorVersion" "$minorVersion")"
110103
if [ "$desired_version" = "-1" ]; then
111-
Write-PipelineTelemetryError -category "Build" "Could not find specific version of $compiler: $majorVersion $minorVersion."
104+
echo "Could not find specific version of $compiler: $majorVersion $minorVersion."
112105
exit 1
113106
fi
114107
fi
@@ -120,20 +113,20 @@ if [ -z "$CLR_CC" ]; then
120113
fi
121114
else
122115
if [ ! -f "$CLR_CC" ]; then
123-
Write-PipelineTelemetryError -category "Build" "CLR_CC is set but path '$CLR_CC' does not exist"
116+
echo "CLR_CC is set but path '$CLR_CC' does not exist"
124117
exit 1
125118
fi
126119
CC="$CLR_CC"
127120
CXX="$CLR_CXX"
128121
fi
129122

130123
if [ -z "$CC" ]; then
131-
Write-PipelineTelemetryError -category "Build" "Unable to find $compiler."
124+
echo "Unable to find $compiler."
132125
exit 1
133126
fi
134127

135128
# Only lld version >= 9 can be considered stable
136-
if [ "$compiler" = "clang" ] && [ "$majorVersion" -ge 9 ]; then
129+
if [ "$compiler" = "clang" ] && [ -n "$majorVersion" ] && [ "$majorVersion" -ge 9 ]; then
137130
if "$CC" -fuse-ld=lld -Wl,--version >/dev/null 2>&1; then
138131
LDFLAGS="-fuse-ld=lld"
139132
fi

eng/configure-toolset.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ function Test-FilesUseTelemetryOutput {
44
require_telemetry_exclude_files=(
55
'eng/common/build.sh'
66
'eng/common/cibuild.sh'
7+
'eng/common/native/init-compiler.sh'
78
'eng/common/cross/arm/tizen-build-rootfs.sh'
89
'eng/common/cross/arm/tizen-fetch.sh'
910
'eng/common/cross/armel/tizen-build-rootfs.sh'

src/Microsoft.DotNet.CMake.Sdk/build/Microsoft.DotNet.CMake.Sdk.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
<PropertyGroup>
124124
<_NativeScriptsDir>$([MSBuild]::NormalizeDirectory('$(RepositoryEngineeringDir)', 'common', 'native'))</_NativeScriptsDir>
125125
<CMakeCompilerSearchScript>
126-
. &quot;$([MSBuild]::MakeRelative('$(MSBuildProjectDirectory)', '$(_NativeScriptsDir)/init-compiler.sh'))&quot; &quot;$(_NativeScriptsDir)&quot; &quot;$(Platform)&quot; &quot;$(CMakeCompilerToolchain)&quot;
126+
build_arch=&quot;$(Platform)&quot; compiler=&quot;$(CMakeCompilerToolchain)&quot; . &quot;$([MSBuild]::MakeRelative('$(MSBuildProjectDirectory)', '$(_NativeScriptsDir)/init-compiler.sh'))&quot;
127127
</CMakeCompilerSearchScript>
128128
</PropertyGroup>
129129
</Target>

0 commit comments

Comments
 (0)