Skip to content

Commit af775c9

Browse files
Fix clang tool downloads (#84799)
1. Make downloading more robust by failing the download script if there is a download error. 2. Map macOS and Ubuntu RIDs to RIDs that we know have versions to download. This same logic is in the dotnet/jitutils bootstrap.sh script. We don't want to upload versions for every RID since they are all compatible. This makes the script robust to people running on new releases. 3. Add more logging.
1 parent 7293d5f commit af775c9

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

eng/formatting/download-tools.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,25 @@ scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
1717
function DownloadClangTool {
1818
targetPlatform=$(dotnet --info |grep RID:)
1919
targetPlatform=${targetPlatform##*RID:* }
20+
echo "dotnet RID: ${targetPlatform}"
21+
22+
# override common RIDs with compatible version so we don't need to upload binaries for each RID
23+
case $targetPlatform in
24+
osx.*-x64)
25+
targetPlatform=osx.10.15-x64
26+
;;
27+
ubuntu.*-x64)
28+
targetPlatform=ubuntu.18.04-x64
29+
;;
30+
esac
2031

2132
toolUrl=https://clrjit.blob.core.windows.net/clang-tools/${targetPlatform}/$1
2233
toolOutput=$2/$1
2334

35+
echo "Downloading $1 from ${toolUrl} to ${toolOutput}"
36+
2437
if [[ ! -x "$toolOutput" ]]; then
25-
curl --retry 5 -o "${toolOutput}" "$toolUrl"
38+
curl --silent --retry 5 --fail -o "${toolOutput}" "$toolUrl"
2639
chmod 751 $toolOutput
2740
fi
2841

src/coreclr/scripts/jitformat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def main(argv):
8181
args, unknown = parser.parse_known_args(argv)
8282

8383
if unknown:
84-
logging.warn('Ignoring argument(s): {}'.format(','.join(unknown)))
84+
logging.warning('Ignoring argument(s): {}'.format(','.join(unknown)))
8585

8686
if args.coreclr is None:
8787
logging.error('Specify --coreclr')

0 commit comments

Comments
 (0)