Runtime error after compiling + Redistribution query

73 views
Skip to first unread message

Sreenathan Nair

unread,
Oct 18, 2021, 2:27:50 PM10/18/21
to rez-config
Hi,

I have a couple questions about compiling and redistribution:

1. I am compiling a GUI app that was built to allow artists within my company to be able to launch rez configured DCCs. This utility may at some point be used by off-site clients/vendors as well. I am using PyInstaller to compile said script(s) and designate rez as a dependency which freezes it into the binary, resulting in a standalone redistributable package. 
From my limited understanding about the LGPL-3.0 I assume that since I am not modifying the rez code itself in any way, the above described form of redistribution does not violate any terms/obligations?

2. The following error is encountered after running the compiled binary. I understand this might just be an issue with my own spec file configuration and would be thankful for any advice to debug this:

```
Traceback (most recent call last):
  File "applications.py", line 36, in <lambda>
  File "launcher.py", line 82, in launch_app
  File "rez\resolved_context.py", line 310, in __init__
    resolver.solve()
  File "rez\utils\memcached.py", line 267, in wrapper
    return func(*nargs, **kwargs)
  File "rez\resolver.py", line 119, in solve
    solver = self._solve()
  File "rez\resolver.py", line 403, in _solve
    print_stats=self.print_stats)
  File "rez\solver.py", line 1986, in __init__
    phase = _ResolvePhase(solver=self)
  File "rez\solver.py", line 1239, in __init__
    scope = _PackageScope(package_request, solver=solver)
  File "rez\solver.py", line 972, in __init__
    package_request.name, package_request.range)
  File "rez\solver.py", line 2349, in _get_variant_slice
    package_name=package_name, range_=range_)
  File "rez\solver.py", line 941, in get_variant_slice
    variant_list = _PackageVariantList(package_name, self.solver)
  File "rez\solver.py", line 470, in __init__
    paths=self.solver.package_paths):
  File "rez\packages.py", line 554, in iter_packages
    entries = _get_families(name, paths)
  File "rez\packages.py", line 933, in _get_families
    repo = package_repository_manager.get_repository(path)
  File "rez\package_repository.py", line 555, in get_repository
    repository = self._get_repository(normalised_path)
  File "rez\package_repository.py", line 626, in _get_repository
    cls = plugin_manager.get_plugin_class('package_repository', repo_type)
  File "rez\plugin_managers.py", line 355, in get_plugin_class
    plugin = self._get_plugin_type(plugin_type)
  File "rez\plugin_managers.py", line 329, in _get_plugin_type
    return self._plugin_types[plugin_type]()
  File "rez\utils\data_utils.py", line 304, in __call__
    self.instance = self.instance_class(*self.nargs, **self.kwargs)
  File "rez\plugin_managers.py", line 99, in __init__
    self.load_plugins()
  File "rez\plugin_managers.py", line 115, in load_plugins
    package = import_module(type_module_name)
  File "rez\backport\importlib.py", line 36, in import_module
    __import__(name)
  File "C:\Users\REDACTED\AppData\Local\Temp\embedded.plpfhmwb.zip\shibokensupport\__feature__.py", line 142, in _import
  File "C:\Users\REDACTED\REDACTED\rezplugins\package_repository\__init__.py", line 2, in <module>
    __path__ = extend_path(__path__, __name__)
  File "rez\plugin_managers.py", line 71, in extend_path
    for dir_ in plugin_manager.rezplugins_module_paths:
  File "rez\utils\data_utils.py", line 245, in __get__
    result = self.func(instance)
  File "rez\plugin_managers.py", line 316, in rezplugins_module_paths
    module_path = os.path.join(importer.path, name)
AttributeError: 'FrozenImporter' object has no attribute 'path'
```


Following is a stripped down version of the code that causes the above error:

```
from rez.resolved_context import ResolvedContext


# app["packages"] resolves in this example to ["maya-2019"]
# C:/a/local/dir contains maya/2019/package.py
res_context = ResolvedContext(
    app["packages"],
    package_paths=["C:/a/local/dir"],
)
res_context.execute_shell(...)
```

Platform:               Windows 10 x86_64 (Got the same error on CentOS 7 as well)
Python version:     3.7.9
PyInstaller:            4.5.1
Rez:                        2.95.3


Thanks very much for any help/advice!

Best wishes,
Sree

Allan Johns

unread,
Oct 18, 2021, 9:49:15 PM10/18/21
to rez-c...@googlegroups.com
Hi Sree,

1. Clearly there's some issue with using pyinstaller, I'm not familiar with it or its FrozenImporter so without further investigation I can't say much on this.

2. Wrt license, LGPL is copyleft and is considered part of your software's distribution if it's "not dynamically linked." The wording is somewhat ambiguous when applied to python, unfortunately. Given that you want to embed rez into this GUI, I think you may need to licence your own GUI part of that software as LGPL too, in this case. That won't stop you being able to provide it to clients, but whether giving your software to clients under LGPL is a problem or not, is up to your company. On a related note, I'm in the process of (hopefully) moving away from LGPL to Apache2.0 (which is more permissive), specifically to do away with cases like this. I can't give a timeline on this however.

Hth
A




--
You received this message because you are subscribed to the Google Groups "rez-config" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rez-config+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rez-config/edb1c076-b667-4c69-aaf3-4800794ca4b6n%40googlegroups.com.

Sreenathan Nair

unread,
Oct 18, 2021, 10:14:43 PM10/18/21
to rez-c...@googlegroups.com
Hi Allan,

I guess I'll have to hold off on this for now as the derived license of the redistributable is an important factor. Good to hear about the ongoing effort to move to Apache2.0 and looking forward to it.

Thanks again for your help on clarifying this!

Best wishes,
Sree


allan.johns

unread,
Dec 3, 2021, 11:01:07 PM12/3/21
to rez-config
Hi Sree, please note that latest version of rez is now Apache 2.0 licensed.
A

Sreenathan Nair

unread,
Dec 3, 2021, 11:22:27 PM12/3/21
to rez-c...@googlegroups.com
Hi Allan,

That is great news, thank you for the update!

Best wishes,
Sree


Reply all
Reply to author
Forward
0 new messages