-
Notifications
You must be signed in to change notification settings - Fork 2
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
Proper fmt
and std
modules support (starting with v11.0.0
)
#5
Comments
Happy to help if needed. What are the current issues with the modules support? |
@kamrann Thanks! I just clarified the missing/incomplete parts in the first post to have a clear todolist. Feel free to ask for details and clarifications. Note that upstream tests are not there yet and the tests I'm talking about above are the "smoke tests" currently existing, which are already setup to be able to run the same code being included or imported, but we need to improve that. |
Ok thanks, no worries. Yeah I think I should be able to help with some of this. Though the question of interaction between and usage of So to try to clarify my understanding of the intentions with your existing setup. I also in my experiments intuitively added a So I suppose what I'm getting at is, there are rather a lot of potential combinations when it comes to modularizing ( |
I have been thinking about all this too. Note that I disagree with the current way the option is initialized too (so I disagree with my old self). (https://github.com/build2-packaging/fmt/blob/master/fmt/build/root.build#L18) This init needs to be removed.
My thinking at the moment:
Given that, I propose that:
Point 3 could be set aside for later as it is not proven important yet. Just note that today if I had that option, I would systematically turn it on, personally. |
That sounds good, though need to clarify one thing on the 'both' mode. Are you saying that under Regarding
I'm wondering though if it may be worth bringing this up with Boris to see if he intends to integrate something into the toolchain for One last thing, I assume I should be branching off |
You understand correctly the proposition 👍🏽 Thinking about it the only thing that "prevents" is that there would be no way to not provide the modules in that situation (no way to "force" includs only). We might want to take the time to ponder that proposition for a minute.
I suspect this is not reliable enough yet but we might experiment to be sure. Also, I'm thinking about
The idea of that choice is there only because upstream provide that choice, and having it enabled if possible does provide an advantage, I wouldnt consider it otherwise. Hopefully not all libraries will do that and they will probably "just" rely on feature macros instead (and maybe fail with build2 though).
Yes that would be the ideal, but only if the build-system enables
Do you mean to detect if
Yes ignore other brancehs than |
Yeah, although there are two essentially orthogonal things.
It would be nice if
Curious, do you have specific reason to believe |
My assumption is based on libc++'s usual portability on windows but I might be wrong because of the details you found, I wasnt aware you had to change system headers (and that sounds fishy XD). |
Pushed an experimental attempt at your (3) to the PR. My attempt to test it's working as intended feels a bit weird, maybe there is something simpler? Can of course revert that commit if you think it's best to hold off on the functionality for the moment. |
Thanks, I'll test asap (in the week) 👍🏽 |
Status update. We're most of the way there, and at this point mostly waiting on some more upstream changes needed to resolve linker errors with modules, and compiler module support to be generally less broken! Some initial modules CI configurations have been added to the |
Version
v11.0.0
offmt
is now correctly supported using CMake and also provides a way to makefmt
usestd
ifimport std;
is working. We need tofmt
modules support (it's broken and limited in several ways)cxx.features.modules = true
whenconfig.fmt.enable_modules
as been set totrue
for thefmt
package and not a configuration-wide value. I started experimenting with a solution this several weeks ago but had to stop and couldnt resume exploring this yet.lib{fmt}
target will expose either headers OR a module but not both. The recent upstream version however does support providing both in the same target because there is an optional support for having thefmt
module's code usingexternal "C++" {
which makes it part of the global module instead of thefmt
module. This allows code that includes and importsfmt
to still work (with consequences on the link-side). Ideally, we would support both exclusively-module, exclusively headers and "both" cases. That should be easy to provide. We also need tests for that "both" case.import std;
inside thefmt
module (new v11 feature, see upstream release note)manifest
s to run the tests using the modules versions offmt
on build2's CIThe text was updated successfully, but these errors were encountered: