Encode relative path to working tree in code paths when possible. #1576

Merged
merged 1 commit into from Feb 12, 2017

Projects

None yet

2 participants

@jelmer
Contributor
jelmer commented Jan 7, 2017

This makes the build reproducible irregardless of the build path. Fixes: #1565

@jelmer jelmer Encode relative path to working tree in code paths when possible.
This makes the build reproducible irregardless of the build path. Fixes: #1565
372f1be
@jelmer
Contributor
jelmer commented Jan 7, 2017

This is consistent with the behaviour in generate_filename_table() in Cython/Compiler/ModuleNode.py, which also removes the workdir from the prefix of module paths.

+ # Prefer relative paths to current directory (which is most likely the project root)
+ # over absolute paths.
+ workdir = os.getcwd() + os.sep
+ if file_abspath.startswith(workdir):
@scoder
scoder Feb 10, 2017 Contributor

Isn't this a job for os.path.relpath()?

@scoder scoder merged commit f03092b into cython:master Feb 12, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment