mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-07-06 10:31:30 +08:00
🐛 fix(ci): 修复 DuckDB Windows 可选驱动构建的 CGO 参数污染
This commit is contained in:
@@ -4132,7 +4132,8 @@ func withEnvValue(env []string, key string, value string) []string {
|
||||
func duckDBWindowsDynamicLibraryCGOLDFlags(libDir string) string {
|
||||
normalizedDir := filepath.ToSlash(strings.TrimSpace(libDir))
|
||||
parts := []string{
|
||||
fmt.Sprintf("-L\"%s\"", normalizedDir),
|
||||
// cgo 会把每个 CGO_LDFLAGS 片段转成 //go:cgo_ldflag,带引号的 -L 在 windows/amd64 上会被当成非法参数。
|
||||
fmt.Sprintf("-L%s", normalizedDir),
|
||||
"-lduckdb",
|
||||
"-lstdc++",
|
||||
"-lm",
|
||||
|
||||
@@ -430,7 +430,7 @@ func TestDuckDBWindowsBuildUsesDynamicLibraryTag(t *testing.T) {
|
||||
func TestDuckDBWindowsDynamicLibraryCGOLDFlagsIncludeSupportLibraries(t *testing.T) {
|
||||
flags := duckDBWindowsDynamicLibraryCGOLDFlags(`C:\tmp\duckdb lib`)
|
||||
for _, expected := range []string{
|
||||
`-L"C:/tmp/duckdb lib"`,
|
||||
`-LC:/tmp/duckdb lib`,
|
||||
"-lduckdb",
|
||||
"-lstdc++",
|
||||
"-lm",
|
||||
|
||||
Reference in New Issue
Block a user