Skip to content
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

Stop Outputting #line directives in Flex and Bison Output .cpp/ .h Files #502

Open
popescu-v opened this issue Dec 18, 2024 · 1 comment
Labels
Priority/3 To do after P2 Size/Hours very short Type/DevChore Non user facing changes: Refactorings, CI/CD, Tooling

Comments

@popescu-v
Copy link
Collaborator

popescu-v commented Dec 18, 2024

Description

Currently, #line preprocessor directives with absolute paths are outputted in the following files:

	src/Learning/KWData/KWCLex.inc
	src/Learning/KWData/KWCYac.cpp
	src/Learning/KWData/KWCYac.hpp
	src/Norm/base/JSONLex.inc
	src/Norm/base/JSONYac.cpp
	src/Norm/base/JSONYac.hpp

These directives contain absolute paths, which:

  • can leak local machine-specific details
  • are not directly portable to other machines (for other developers).

Questions/Ideas

The goal of this issue is to add:

  • %noline option to Flex
  • %no-line option to Bison
    so that #line directives are not outputted anymore. These directives would only be used during development, on the local machine of the developer, but would not be committed anymore.

Context

  • Khiops version: >= 11
  • OS description (use khiops -s): All supported.
@popescu-v popescu-v added Type/DevChore Non user facing changes: Refactorings, CI/CD, Tooling Priority/3 To do after P2 Size/Hours very short labels Dec 18, 2024
@popescu-v
Copy link
Collaborator Author

popescu-v commented Jan 9, 2025

3 stages:

  • add CMake option to generate these files w/o #line directives
  • document convention to generate these files w/o #line before committing them
  • add pre-commit hook to warn on the presence of #line directives in these files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority/3 To do after P2 Size/Hours very short Type/DevChore Non user facing changes: Refactorings, CI/CD, Tooling
Projects
None yet
Development

No branches or pull requests

1 participant