please icon indicating copy to clipboard operation
please copied to clipboard

github_repo.revision = "v$SOME_ENV_VAR"

Open Dmitry-N-Medvedev opened this issue 1 year ago • 1 comments

good morning, nice community!

Looks like there is no string extrapolation in the revision field of the github_repo:

.plzconfig

[BuildEnv]
FLATBUFFERS-VERSION = 24.3.25

BUILD

github_repo(
  name = "flatbuffers_src",
  repo = "google/flatbuffers",
  revision = "v$FLATBUFFERS_VERSION",
)

Dmitry-N-Medvedev avatar Oct 15 '24 07:10 Dmitry-N-Medvedev

For the uninitiated like me, this solution will work:

.plzconfig

[Buildconfig]
FLATBUFFERS-VERSION = 24.3.25

BUILD

github_repo(
  name = "flatbuffers_src",
  repo = "google/flatbuffers",
  revision = f"v{CONFIG.FLATBUFFERS_VERSION}",
)

Dmitry-N-Medvedev avatar Oct 15 '24 08:10 Dmitry-N-Medvedev

Glad you found a solution 🙂 this works mostly the same way as with python format strings.

The docs are here: https://please.build/language.html

Tatskaari avatar Nov 01 '24 13:11 Tatskaari