From 34bc8e00d141c3cfd7c0ab050625201c26dfb023 Mon Sep 17 00:00:00 2001 From: Omair Majid Date: Fri, 16 Oct 2026 13:22:21 -0400 Subject: [PATCH] Allow expected runtime-pack JSON files The SharedFramework SDK intentionally generates framework .deps.json and .runtimeconfig.json files in runtime packs. Allow those files in their expected runtime-pack locations while continuing to flag unexpected JSON under packs. See dotnet/arcade#5714. Fixes: #251 Assisted-by: GPT-6 Luna --- targeting-packs-bad-files/test.json | 4 ---- targeting-packs-bad-files/test.sh | 20 ++++++++++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/targeting-packs-bad-files/test.json b/targeting-packs-bad-files/test.json index f0e52057..e4149b80 100644 --- a/targeting-packs-bad-files/test.json +++ b/targeting-packs-bad-files/test.json @@ -7,10 +7,6 @@ "type": "bash", "cleanup": true, "skipWhen": [ - "version=8", // see https://github.com/redhat-developer/dotnet-regular-tests/issues/251 - "version=9", // see https://github.com/redhat-developer/dotnet-regular-tests/issues/251 - "version=10", // see https://github.com/redhat-developer/dotnet-regular-tests/issues/251 - "version=11" // see https://github.com/redhat-developer/dotnet-regular-tests/issues/251 ], "ignoredRIDs":[ diff --git a/targeting-packs-bad-files/test.sh b/targeting-packs-bad-files/test.sh index 9fe2fe6e..7145875b 100755 --- a/targeting-packs-bad-files/test.sh +++ b/targeting-packs-bad-files/test.sh @@ -9,10 +9,22 @@ echo "Found .NET at $dotnet_dir" errors=0 -json_lines=$(find "$dotnet_dir/packs" -iname '*.json' | wc -l) -if [[ $json_lines -gt 0 ]]; then - echo "error: found some json files in $dotnet_dir/packs" - find "$dotnet_dir/packs" -iname '*.json' +# The SharedFramework SDK intentionally generates each runtime pack's framework +# .deps.json and .runtimeconfig.json at runtimes//lib/. +# See https://github.com/dotnet/arcade/pull/5714 +# Allow only those known files in that layout; other JSON files in packs are unexpected. +bad_json_files=() +while IFS= read -r -d '' json_file; do + relative_path=${json_file#"$dotnet_dir/packs/"} + if [[ ! $relative_path =~ ^Microsoft\.NETCore\.App\.Runtime(\.NativeAOT)?\.[^/]+/[^/]+/runtimes/[^/]+/lib/net[^/]+/Microsoft\.NETCore\.App\.(deps|runtimeconfig)\.json$ && + ! $relative_path =~ ^Microsoft\.AspNetCore\.App\.Runtime\.[^/]+/[^/]+/runtimes/[^/]+/lib/net[^/]+/Microsoft\.AspNetCore\.App\.(deps|runtimeconfig)\.json$ ]]; then + bad_json_files+=("$json_file") + fi +done < <(find "$dotnet_dir/packs" -iname '*.json' -print0) + +if [[ ${#bad_json_files[@]} -gt 0 ]]; then + echo "error: found unexpected json files in $dotnet_dir/packs" + printf '%s\n' "${bad_json_files[@]}" errors=1 fi