Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
5db2fb72
Commit
5db2fb72
authored
9 years ago
by
Masood Malekghassemi
Browse files
Options
Downloads
Plain Diff
Merge pull request #4976 from soltanmm/sigh-thon
Diagnose missing Cython-generated files
parents
01ba279f
5080909b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/python/grpcio/commands.py
+4
-4
4 additions, 4 deletions
src/python/grpcio/commands.py
src/python/grpcio/support.py
+19
-2
19 additions, 2 deletions
src/python/grpcio/support.py
with
23 additions
and
6 deletions
src/python/grpcio/commands.py
+
4
−
4
View file @
5db2fb72
...
...
@@ -320,11 +320,11 @@ class BuildExt(build_ext.build_ext):
extension
.
extra_link_args
+=
list
(
BuildExt
.
LINK_OPTIONS
[
compiler
])
try
:
build_ext
.
build_ext
.
build_extensions
(
self
)
except
KeyboardInterrupt
:
raise
except
Exception
as
error
:
support
.
diagnose_build_ext_error
(
self
,
error
,
traceback
.
format_exc
())
raise
CommandError
(
"
Failed `build_ext` step.
"
)
formatted_exception
=
traceback
.
format_exc
()
support
.
diagnose_build_ext_error
(
self
,
error
,
formatted_exception
)
raise
CommandError
(
"
Failed `build_ext` step:
\n
{}
"
.
format
(
formatted_exception
))
class
Gather
(
setuptools
.
Command
):
...
...
This diff is collapsed.
Click to expand it.
src/python/grpcio/support.py
+
19
−
2
View file @
5db2fb72
...
...
@@ -77,10 +77,27 @@ def _expect_compile(compiler, source_string, error_message):
.
format
(
error_message
))
def
diagnose_compile_error
(
build_ext
,
error
):
"""
Attempt to run a few test files through the compiler to see if we can
diagnose the reason for the compile failure.
"""
"""
Attempt to diagnose an error during compilation.
"""
for
c_check
,
message
in
C_CHECKS
.
items
():
_expect_compile
(
build_ext
.
compiler
,
c_check
,
message
)
python_sources
=
[
source
for
source
in
build_ext
.
get_source_files
()
if
source
.
startswith
(
'
./src/python
'
)
and
source
.
endswith
(
'
c
'
)
]
for
source
in
python_sources
:
if
not
os
.
path
.
isfile
(
source
):
raise
commands
.
CommandError
(
(
"
Diagnostics found a missing Python extension source file:
\n
{}
\n\n
"
"
This is usually because the Cython sources haven
'
t been transpiled
"
"
into C yet and you
'
re building from source.
\n
"
"
Try setting the environment variable
"
"
`GRPC_PYTHON_BUILD_WITH_CYTHON=1` when invoking `setup.py` or
"
"
when using `pip`, e.g.:
\n\n
"
"
pip install -rrequirements.txt
\n
"
"
GRPC_PYTHON_BUILD_WITH_CYTHON=1 pip install .
"
)
.
format
(
source
)
)
_ERROR_DIAGNOSES
=
{
errors
.
CompileError
:
diagnose_compile_error
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment