Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
a74bdd5a
Commit
a74bdd5a
authored
Feb 22, 2015
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make filename table relative to project root to actually allow finding the files
parent
b48ad915
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
CHANGES.rst
CHANGES.rst
+6
-0
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+7
-3
No files found.
CHANGES.rst
View file @
a74bdd5a
...
...
@@ -5,6 +5,12 @@ Cython Changelog
Latest changes
==============
Bugs fixed
----------
* Runtime reported file paths of source files (e.g for profiling and tracing)
are now relative to the build root directory instead of the main source file.
0.22 (2015-02-11)
=================
...
...
Cython/Compiler/ModuleNode.py
View file @
a74bdd5a
...
...
@@ -701,15 +701,19 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
full_module_path
=
path
.
join
(
*
self
.
full_module_name
.
split
(
'.'
))
module_abspath
=
path
.
splitext
(
path
.
abspath
(
self
.
compilation_source
.
source_desc
.
get_filenametable_entry
()
))[
0
]
module_rootpath
=
module_abspath
[:
-
len
(
full_module_path
)]
root_path
=
module_abspath
[:
-
len
(
full_module_path
)]
workdir
=
path
.
abspath
(
os
.
getcwd
())
+
os
.
sep
if
root_path
.
startswith
(
workdir
):
# prefer relative paths to current directory (which is most likely the project root)
root_path
=
workdir
code
.
putln
(
""
)
code
.
putln
(
"static const char *%s[] = {"
%
Naming
.
filetable_cname
)
if
code
.
globalstate
.
filename_list
:
for
source_desc
in
code
.
globalstate
.
filename_list
:
file_abspath
=
path
.
abspath
(
source_desc
.
get_filenametable_entry
())
if
file_abspath
.
startswith
(
module_root
path
):
filename
=
file_abspath
[
len
(
module_root
path
):]
if
file_abspath
.
startswith
(
root_
path
):
filename
=
file_abspath
[
len
(
root_
path
):]
else
:
filename
=
path
.
basename
(
file_abspath
)
escaped_filename
=
filename
.
replace
(
"
\
\
"
,
"
\
\
\
\
"
).
replace
(
'"'
,
r'\"'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment