Skip to content

Create a simple makefile and allow regressions to use it. #1380

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

threeifbyair
Copy link
Contributor

One of the frustrating things about cppfront is that I always have to remember the precise incantation to build cppfront. In addition, the regression tests always build cppfront whether or not it needs to be built.

This PR adds a simple Makefile. Nothing special and explicitly marked as optional. In addition, it allows the regression tests to be run with a pre-built version of cppfront. This allows us (for instance) to build a sanitized cppfront and run it through the regressions to see if we get any memory or undefined behavior errors.

@threeifbyair threeifbyair force-pushed the threeifbyair/makefile branch from ad30ca6 to b364cc0 Compare June 17, 2025 23:16
@hsutter
Copy link
Owner

hsutter commented Jul 27, 2025

Thanks! @jarzec you're the expert on that, do you think this will improve regression tests, and do you approve merging this PR?

@hsutter hsutter added the question - further information requested Further information is requested label Jul 27, 2025
@jarzec
Copy link
Contributor

jarzec commented Aug 5, 2025

Thanks! @jarzec you're the expert on that, do you think this will improve regression tests, and do you approve merging this PR?

Some context
A while back, after your CppCon 22 presentation, Cpp2 caught interest of many people (myself included). This interest resulted in a number of PRs with CMake setup for cppfront. At that stage you closed those as you didn't want to add extra dependencies. That is why I proposed a pure bash sctipt that can be used on MasOS, Linux and Windows (through git bash) without any extra deps installed. This is what I used for the GitHub actions running for the regression tests.
The idea of using a build system for cppfront was not buried, though. In the Related Projects section of the wiki you point to a number of forks that propose a CMake/Mason setup.

My thoughts
It turns out GNU Make is installed on the Windows GitHub runners (which I didn't know), so it seems to be a possible way to go.
However, if adding Make for regression tests starts to be an option I would suggest a discussion about a more complete and flexible system like CMake or the like. The source code of cppfront is constantly growing while still being basically a single translation unit with really huge files.
CMake would also greatly facilitate integration of cppfront in other projects.
As I mentioned before, this is might be a good topic for a discussion.

On the other hand, adding a command line option to provide the executable to the run-test.sh wouldn't hurt It would e.g. help with developing new tests without having to recompile cppfront every time the test is run.

@hsutter What do you say?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question - further information requested Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants