Skip to content

Commit

Permalink
Attempt to init cinder *only* when cinderx is enabled
Browse files Browse the repository at this point in the history
Summary:
before, a few upstream tests fail (presumably because the *attempt* to init cinder causes "unexpected" (from the upstream test POV) additional imports to be done sooner):

```
third-party/python/3.12/facebook/bin/python3.12 -u -W default -bb -E -I -m test -m test -r -w -j 0 -u all,-audio,-gui,-network test_import test_threading test_site -v
```

{P1585526624}

fix it by commenting out the call to try to init cinder in `site.py` by default, and enabling at build-time (by editing `site.py` in the install genrule) only when cinderx is enabled.

note that we should probably change it again in the future to use a constraint instead of a macro arg, but that would be part of a bigger refactor to introduce a cinderx constraint.

Reviewed By: christycylee, thereversiblewheel

Differential Revision: D62604340

fbshipit-source-id: 118e11bdaddd2010c383c186d3ab5cdb7a741f76
  • Loading branch information
itamaro authored and facebook-github-bot committed Sep 13, 2024
1 parent a98c226 commit f290b9e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Lib/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,10 @@ def main():
sethelper()
if not sys.flags.isolated:
enablerlcompleter()
init_cinder()
# Do not attempt to initialize cinder *by default*, as it's not relevant
# for regular MetaPython users (and cinderx is not even available).
# This gets enabled at build-time when cinderx is enabled (see D62604340).
# init_cinder()
execsitecustomize()
if ENABLE_USER_SITE:
execusercustomize()
Expand Down

0 comments on commit f290b9e

Please sign in to comment.