Skip to content

Commit c49781b

Browse files
author
Markus Westerlind
committed
fix: Flux needs to link to bcrypt on windows on Rust 1.58
Due to rust-lang/rust#84096 we need to link to bcrypt on windows else we get linker errors. cc influxdata/flux#4406 https://app.circleci.com/pipelines/github/influxdata/flux/11766/workflows/d1ef0c61-babb-4682-8c74-7087013c873e/jobs/38341 ``` C:\\Users\\circleci\\AppData\\Local\\go-build\\pkgconfig\\windows_amd64\\lib/libflux-3dd4b4346280d5a830d03b58d109be24cf44fd0ab5964e0113b470e7ba1223ed.a(std-c90c2a9f63fc5684.std.04e7289e-cgu.0.rcgu.o): In function `std::sys::windows::rand::hashmap_random_keys': /rustc/02072b482a8b5357f7fb5e5637444ae30e423c40\/library\std\src\sys\windows/rand.rs:10: undefined reference to `BCryptGenRandom' /rustc/02072b482a8b5357f7fb5e5637444ae30e423c40\/library\std\src\sys\windows/rand.rs:10: undefined reference to `BCryptGenRandom' collect2.exe: error: ld returned 1 exit status Exited with code exit status 2 ```
1 parent 996bd61 commit c49781b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libs/flux/build.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ Name: Flux
282282
_, _ = fmt.Fprintf(w, "Libs: -L${libdir} -lflux-${buildid} -ldl -lm\n")
283283
}
284284
} else if l.Target.OS == "windows" {
285-
_, _ = fmt.Fprintf(w, "Libs: -L${libdir} -lflux-${buildid} -lws2_32 -luserenv\n")
285+
_, _ = fmt.Fprintf(w, "Libs: -L${libdir} -lflux-${buildid} -lws2_32 -luserenv -lbcrypt\n")
286286
} else {
287287
_, _ = fmt.Fprintf(w, "Libs: -L${libdir} -lflux-${buildid}\n")
288288
}

0 commit comments

Comments
 (0)