mirror of
https://github.com/Cheviiot/Vintner.git
synced 2026-08-03 15:57:24 +00:00
Renamed the GitHub repo, Go module path, binary, and default install directory from msvc-go-wine to vintner. Updated every user-facing string (usage text, error prefixes, README, LICENSE, CI/release workflow) and the embedded compatibility patches' own header text to match; the VINTNER_LANG env var replaces VSMC_GO_WINE_LANG. Also fixes a real bug found while re-verifying the rename end-to-end: Microsoft.Cpp.WindowsSDK.props.patch had LF-only line endings in its hunk body while the real Microsoft-shipped file it targets is CRLF, so `git apply` silently failed on every real install and the SDK detection fix it's meant to provide was never actually taking effect. Restored matching CRLF endings in the hunk (checked against the other five patches, which already had this right). Left the patch's internal MsvcGoWine_ExtraSdkRoots MSBuild property name alone rather than renaming it too - changing hunk content, even just an identifier, breaks reverse-apply idempotency for anyone re-running download against an already-patched tree, which the fix above depends on. Added a .remove marker so an existing install's old-named props file gets cleaned up on the next download. Re-verified end-to-end after the rename: general MSBuild/cl/link still work, and a real KMDF driver build (compile, link, INF stamping, Inf2Cat signability check) still succeeds under the renamed binary. README also gets an accuracy pass: WDK support and the download/env CLI flags it lists were out of date (WDK was previously listed under "Known gaps" despite being implemented and verified), the full tool list was missing mc/cmd/findstr, and the new command aliases and VINTNER_LANG option are now documented.
59 lines
2.1 KiB
Go
59 lines
2.1 KiB
Go
// Package wrapper implements the per-tool command dispatch (cl, link, lib,
|
|
// ml, ml64, mc, midl, mt, rc, dumpbin, msbuild, nmake, armasm, armasm64, cmd,
|
|
// findstr): loading each tool's environment, invoking it under Wine, and
|
|
// filtering its output.
|
|
package wrapper
|
|
|
|
import "github.com/Cheviiot/vintner/internal/wineenv"
|
|
|
|
// dirKind selects which install directory a tool's real .exe lives in.
|
|
type dirKind int
|
|
|
|
const (
|
|
dirBin dirKind = iota // <bindir> - vc/tools/msvc/<ver>/bin/Host<host>/<arch>
|
|
dirSDK // <sdkbindir> - kits/10/bin/<sdkver>/<host>
|
|
dirMSBuild
|
|
)
|
|
|
|
type spec struct {
|
|
exeName string
|
|
dir dirKind
|
|
rawStdout bool // MSBuild: skip line filtering, inherit stdio directly
|
|
stdoutFilter lineFilter
|
|
stderrFilter lineFilter
|
|
postProcess func(origArgs []string) // cl: fix up /P /Fi<file> output
|
|
}
|
|
|
|
// Tools lists every multi-call name this binary answers to, besides its own
|
|
// management-CLI name.
|
|
var Tools = map[string]spec{
|
|
"cl": {exeName: "cl.exe", dir: dirBin, stdoutFilter: clStdoutFilter, stderrFilter: clStderrFilter, postProcess: clPostProcess},
|
|
"link": {exeName: "link.exe", dir: dirBin},
|
|
"lib": {exeName: "lib.exe", dir: dirBin},
|
|
"ml": {exeName: "ml.exe", dir: dirBin},
|
|
"ml64": {exeName: "ml64.exe", dir: dirBin},
|
|
"nmake": {exeName: "nmake.exe", dir: dirBin},
|
|
"armasm": {exeName: "armasm.exe", dir: dirBin},
|
|
"armasm64": {exeName: "armasm64.exe", dir: dirBin},
|
|
"dumpbin": {exeName: "dumpbin.exe", dir: dirBin, stdoutFilter: dumpbinStdoutFilter},
|
|
"mc": {exeName: "mc.exe", dir: dirSDK},
|
|
"midl": {exeName: "midl.exe", dir: dirSDK},
|
|
"mt": {exeName: "mt.exe", dir: dirSDK},
|
|
"rc": {exeName: "rc.exe", dir: dirSDK},
|
|
"msbuild": {exeName: "MSBuild.exe", dir: dirMSBuild, rawStdout: true},
|
|
}
|
|
|
|
// nativeTools are handled entirely without Wine.
|
|
var nativeTools = map[string]bool{"cmd": true, "findstr": true}
|
|
|
|
func (s spec) exeDir(p *wineenv.Paths) string {
|
|
switch s.dir {
|
|
case dirSDK:
|
|
return p.SDKBinDir
|
|
case dirMSBuild:
|
|
return p.MSBuildBinDir
|
|
default:
|
|
return p.BinDir
|
|
}
|
|
}
|