-
Notifications
You must be signed in to change notification settings - Fork 1.1k
chore: explore parallel library generation #12820
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
base: main
Are you sure you want to change the base?
Changes from all commits
e262563
84eb79d
e69b564
05624e0
817d11a
d01a135
7fc7f14
df89038
0fa43c0
cd3ddd6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| .git/ | ||
| .github/ | ||
| .kokoro/ | ||
| .vscode/ | ||
| bazel-*/ | ||
| googleapis/ | ||
| **/output/ | ||
| **/target/ | ||
| **/*.jar |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -166,3 +166,30 @@ def _construct_effective_arg( | |
| arguments += ["--destination_path", temp_destination_path] | ||
|
|
||
| return arguments | ||
|
|
||
|
|
||
| import sys | ||
| from io import StringIO | ||
| import traceback | ||
|
|
||
|
|
||
| def library_generation_worker(config, library_path, library, repo_config): | ||
| buffer = StringIO() | ||
| has_local = hasattr(sys.stdout, "local") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The check
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We keep this non-invasive. If we go this way it would be a major refactor of the scripts. |
||
| if has_local: | ||
| sys.stdout.local.buffer = buffer | ||
| sys.stderr.local.buffer = buffer | ||
| error_msg = None | ||
| try: | ||
| generate_composed_library(config, library_path, library, repo_config) | ||
| except Exception as e: | ||
| error_msg = f"{e}\n{traceback.format_exc()}" | ||
| finally: | ||
| logs = buffer.getvalue() | ||
| buffer.close() | ||
| if has_local: | ||
| if hasattr(sys.stdout.local, "buffer"): | ||
| del sys.stdout.local.buffer | ||
| if hasattr(sys.stderr.local, "buffer"): | ||
| del sys.stderr.local.buffer | ||
| return logs, error_msg | ||
Uh oh!
There was an error while loading. Please reload this page.