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

No checking of all macros in PMDK #6077

Open
osalyk opened this issue Apr 15, 2024 · 1 comment
Open

No checking of all macros in PMDK #6077

osalyk opened this issue Apr 15, 2024 · 1 comment
Labels
documentation doc/ and other Markdown files libpmem2 libpmem- and libpmem2-related pmempool src/libpmempool and src/tools/pmempool Priority: 4 low QA: CI .github/ and utils/ related to automated testing Type: Bug A previously unknown bug in PMDK

Comments

@osalyk
Copy link
Contributor

osalyk commented Apr 15, 2024

In the docs_test.py file in the get_macros() function, we only search the libpmemobj path:

def get_macros(pmdk_path):
    """
    Parses all headers from the libpmemobj library, extracts all macros, and
    returns them in a list.
    """
    macros = []
    exceptions = get_exceptions(pmdk_path)
    is_macro_in_next_line = False
    includes_path = path.join(pmdk_path, 'src', 'include', 'libpmemobj')
    # Definition of macro occurs after the phrases: 'static inline' or '#define'
    for header_file in listdir(includes_path):
        with open(path.join(includes_path, header_file), 'r') as f:
            file_lines = f.readlines()
        for line in file_lines:
            if line.startswith('static inline'):
                is_macro_in_next_line = True
            elif is_macro_in_next_line:
                parse_macro_name(exceptions, line,
                                 EXPRESSION_AT_THE_LINE_START, macros)
                is_macro_in_next_line = False
            elif '#define' in line:
                parse_macro_name(exceptions, line,
                                 EXPRESSION_AFTER_DEFINE_PHRASE, macros)
    return macros
@osalyk osalyk added the Type: Bug A previously unknown bug in PMDK label Apr 15, 2024
@janekmi
Copy link
Contributor

janekmi commented Apr 15, 2024

It causes two problems:

  1. The libpmemobj is validated differently compared to the rest of the libraries.
  2. Other libraries cannot introduce manpages for their macro definitions since they will be marked as redundant.

The ideal solution is to:

  • expand the get_macros() function to cover macros from all libraries.
  • add missing macro definitions for libraries other than libpmemobj.

@janekmi janekmi added libpmem2 libpmem- and libpmem2-related Priority: 4 low QA: CI .github/ and utils/ related to automated testing documentation doc/ and other Markdown files pmempool src/libpmempool and src/tools/pmempool labels Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation doc/ and other Markdown files libpmem2 libpmem- and libpmem2-related pmempool src/libpmempool and src/tools/pmempool Priority: 4 low QA: CI .github/ and utils/ related to automated testing Type: Bug A previously unknown bug in PMDK
Projects
None yet
Development

No branches or pull requests

2 participants