Skip to content

Cases generator: inserted #line directives are dependent on cwd #102781

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
carljm opened this issue Mar 17, 2023 · 0 comments · Fixed by #102782
Closed

Cases generator: inserted #line directives are dependent on cwd #102781

carljm opened this issue Mar 17, 2023 · 0 comments · Fixed by #102782
Labels
type-bug An unexpected behavior, bug, or error

Comments

@carljm
Copy link
Member

carljm commented Mar 17, 2023

Bug report

Python supports out-of-tree builds, e.g.:

> git clone [email protected]:python/cpython
> mkdir -p builds/dbg
> cd builds/dbg
> ../../cpython/configure --with-pydebug
> make -j

This is useful for e.g. keeping both debug and opt and asan builds around, without constantly having to make clean and recompile.

Currently the output of make regen-cases is cwd-dependent, so running it from an out-of-tree build (with no other changes) will change all #line directives in generated_cases.c.h from e.g. Python/bytecodes.c to e.g. ../../cpython/Python/bytecodes.c.

This is easily fixable by inserting a couple os.path.relpath(..., ROOT) calls in the cases generator, to ensure all the filenames used in #line directives are always relative to the repo root, regardless of cwd.

Linked PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant