Opened 4 years ago

Closed 4 years ago

#635 closed defect (fixed)

generated code position comments should use relative file paths

Reported by: scoder Owned by: scoder
Priority: minor Milestone: 0.14.1
Component: Code Generation Keywords:
Cc:

Description

Currently, Cython generates absolute file paths into the source code position comments, e.g.

/* "/[...]/cython/cython-devel/Cython/Compiler/Code.pxd":62
 * 
 *     @cython.locals(intern=bint, is_str=bint, is_unicode=bint)
 *     cpdef get_py_string_const(self, encoding, identifier=*, is_str=*)             # <<<<<<<<<<<<<<
 * 
 * ## cdef class PyStringConst:
 */

It would be better to use file paths relative to the project root, or even the package root of the project (thus printing basically the module's package path only).

This would reduce the size of the generated file, avoid leaking information about the file system layout of the author and (to a certain extent) better support diffs when comparing generated C files from different project checkouts (e.g. different Cython versions).

Change History (2)

comment:1 Changed 4 years ago by scoder

  • Owner changed from somebody to scoder
  • Status changed from new to assigned

comment:2 Changed 4 years ago by scoder

  • Milestone changed from wishlist to 0.14.1
  • Resolution set to fixed
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.