Skip to content

Remove dead BUILDING_WITH_LKG define#19321

Closed
bbatsov wants to merge 1 commit intodotnet:mainfrom
bbatsov:remove-building-with-lkg-define
Closed

Remove dead BUILDING_WITH_LKG define#19321
bbatsov wants to merge 1 commit intodotnet:mainfrom
bbatsov:remove-building-with-lkg-define

Conversation

@bbatsov
Copy link
Contributor

@bbatsov bbatsov commented Feb 18, 2026

PR #19235 removed all the #if BUILDING_WITH_LKG conditionals from source code, but left the constant itself defined in Directory.Build.props and FSharp.Profiles.props. It's dead code now — no #if directive references it. This removes both definitions.

Fixes #18061

The BUILDING_WITH_LKG constant was left behind after dotnet#19235 removed all
the #if conditionals that referenced it. It's now defined but never used
anywhere in the source. Remove it from both props files.
@github-actions
Copy link
Contributor

✅ No release notes required

@T-Gro
Copy link
Member

T-Gro commented Feb 18, 2026

I think we shall keep it - to make life of future contributors, human or agentic, easier.

The constant is by nature ephemeral.
We only ever need it when we create a new language feature, want to dogfood such feature, and we know LKG (Last Known Good, an acronym to indicate a production shipped version of the compiler) does not support it.
As of now, no such feature exists, but I think it is a matter of time ( #18927 comes to mind :))) ).

While the feature is developed, we will then again need to temporarily have #if BUILDING_WITH_LKG in the code, block without the feature for LKG, and then a "modern" code block that uses the bootstrapped compiler.
And after the feature is shipped to a stable LKG, we can again remove the #if.

One can wonder - why not just wait until the feature gets shipped?
It has proven value during development to apply the feature immediately, because it is a good source of dogfooding - not only for bugs, but also for "testing" ergonomics and.

@T-Gro T-Gro marked this pull request as draft February 18, 2026 11:46
@bbatsov
Copy link
Contributor Author

bbatsov commented Feb 18, 2026

Up to you - I was just going over issues with "good first issue" and this one seemed simple enough.

@T-Gro
Copy link
Member

T-Gro commented Feb 18, 2026

The issue about nullness related ifdefs is completed now, thanks for bringing it to my attention.
Lets keep the BUILDING_WITH_LKG in 👍 .

@T-Gro T-Gro closed this Feb 18, 2026
@bbatsov bbatsov deleted the remove-building-with-lkg-define branch March 5, 2026 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Compiler codebase chore :: Hash directives around nullness syntax are not needed anymore

2 participants