eliben / pycparser

:snake: Complete C99 parser in pure Python
Other
3.21k stars 612 forks source link

using_gcc_E_libc example is ran during tests in an LLVM only setup #551

Closed RossComputerGuy closed 1 month ago

RossComputerGuy commented 1 month ago

Discovered in https://github.com/RossComputerGuy/nixpkgs-llvm-ws/runs/28310460670

Test ran with assert:

AssertionError: 1 != 0 : example "using_gcc_E_libc.py" failed
eliben commented 1 month ago

Can you explain what is the issue in pycparser that you're observing?

RossComputerGuy commented 1 month ago

The problem is when the tests run, the GCC example runs but in a LLVM environment, GCC isn't available. That causes this error: No such file or directory: 'gcc'.

eliben commented 1 month ago

This is just an example :shrug: If one has clang installed and not gcc, they can adjust the example, as the comment says: https://github.com/eliben/pycparser/blob/main/examples/using_gcc_E_libc.py#L5

I don't think downstream projects should run our example tests at all.

RossComputerGuy commented 1 month ago

How do you disable the example tests?

eliben commented 1 month ago

You choose what tests you run, no? Just don't run test_examples.py

Why does your project require running pycparser tests at all?

RossComputerGuy commented 1 month ago

You choose what tests you run, no?

Yes but how do you choose the tests?

Why does your project require running pycparser tests at all?

Because it's good for package managers to run tests, I don't want to disable all tests just to fix a single package when building the packages with LLVM.