Skip to content

Commit 3e96ebd

Browse files
committed
Fix CI: pin .NET SDK to 8.0 and fail on build errors
Add global.json to pin the .NET SDK to 8.0.x, preventing CI runners with .NET 10 pre-installed from using the wrong compiler (which breaks Docxodus due to List<T>.Reverse() vs LINQ Reverse() resolution). Also fix build_differ.py run_command() to raise on non-zero exit codes instead of silently continuing past build failures.
1 parent 0c3060b commit 3e96ebd

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

build_differ.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,14 @@ def get_version():
2626

2727
def run_command(command):
2828
"""
29-
Runs a shell command and prints its output.
29+
Runs a shell command and prints its output. Raises on non-zero exit code.
3030
"""
3131
process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
3232
for line in process.stdout:
3333
print(line.decode().strip())
34+
process.wait()
35+
if process.returncode != 0:
36+
raise RuntimeError(f"Command failed with exit code {process.returncode}: {command}")
3437

3538

3639
def compress_files(source_dir, target_file):

global.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"sdk": {
3+
"version": "8.0.0",
4+
"rollForward": "latestFeature"
5+
}
6+
}

0 commit comments

Comments
 (0)