facebook / buck

A fast build system that encourages the creation of small, reusable modules over a variety of platforms and languages.
https://buck.build
Apache License 2.0
8.56k stars 1.16k forks source link

genrule macros cannot target flavor of buck invocation #2633

Open jstaahl opened 3 years ago

jstaahl commented 3 years ago

It appears that a genrule which uses the $(location <target>) macro has no way of getting the location of the output of the specified target for the flavor which was used to invoke buck in the first place.

In other words, if I invoke buck with: 1) buck build //MyApp:MyApp#iphoneos-arm64 or 2) buck build //MyApp:MyApp#iphonesimulator-x86_64

I have no way of creating a genrule which when it does a $(location <target>) macro expansion targets the #iphoneos-arm64 flavor in case 1 and targets the #iphonesimulator-x86_64 flavor in case 2.

KapJI commented 2 years ago

I think you can set default flavor instead of passing it as target flavor, this can done in invocation with --config option. Then genrule should also use it.