rules_scala icon indicating copy to clipboard operation
rules_scala copied to clipboard

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

Open crazyjat opened this issue 3 years ago • 5 comments
trafficstars

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 avatar Nov 07 '22 23:11 crazyjat

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

crazyjat avatar Nov 08 '22 21:11 crazyjat

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

crazyjat avatar Nov 08 '22 21:11 crazyjat

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.

simuons avatar Nov 09 '22 06:11 simuons

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.

crazyjat avatar Nov 09 '22 15:11 crazyjat

@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?

crt-31 avatar May 11 '23 01:05 crt-31