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

Building FoundationDB would fail if CMake uses Makefile #11595

Open
xis19 opened this issue Aug 22, 2024 · 3 comments · May be fixed by #11722
Open

Building FoundationDB would fail if CMake uses Makefile #11595

xis19 opened this issue Aug 22, 2024 · 3 comments · May be fixed by #11722

Comments

@xis19
Copy link
Collaborator

xis19 commented Aug 22, 2024

CMake generates problematic Makefile which not being able to create actorcompiler.exe. The error is

make[2]: *** No rule to make target 'actorcompiler.exe', needed by 'flow/ActorCollection.actor.g.cpp'.  Stop.
@spraza
Copy link
Collaborator

spraza commented Aug 23, 2024

@xis19 Curious what's your use-case for using Make vs Ninja? And do we support Make?

@xis19
Copy link
Collaborator Author

xis19 commented Aug 26, 2024

@xis19 Curious what's your use-case for using Make vs Ninja? And do we support Make?

I was trying to set up a minimal RHEL9 build environment and use the most essential build tools. Not sure if we support Make but for the same CMakeLists.txt if CMake generates problematic Makefile while reasonable build.ninja, the compiler's backend might be buggy, or the build.ninja has the same problem yet not being triggered.

@spraza
Copy link
Collaborator

spraza commented Aug 26, 2024

Got it, thanks for the context. Fwiw, README.md mentions:

Install [Ninja](https://ninja-build.org/) (optional, but recommended)

If Ninja is optional, I would take that to mean that people use Make and therefore Make should be working.

the compiler's backend might be buggy

Agreed.

sepeth added a commit to sepeth/foundationdb that referenced this issue Oct 21, 2024
This also fixes apple#11595 - if Unix Makefiles is chosen for CMake builds,
build was failing with:

```
make[2]: *** No rule to make target 'actorcompiler.exe', needed by 'flow/ActorCollection.actor.g.cpp'.  Stop.
```

I suspect it could have been a problem for Ninja as well since the issue
was due to race condition, but probably it didn't happened so far for
other unknown factors.

See this example in CMake add_custom_command documentation:

https://cmake.org/cmake/help/latest/command/add_custom_command.html#example-generating-files-for-multiple-targets

The correct target to depend on is `actorcompiler` for CMake to generate
the right dependency order, `${actor_exe}` is just a string that points to
the location of the actor compiler.
sepeth added a commit to sepeth/foundationdb that referenced this issue Oct 21, 2024
This also fixes apple#11595 - if Unix Makefiles is chosen for CMake builds,
build was failing with:

```
make[2]: *** No rule to make target 'actorcompiler.exe', needed by 'flow/ActorCollection.actor.g.cpp'.  Stop.
```

I suspect it could have been a problem for Ninja as well since the issue
was due to race condition, but probably it didn't happened so far for
other unknown factors.

See this example in CMake add_custom_command documentation:

https://cmake.org/cmake/help/latest/command/add_custom_command.html#example-generating-files-for-multiple-targets

The correct target to depend on is `actorcompiler` for CMake to generate
the right dependency order, `${actor_exe}` is just a string that points to
the location of the actor compiler. See here:

https://github.com/apple/foundationdb/blob/4260bbb3c2e81531e1ec1493424544a2bea0c867/cmake/CompileActorCompiler.cmake#L26-L27
@sepeth sepeth linked a pull request Oct 21, 2024 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants