buck icon indicating copy to clipboard operation
buck copied to clipboard

genrule macros cannot target flavor of buck invocation

Open jstaahl opened this issue 4 years ago • 1 comments

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.

jstaahl avatar Jul 22 '21 18:07 jstaahl

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.

KapJI avatar Aug 24 '21 20:08 KapJI