Closed gorloffslava closed 2 weeks ago
@graebm as stated this is a continuation of #593. Thought it was easier to open a PR then submit a new issue 😄.
Thanks for the PR. I'm looking into this ... just busy
No problem. Apologies I missed this in the previous issue/PR.
Here's my take on it: https://github.com/awslabs/aws-crt-python/pull/596
It's the opposite of your approach. I'll fix AWS's internal build system to use the new-extra-weird env-var. Instead of forcing slightly-less-weird users like yourself to set 2 env-vars.
Thoughts on #596? Does this work for you?
@graebm just seeing - will test and get back to you. Thank you!
This PR adds a new buildtime environment variable
AWS_CRT_BUILD_USE_SHARED_LIBS
.When it's set to
1
, it overrides the default behavior of trying to link static library variants on Unix OSs (exceptdarwin
).This default behavior is enforced by the following lines: https://github.com/awslabs/aws-crt-python/blob/2dae492d57b40c68839f2ecd7867bea34e6f9f1a/setup.py#L340-L348
Currently, there is no way to disable it and prefer shared libraries instead, what this PR solves.
As a continuation of the #593, it allows to reduce the libraries footprint in disk-restricted environments like Lambda, promote shared libraries reuse in RAM (e.g., if multiple Python packages depend on them), and generally make it more aligned with best native Python extensions build practices.
This PR is backward-compatible as feature it provides is opt-in, it doesn't change the default behavior of preferring static libraries.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.