Skip to content

Local Windows builds rewrite generated CI files with CRLF in LF checkouts #770

In review

Description

@lahma

Usage information: Fallout 10.5.0, .NET SDK 10.0.302, net10.0, Windows 11.

Problem

In a checkout that uses LF line breaks (for example *.yml text eol=lf in .gitattributes), a local build on Windows rewrites the generated CI files and .fallout/build.schema.json with CRLF. git status then lists them as modified, and the build logs:

[WRN] Configuration files for GitHubActions (build) have changed.

Only the line breaks differ: git diff --ignore-cr-at-eol is empty. The warning comes back each time the files are restored. So it is noise, and a real change of the generated content looks the same.

Cause

  • ConfigurationAttributeBase.CreateStream (src/Fallout.Build/CICD/ConfigurationAttributeBase.cs:85) opens a StreamWriter with the default NewLine, which is CRLF on Windows. Every CI host uses this base class.
  • InvokeBuildServerConfigurationGenerationAttribute compares file hashes byte for byte, so a line-break change counts as a change.
  • TeamCity's .teamcity/pom.xml and the default .fallout/parameters.json are also written with the platform line break.
  • .fallout/build.schema.json is CRLF on Windows in 10.5.0. On develop it is always LF since Align parameter profiles and schemas with JSON values #703 (JSON values for parameter profiles and schemas). That fixes LF checkouts, but it rewrites the schema in CRLF checkouts (core.autocrlf=true).

Outcome

Regenerating unchanged content leaves each generated file byte-identical, in LF and in CRLF checkouts. The warning shows only when the content changed.

Acceptance criteria

  • A generated file keeps the line break of the existing file.
  • A new generated file gets LF.
  • This covers the CI configuration files of every host, TeamCity's pom.xml, .fallout/build.schema.json and the default .fallout/parameters.json.

Known workaround

Subclass the CI attribute and override CreateStream to set NewLine = "\n". Rewrite the schema file in OnBuildCreated.

I will open a PR for this.

Activity

  1. added
    bug
    on Nov 30, 2026
  2. added
    release/Stable
    on Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugrelease/Stable

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions