Skip to content

Cpp23 import std attempt2#15559

Open
mccakit wants to merge 12 commits intomesonbuild:masterfrom
mccakit:cpp23-import-std-attempt2
Open

Cpp23 import std attempt2#15559
mccakit wants to merge 12 commits intomesonbuild:masterfrom
mccakit:cpp23-import-std-attempt2

Conversation

@mccakit
Copy link

@mccakit mccakit commented Feb 16, 2026

This PR adds import std support for clang

Copy link
Contributor

@mathstuf mathstuf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that it is using compile_commands.json for clang-scan-deps. Are generated sources that are created during the build supported here? If not, is that wanted? If so, can docs about that be added?

I've only done a skim rather than a deep dive so far. One thing that would help would be test cases.

@mccakit
Copy link
Author

mccakit commented Feb 16, 2026

This works

project('hello_modules', 'cpp',
  default_options: ['cpp_std=c++26'])

gen = custom_target('gen_module',
  output: 'node_generated.cpp',
  command: ['python3', files('gen_module.py'), '@OUTPUT@'])

exe = executable('hello',
  sources: ['main.cpp', 'node_a.cc', 'node_b.cpp', 'node_c.cxx', 'node_d.cc', gen])

You can test it yourself if you want

hello_modules.zip

@mccakit mccakit requested a review from mathstuf February 16, 2026 08:36
@mccakit
Copy link
Author

mccakit commented Feb 16, 2026

Currently, the only failing test cases are related to the Fortran and Rust modules. I would recommend removing that functionality from the build system, since those packages should be built using their native build systems — Rust with Cargo (pkgconfig packages by cargo-c), and Fortran with its respective toolchain.

That said, if anyone has a better solution for handling this, suggestions are welcome. I don’t have much experience with Fortran compilation, nor is it something I’m particularly focused on.

Once this is resolved, I would add the test project I shared in this discussion as a test case, and the remaining tests can be derived from the ongoing discussion.

@mccakit mccakit force-pushed the cpp23-import-std-attempt2 branch from 73aa3e4 to ee3ec4b Compare February 16, 2026 10:32
@mccakit
Copy link
Author

mccakit commented Feb 16, 2026

Last commit fixes fortran and rust module errors by allowing per target scanning for fortran.

@mccakit mccakit force-pushed the cpp23-import-std-attempt2 branch 2 times, most recently from ea3d39e to c88ef65 Compare February 16, 2026 14:40
@mccakit
Copy link
Author

mccakit commented Feb 16, 2026

I'm having trouble fixing the CI for ubuntu rolling clang.
With the last commit I can run tests without any errors.
Some help would be appreciated

@mccakit mccakit force-pushed the cpp23-import-std-attempt2 branch from c88ef65 to 8b2f84d Compare February 16, 2026 15:52
@mccakit
Copy link
Author

mccakit commented Feb 16, 2026

I tried replicating the ubuntu clang ci, and tests passed. Only thing that was need was a symlink for finding clang-scan-deps. But I think that needs to be a variable on its own but currently I'm not planning on any new changes.

@jpakkane
Copy link
Member

The pyright config file is still in this MR. All traces of it should be rebased away (i.e. removing the "Delete pyrightconfig.json" commit and everything related).

@mccakit mccakit force-pushed the cpp23-import-std-attempt2 branch from aabc60e to 0b5cb7e Compare February 17, 2026 17:36
@mccakit
Copy link
Author

mccakit commented Feb 17, 2026

The pyright config file is still in this MR. All traces of it should be rebased away (i.e. removing the "Delete pyrightconfig.json" commit and everything related).

Done

@mccakit
Copy link
Author

mccakit commented Feb 26, 2026

ping @jpakkane

@mccakit
Copy link
Author

mccakit commented Mar 4, 2026

ping @dcbaker @mathstuf

@dnicolodi
Copy link
Member

The lint failures needs to be fixed. The test failure seem relevant to the changes to the PR and need to be at least investigated. The motivation to look at the PR before these things are fixed is very little.

@mccakit
Copy link
Author

mccakit commented Mar 4, 2026

How am I supposed to know what needs to be fixed if there is no feedback?

I'm not a long time contributor to meson, reviewers should guide me a little or should close my PR to show their disinterest.

@dnicolodi
Copy link
Member

How am I supposed to know what needs to be fixed if there is no feedback?

I just provided you feedback. However, I think the fact that the lint checks and the projects tests need to pass should be self evident. Resources are finite and most likely no one feels like spending the available resources reviewing code that is known to require more work before it is working order.

@mccakit
Copy link
Author

mccakit commented Mar 4, 2026

Alright, lint errors are gone, I really need some feedback for other CI failures.

@mccakit mccakit force-pushed the cpp23-import-std-attempt2 branch from b9d2a19 to dd23eb1 Compare March 4, 2026 16:14
@mccakit
Copy link
Author

mccakit commented Mar 4, 2026

I need some information on how the llvm detected with the macos CI, framework test always fail due to not finding llvm.

I'm not a Mac user, so I have no clue how to fix this, I tried editing llvm version detection in the source and installing a specific llvm version via homebrew but got the same result.

@mccakit mccakit force-pushed the cpp23-import-std-attempt2 branch 4 times, most recently from 254ee40 to dd23eb1 Compare March 4, 2026 20:35
@mccakit
Copy link
Author

mccakit commented Mar 4, 2026

@germandiagogomez hey, from the draft I can assume you are a Mac user.
Would you like to assist me in this PR?

I can't get the 2/3 macos workflows succeed, and I only have windows and linux machines available.

@mccakit mccakit force-pushed the cpp23-import-std-attempt2 branch from cae83f4 to dd23eb1 Compare March 6, 2026 20:27
@mccakit
Copy link
Author

mccakit commented Mar 6, 2026

Ok macos tests pass now, are there any tips on how to deal with ci logs?
I need to focus on one error at a time, but log is like 100k lines.

@mccakit mccakit force-pushed the cpp23-import-std-attempt2 branch from b1ae4dc to 57fa5d6 Compare March 7, 2026 14:10
@mccakit
Copy link
Author

mccakit commented Mar 7, 2026

with last commit ubuntu ci issues are gone, at least in my own container where I run the tests, I'll update the comment if CI fails.

However, generated module files no longer work.

@mccakit
Copy link
Author

mccakit commented Mar 7, 2026

CI image failiures and msys/cygwin issues have nothing to do with this PR.
I can't fix cmake ones, that is beyond me. I have no clue how meson invokes cmake etc.
If I won't get any feedback on this, I'll turn the PR into a draft and let someone else pick it up in the future kinda like the og PR here, #14989

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 this pull request may close these issues.

4 participants