Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SRCDIR is not absolute in genrule script #560

Closed
avdv opened this issue Feb 6, 2024 · 2 comments
Closed

SRCDIR is not absolute in genrule script #560

avdv opened this issue Feb 6, 2024 · 2 comments

Comments

@avdv
Copy link
Contributor

avdv commented Feb 6, 2024

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
Copy link
Member

KapJI commented Feb 6, 2024

Having relative path there is intentional but documentation is misleading.

@KapJI
Copy link
Member

KapJI commented Feb 6, 2024

Opened D53473247 to update documentation.

facebook-github-bot pushed a commit to facebook/buck2-prelude that referenced this issue Feb 6, 2024
Summary:
Unlike buck1, buck2 evaluates these macros to relative paths.

Fixes: facebook/buck2#560

Reviewed By: wendy728

Differential Revision: D53473247

fbshipit-source-id: 9d8c541ee213a516b033b607447cf68abe13e68a
wavewave pushed a commit to MercuryTechnologies/buck2-prelude that referenced this issue Apr 26, 2024
Summary:
Unlike buck1, buck2 evaluates these macros to relative paths.

Fixes: facebook/buck2#560

Reviewed By: wendy728

Differential Revision: D53473247

fbshipit-source-id: 9d8c541ee213a516b033b607447cf68abe13e68a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants