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

Rez-Bind: Override Built-in Bind Modules #1557

Closed
Pantsworth opened this issue Oct 26, 2023 · 1 comment · Fixed by #1619
Closed

Rez-Bind: Override Built-in Bind Modules #1557

Pantsworth opened this issue Oct 26, 2023 · 1 comment · Fixed by #1619
Labels
bug rez-bind rez-bind related issues

Comments

@Pantsworth
Copy link
Contributor

Hi Rez folks!

I'm interested in overriding the built-in behavior of the os.py and arch.py bind modules, so I added custom versions to bind_module_path in rezconfig.

Unfortunately, search path ordering in package_bind.py means that the builtin bind modules end up taking priority over user-defined modules.

I would expect the user-defined modules to override the builtins (this is how plugin_path works, for example -- a custom env.py overrides the builtin env.py command).

searchpaths = config.bind_module_path + [builtin_path]

Environment

  • macOS 13
  • Rez 2.111.3
  • Python 3.9.10

To Reproduce

  1. Create a custom bind_modules directory
  2. Create a file named "bind_modules/os.py"
  3. Add a custom bind module creation script to os.py
  4. Add bind_modules directory to REZ_BIND_MODULE_PATH
  5. Delete current os package, and call rez-bind os

Expected behavior
My expectation is that my custom os.py module will be called.

Actual behavior
The builtin os.py is called.

Related Issues/PRs
Happy to file a PR for this one - I think it's a matter of changing:

searchpaths = config.bind_module_path + [builtin_path]

to:

searchpaths =  [builtin_path] + config.bind_module_path
@Pantsworth Pantsworth added the bug label Oct 26, 2023
@JeanChristopheMorinPerso
Copy link
Member

Hi @Pantsworth! Indeed that seems weird and is not what I would expect. Feel free to open a PR for this. It would be very appreciated!

@JeanChristopheMorinPerso JeanChristopheMorinPerso added the rez-bind rez-bind related issues label Oct 27, 2023
Pantsworth added a commit to Pantsworth/rez that referenced this issue Jan 17, 2024
Pantsworth added a commit to Pantsworth/rez that referenced this issue Jan 17, 2024
…lt-in bind modules.

Signed-off-by: Michael Nowakowski <m_nowakowski@apple.com>
JeanChristopheMorinPerso added a commit that referenced this issue Jan 27, 2024
* Issue #1557 - Add support for overriding built-in bind modules.

Signed-off-by: Michael Nowakowski <m_nowakowski@apple.com>

* Add copyrights

Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>

* Add test for get_bind_modules

Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>

---------

Signed-off-by: Michael Nowakowski <m_nowakowski@apple.com>
Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>
Co-authored-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>
Pixel-Minions pushed a commit to Pixel-Minions/rez that referenced this issue Feb 14, 2024
…dation#1619)

* Issue AcademySoftwareFoundation#1557 - Add support for overriding built-in bind modules.

Signed-off-by: Michael Nowakowski <m_nowakowski@apple.com>

* Add copyrights

Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>

* Add test for get_bind_modules

Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>

---------

Signed-off-by: Michael Nowakowski <m_nowakowski@apple.com>
Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>
Co-authored-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>
Signed-off-by: Jose Enriquez <jose.enriquez@barnstormvfx.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug rez-bind rez-bind related issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants