Skip to content

Sandbox absolute paths leaking into binary #372

@kirschem-fernride

Description

@kirschem-fernride

Hey,

we're using rules_cuda with these flags:

build --@rules_cuda//cuda:compiler=nvcc
build --@rules_cuda//cuda:archs="compute_86:compute_86,sm_86;compute_75:compute_75,sm_75"
build --@rules_cuda//cuda:copts="--std=c++17"
build --@rules_cuda//cuda:copts=-allow-unsupported-compiler
build --@rules_cuda//cuda:copts=-Xcompiler=-Wall
build --@rules_cuda//cuda:copts=-Xcompiler=-Wextra
build --@rules_cuda//cuda:copts=-Xcompiler=-Werror
build --@rules_cuda//cuda:copts=-Werror=all-warnings
build --@rules_cuda//cuda:runtime=@cudart//:cuda_runtime
build --@rules_cuda//cuda:host_copts=-ftrapping-math
build --@rules_cuda//cuda:copts=-Xcompiler=-ffile-prefix-map=$(pwd)=.
build --@rules_cuda//cuda:copts=-Xcompiler=-fdebug-prefix-map=$(pwd)=.

The compiled object files of cuda_library targets contain absolute paths in the .nv_fatbin section to the bazel sandbox used for the build.
This is a problem for reproducibility of the build.

This problem happens ONLY on cuda targets.
This helped for some of the paths:

build --@rules_cuda//cuda:copts=-Xcompiler=-ffile-prefix-map=$(pwd)=.
build --@rules_cuda//cuda:copts=-Xcompiler=-fdebug-prefix-map=$(pwd)=.

but not all of them.

One example diff excerpt between two builds:

    -/tmp/tmpg05fa8va_repro_check_1/sandbox/linux-sandbox/4/execroot/_main/src/edacted/abc_utils
    -/tmp/tmpg05fa8va_repro_check_1/sandbox/linux-sandbox/4/execroot/_main/external/_main~_repo_rules~cudart/include
    +/tmp/tmpyvmnqnpq_repro_check_2/sandbox/linux-sandbox/4/execroot/_main/src/redacted/abc_utils
    +/tmp/tmpyvmnqnpq_repro_check_2/sandbox/linux-sandbox/4/execroot/_main/external/_main~_repo_rules~cudart/include

Any ideas where this does come from?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions