Search code examples
bazel

How to determine if user is building debug from Skylark


Is there a way from the ctx variable within Skylark to determine if the user is building with debug mode (-c dbg). I'd like to make decisions in Skylark related to this.


Solution

  • print(ctx.var["COMPILATION_MODE"])

    Value will be "fastbuild", "dbg" or "opt".