Add EmitFrontendCommandLines user default - #1345
Open
benlangmuir wants to merge 1 commit into
Open
Conversation
benlangmuir
requested review from
aciidgh,
jakepetroules,
mhrawdon,
neonichu and
owenv
as code owners
April 24, 2026 23:58
Contributor
Author
|
@swift-ci test |
jakepetroules
requested changes
Apr 25, 2026
| pushTable(.exported) { $0.push(BuiltinMacros.COMPILATION_CACHE_CAS_PATH, BuiltinMacros.namespace.parseString("$(\(compileCacheDirMacro))/CompilationCache.noindex")) } | ||
| } | ||
|
|
||
| if UserDefaults.emitFrontendCommandLines { |
Collaborator
There was a problem hiding this comment.
We try to avoid reading UserDefaults from static globals like this for new settings. Take a look at UserPreferences instead
Contributor
Author
There was a problem hiding this comment.
Do setUserPreferences or SetSessionUserPreferencesRequest have API stability or other compatibility requirements? I see we already have one deprecated setUserPreferences that lets you skip one value, which is what made me wonder about this.
Collaborator
There was a problem hiding this comment.
IPC requests like SetSessionUserPreferencesRequest or public APIs in the SwiftBuild module should try to maintain temporary compatibility on the decode side for approximately one release cycle. Other than that, no.
Introduce a new user default that sets EMIT_FRONTEND_COMMAND_LINES persistently and works better with swift package builds outside Xcode. This is a lighter-weight alternative to EnableDebugActivityLogs for users who only want frontend command lines logged. Why not just use EnableDebugActivityLogs? It's too verbose for my use case where I want to leave this enabled permanently. Debug logs are ~4x larger in storage size than simply emitting frontend lines, and more importantly they are ~15x more lines, which I find makes them very challenging to read as a human (the discrepancy between 4x and 15x is because many of the extra lines have few characters on them while the frontend commands themselves are very long lines). That was measured building swift-build itself, but it matches my general impression from other projects.
benlangmuir
force-pushed
the
blangmuir/emit-frontend-command-lines
branch
from
April 28, 2026 22:30
890cc60 to
f5d267c
Compare
Contributor
Author
|
@swift-ci test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce a new user default that sets EMIT_FRONTEND_COMMAND_LINES persistently and works better with swift package builds outside Xcode. This is a lighter-weight alternative to EnableDebugActivityLogs for users who only want frontend command lines logged.
Why not just use EnableDebugActivityLogs? It's too verbose for my use case where I want to leave this enabled permanently. Debug logs are ~4x larger in storage size than simply emitting frontend lines, and more importantly they are ~15x more lines, which I find makes them very challenging to read as a human (the discrepancy between 4x and 15x is because many of the extra lines have few characters on them while the frontend commands themselves are very long lines). That was measured building swift-build itself, but it matches my general impression from other projects.