Skip to content

Android c++ build under Windows, command line to long #7982

@MarkaRagnos0815

Description

@MarkaRagnos0815

Description of the problem / feature requests

I am trying to build a c++ library using bazel under windows. I am using the following command:
bazel build <target> --compilation_mode=opt --crosstool_top=@androidndk//:default_crosstool --host_crosstool_top=@bazel_tools//tools/cpp:toolchain --cpu=armeabi-v7a
I am getting the following error message:
Action failed to execute: java.io.IOException: ERROR: src/main/native/windows/processes-jni.cc(429): CreateProcessWithExplicitHandles("<user>\_bazel_exb_a\kkszmrzt\execroot\dbsdk\external\androidndk\ndk\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ar" rcsD bazel-out/armeabi-v7a-(...)): command is longer than CreateProcessW's limit (32767 characters)
Unlike Linux/windows build that are using a linker input file for commands the ndk version passes all parameters via command line

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

  • create a cc_binary for android
  • add as much as possible files to exceed 32K of characters in command line
  • see failing build

What operating system are you running Bazel on?

  • windows 10

What's the output of bazel info release?

  • release 0.24.1

Have you found anything relevant by searching the web?

  • no

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2We'll consider working on this in future. (Assignee optional)platform: windowsteam-AndroidIssues for Android teamtype: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions