Keep CVersion in the vminitd package#747
Conversation
| ) | ||
|
|
||
| static func main() async throws { | ||
| AgentCommand.versionMetadata.withLock { $0 = Self.versionMetadata() } |
There was a problem hiding this comment.
Is this necessary? See comment for AgentCommand.swift.
There was a problem hiding this comment.
See a new commit as an alternative way of dropping the version metadata Mutex from AgentCommand.
There was a problem hiding this comment.
Putting it in logging metadata is going to add version to every log entry? That seems noisy.
There was a problem hiding this comment.
That was a bug. Fixed!
| metadata["tag"] = "\(gitTag)" | ||
| } | ||
| log.info("vminitd booting", metadata: metadata) | ||
| log.info("vminitd booting", metadata: Self.versionMetadata.withLock { $0 }) |
There was a problem hiding this comment.
| log.info("vminitd booting", metadata: Self.versionMetadata.withLock { $0 }) | |
| log.info("vminitd booting", metadata: Application.versionMetadata.withLock { $0 }) |
There was a problem hiding this comment.
VminitdCore can't reference Application - the executable depends on the library, not the other way around.
There was a problem hiding this comment.
Why is AgentCommand in VminitCore? It makes more sense for all the swift-argument-parser commands to be in the same target as Application, whereas the core implements just the agent business logic.
There was a problem hiding this comment.
The motivation for moving VminitdCore to the top-level package was specifically so that custom vminitd executables can reuse it. The CLI surface, including AgentCommand, InitCommand, PauseCommand, is part of what they want to reuse.
Moves
CVersionback to thevminitdpackage. This is a follow-up for #742.