Ticket #635 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

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

Changed 3 years ago by scoder

  • owner changed from somebody to scoder
  • status changed from new to assigned

Changed 3 years ago by scoder

  • status changed from assigned to closed
  • resolution set to fixed
  • milestone changed from wishlist to 0.14.1
Note: See TracTickets for help on using tickets.