facebook / buck2

Build system, successor to Buck
https://buck2.build/
Apache License 2.0
3.38k stars 200 forks source link

`SRCDIR` is not absolute in genrule script #560

Closed avdv closed 4 months ago

avdv commented 4 months ago

Hi.

According to the docs (https://buck2.build/docs/api/rules/#genrule) the value of that variable should be an absolute path:

${SRCDIR}

The absolute path to a directory to which sources are copied prior to running the command.

But when building the SRCDIR variable is just set to ./.:

buck2 build frontend:start -v 4
Running action: root//frontend:start (prelude//platforms:default#524f8da68ea2a374) (genrule) (build), local executor: env -- "TMPDIR=/home/claudio/source/Mercury/the-culture-repo/buck-out/v2/tmp/root/524f8da68ea2a374/frontend/__start__/genrule" "ASAN_OPTIONS=detect_leaks=0,detect_odr_violation=0" "BUCK_SCRATCH_PATH=buck-out/v2/tmp/root/524f8da68ea2a374/frontend/__start__/genrule" "GEN_DIR=GEN_DIR_DEPRECATED" "OUT=../out" "SRCDIR=./." ...
KapJI commented 4 months ago

Having relative path there is intentional but documentation is misleading.

KapJI commented 4 months ago

Opened D53473247 to update documentation.