Skip to content

wrapper_build_script.sh: line 20: BUILD_LOG: unbound variable #1417

Open
@dragos250

Description

@dragos250

After upgrading from rules_foreign_cc version 0.14.0 to 0.15.0, I've started seeing some problems:

  1. Firstly, this error message when using the cmake rule: wrapper_build_script.sh: line 20: BUILD_LOG: unbound variable

All of my builds were successful with 0.14.0, but now:

  • Some of my cmake targets are building successfully
  • Other targets promptly fail with the unbound variable error. I'm attaching one the wrapper scripts for these: wrapper_build_script.sh.txt

What I think happens is that setting one of my environment variables fails, thus triggering the trap. BUILD_LOG needs to be the first one being assigned.

  1. Even though I'm only using the cmake rule, Bazel is now compiling BootstrapGNUMake and BootstrapPkgConfig which aren't needed.

  2. My cmake rule instance is the dependency of another rule that applies an 1:N transition (thus building my library for multiple target platforms). The issue I see is that the number of times BootstrapGNUMake and BootstrapPkgConfig are building is equal to the number of target platforms. I was expecting them to be built differently only based on the execution platforms. The selected host compiler is the same across all these builds.

I'm running Bazel 8.2.1 with bzlmod only.

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