Skip to content

Drop target configuration and import path prefix from output file path #2448

@jayconrod

Description

@jayconrod

Output files for libraries and binaries currently have paths like this:

bazel-bin/darwin_amd64/go_default_library%/example.com/hello.a

darwin_amd64 is no longer necessary since #2219 has been fixed. Previously, we used an aspect for cross-compilation, so we had to add a directory prefix to distinguish files built in different modes. Bazel now adds its own prefix when switching configurations, so this is no longer necessary.

example.com/hello is no longer necessary. We used to pass an -I or -L argument to the compiler or linker for each archive. This is no longer needed, since we use -importcfg files.

Instead, output file names should look like:

bazel-bin/go_default_library.a
bazel-bin/hello

Or, in a non-default configuration:

bazel-out/darwin-fastbuild-ST-7912f95a9c5bf6fc1ba1c485f63292d65dad39084e5362eb6254aa7fb8987eba/bin/hello

This should mitigate a number of issues caused by long file names on Windows and macOS like #2002. Also related: #2249, #1239, #1257.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions