bazelbuild / rules_scala

Scala rules for Bazel
Apache License 2.0
363 stars 278 forks source link

scrooge_scala_library action: `mapped_file_unix.cc` is used on Windows instead of `mapped_file_windows.cc` #1443

Open crazyjat opened 2 years ago

crazyjat commented 2 years ago

I get the following error when doing a very simple thrift to scala conversion on Windows 11 using Bazel.

load("@io_bazel_rules_scala//thrift:thrift.bzl", "thrift_library")
load("@io_bazel_rules_scala//twitter_scrooge:twitter_scrooge.bzl", "scrooge_scala_library")

thrift_library(
    name = "thrift",
    srcs = ["src/main/thrift/service.thrift"],
)

scrooge_scala_library(
    name = "scrooge",
    visibility = ["//visibility:public"],
    deps = [":thrift"],

)
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\cl.exe /nologo /DCOMPILER_MSVC /DNOMINMAX /D_WIN32_WINNT=0x0601 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /bigobj /Zm500 /EHsc /wd4351 /wd4291 /wd4250 /wd4996 /Iexternal/io_bazel_rules_scala /Ibazel-out/x64_windows-opt-exec-2B5CBBC6/bin/external/io_bazel_rules_scala /Iexternal/io_bazel_rules_scala/third_party/java_tools/zlib /Ibazel-out/x64_windows-opt-exec-2B5CBBC6/bin/external/io_bazel_rules_scala/third_party/java_tools/zlib /DBLAZE_OPENSOURCE /showIncludes /MD /O2 /Oy- /DNDEBUG /wd4117 -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" /Gy /Gw /Fobazel-out/x64_windows-opt-exec-2B5CBBC6/bin/external/io_bazel_rules_scala/third_party/java_tools/ijar/_objs/zip/mapped_file_unix.obj /c external/io_bazel_rules_scala/third_party/java_tools/ijar/mapped_file_unix.cc
# Configuration: 55c4fcb618a586250024768c71735afe314543d708df4f56da250242043cfbc2
# Execution platform: @local_config_platform//:host
external/io_bazel_rules_scala/third_party/java_tools/ijar/mapped_file_unix.cc(18): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory
crazyjat commented 2 years ago

I have found that the above example fails to compile on Windows and have found no work around.

crazyjat commented 2 years ago

Another example error:

external/io_bazel_rules_scala/third_party/java_tools/src/main/cpp/util/file_posix.cc(17): fatal error C1083: Cannot open include file: 'dirent.h': No such file or directory
simuons commented 2 years ago

Hi @crazyjat I'm sorry to say that but windows isn't really supported. We are targeting linux and mac at the moment. For windows support we would accept contributions.

crazyjat commented 2 years ago

How incredibly frustrating that you don’t support the most widely used operating system in the world. This is my biggest problem with bazel so far, shitty support.

crt-31 commented 1 year ago

@crazyjat, I was looking at this... is it still an issue for you? If so, what version of rules_scala and bazel are you using? And what's in your thrift file?