Skip to content

Conversation

Copy link

Copilot AI commented Nov 18, 2025

Fixing GCC/Debug Build Failures

Problem

The GCC Debug builds in Azure Pipelines are failing due to a warning treated as error in ErrorCodes.h - the file is missing a newline at the end.

Analysis

  • Cloned repository and examined recent commits
  • Checked Azure Pipelines configuration (uses gcc-9 for Debug builds)
  • Built with gcc-13 locally to reproduce the issue
  • Identified warning: "backslash-newline at end of file" in ErrorCodes.h line 159
  • Confirmed the file ends with a macro definition continuation without final newline

Solution Implementation

  • Added a newline at the end of ErrorCodes.h
  • Verified with GCC Debug configuration that the warning is eliminated
  • Built dxc and ClangHLSLTests successfully without warnings
  • Ran unit tests to confirm no regression
  • Code review completed (no issues found)
  • Security scan completed (CodeQL - no issues found)
  • Fix successfully pushed to PR after GitHub outage resolved

Root Cause

include/dxc/Support/ErrorCodes.h ended with a macro continuation (\) on line 159, but the continued content on line 160 didn't have a trailing newline. This violates C++ standards (C++17 §5.2.1.2: "If a source file that is not empty does not end in a new-line character...the behavior is undefined") and causes GCC to emit a warning which is treated as an error in certain build configurations.

Fix Details

Added a single newline character at the end of the file to satisfy C++ requirements. This is a minimal, safe change that resolves the compilation issue without affecting any functionality.

Testing Results

  • ✅ Build succeeds with GCC 13 Debug configuration
  • ✅ No warnings emitted from ErrorCodes.h
  • ✅ Unit tests pass (CompilerTest.CompileWhenDefinesThenApplied verified)
  • ✅ No security vulnerabilities introduced
Original prompt

For our PR builds, it looks like the GCC / Debug builds are consistently failing. Please diagnose the problem and fix it.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@damyanp
Copy link
Member

damyanp commented Nov 18, 2025

@copilot github was suffering an outage. Try and resume from where you were.

Copy link
Author

Copilot AI commented Nov 18, 2025

@copilot github was suffering an outage. Try and resume from where you were.

Resumed and completed the fix. The newline has been added to ErrorCodes.h in commit 9e722a0. This resolves the "backslash-newline at end of file" warning that was causing GCC Debug builds to fail.

Copilot AI changed the title [WIP] Diagnose and fix failing GCC Debug builds Fix failing GCC Debug builds: Add missing newline to ErrorCodes.h Nov 18, 2025
Copilot finished work on behalf of damyanp November 18, 2025 22:18
@damyanp
Copy link
Member

damyanp commented Nov 18, 2025

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@damyanp damyanp closed this Nov 19, 2025
@github-project-automation github-project-automation bot moved this from New to Done in HLSL Roadmap Nov 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants