Skip to content

make-style variables don’t appear to be expanded in repl_ghci_args  #1377

Closed
@patrickt

Description

@patrickt

Describe the bug
In order to pass a file path to the C preprocessor, I define it using a -D style macro in compiler_flags, containing an invocation of $(rootpath ...). This works fine when building the standard target, but the expansion doesn’t seem to take place with repl_ghci_args, even though the docs say that Make-style substitution occurs on repl_ghci_args, and I’m specifying it here.

To Reproduce

  1. Check out [email protected]:github/semantic.git and the bazel-experiments branch.
  2. Run bazel build //semantic-python:lib and observe everything working.
  3. Run bazel run //semantic-python:lib@repl and observe that the preprocessor macro NODE_TYPES_PATH has not expanded its rootpath.

Expected behavior
The given macro should not be ../../../../$(rootpath @tree-sitter-python//:src/node-types.json)
I looked through haskell_impl.bzl in this repo and observed that expand_make_variables exists; is it a matter of calling that? Is it possible for me to do that manually from my build script?

Environment

  • OS name + version: macOS Catalina
  • Bazel version: 3.1.0
  • Version of the rules: 0.12

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions