Skip to content

Compile Line Length Limit hit under Windows #5163

@adam-porich-sm

Description

@adam-porich-sm

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

The following build file does not compile under windows

cc_library(
    name = "long",
    includes = ["a" * 32768]
)
cc_binary(
    name = "long_bin",
    srcs = ["main.cpp"],
    deps = [
        ":long"
    ]
)

The reported error is
Action failed to execute: java.io.IOException: ERROR: src/main/native/windows/processes-jni.cc(161): CreateProcessWithExplicitHandles("C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\cl.exe" /c main.cpp /Fobazel-out/x64_windows-fastbuild/bin/_objs/long_bin/main.o /nologo /DCOMPILER_MSVC /DNOMINMAX /D_WIN32_WINNT=0x0(...)): command is longer than CreateProcessW's limit (32768 characters)

From what I could tell when trying to make a simple repo it appears this case may be handled correctly for link steps but not for compile steps.

What operating system are you running Bazel on?

Windows 10

What's the output of bazel info release?

release 0.13.0

Metadata

Metadata

Assignees

Labels

P4This is either out of scope or we don't have bandwidth to review a PR. (No assignee)team-Rules-CPPIssues for C++ rulestype: feature request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions