Windows 2022 build issue
When I try to build a Hello World example with these rules on Windows 2022 Server I get the following error message:
[4 / 5] Linking D binary hello_world; 0s local ERROR: D:/a/1/s/hello_world/d/BUILD.bazel:3:9: Linking D binary hello_world failed: (Exit 1): dmd.exe failed: error executing command (from target //:hello_world) external\dmd_windows_x86_64\dmd2\windows\bin64\dmd.exe -g -m64 -mscrtlib=msvcrt -ofbazel-out/x64_windows-fastbuild/bin/hello_world.exe -L/LIBPATH:external/dmd_windows_x86_64/dmd2/windows/lib64 ... (remaining 1 argument skipped) lld-link: error: could not open 'msvcrt.lib': no such file or directory lld-link: error: could not open 'OLDNAMES.lib': no such file or directory Error: linker exited with status 1 Target //:hello_world failed to build
hello_world.d:
import std.stdio;
void main()
{
writeln("Hello, World!");
}
WORKSPACE.bazel:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "io_bazel_rules_d",
sha256 = "c30aaca512a376058f9295a4d9c2b3a385ad323b6026295a715b48dd53e20520",
strip_prefix = "rules_d-0e23b60794508983f4a2d21137f5299cdaee6ae3",
urls = ["https://github.com/bazelbuild/rules_d/archive/0e23b60794508983f4a2d21137f5299cdaee6ae3.tar.gz"],
)
load("@io_bazel_rules_d//d:d.bzl", "d_repositories")
d_repositories()
BUILD.bazel:
load("@io_bazel_rules_d//d:d.bzl", "d_binary")
d_binary(
name = "hello_world",
srcs = ["hello_world.d"],
)
.bazelversion:
6.3.2
The example works on Windows 2019 Server