-
Notifications
You must be signed in to change notification settings - Fork 340
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
Need currently-building-variant build variables #416
Comments
+1 I'm not sure if Max's request also encompasses this situation, but we created some wrapper packages to expose our existing libs to Rez. These wrappers need to do some path munging inside these packages at build time:
So having access to what variant of the package is being used would be super helpful. |
After some digging, I found that I was able to get the variant index in
Looking at the |
RE REZ_BUILD_VARIANT, yup can add that, though it would be
REZ_BUILD_VARIANT_REQUIRES.
Re accessing this in commands, in recent rez you actually can now get
direct access to all of a Variant's attributes, so this should work:
def commands():
print resolve.mylib.index, resolve.mylib.subpath # subpath is
variant-specific trailing dirs, eg 'python-2.7'
Hth
A
…On Sat, Apr 8, 2017 at 6:58 AM, ttanimura ***@***.***> wrote:
After some digging, I found that I was able to get the variant index in
commands() using:
resolve.PACKAGENAME._VariantBinding__variant.index
Looking at the VariantBinding class in rex_bindings.py, it appears that
if the packages.Variant object inside the class were accessible, either
directly via a getter, or perhaps exposing its attrs via __getattr__ or
similar, the problem would be solved.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#416 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABjqSgZX1W6j2eOlmXUXt_jsmkOPgdnJks5rtqNpgaJpZM4MyCtr>
.
|
Ah, perfect. Will update to the latest and give that a shot. Thank you! |
Currently the only helpful variable provided at build time to identify the variant currently building is:
REZ_BUILD_VARIANT_INDEX="#", being the zero-indexed ID of the currently building variant from the package.py.
Currently the only way to get a readable variant listing at build time is to either have the build script parse the build-path, subtract the project-path off the front, or to use the index to read and locate the variant in the package.py, neither of which is super ideal.
It would instead be grand if there were something to the effect of:
REZ_BUILD_VARIANT="thing-1.2.3,other-2.3.4,another-3.4.5"
The delimiter used I think is largely relevant as long as it doesn't have another meaning, commas, spaces, slashes probably all solid choices.
Perhaps setting one that does not include implicit-packages in the list, so that platform/arch/os would not be a part of the listing, set to another variable with a similarly short but hopefully descriptive name.
The text was updated successfully, but these errors were encountered: