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

Initial, experimental modules support #106

Merged
merged 5 commits into from
Jul 28, 2023
Merged

Conversation

tcbrindle
Copy link
Owner

  • Define a macro FLUX_EXPORT which expands to export iff FLUX_MODULE_INTERFACE is defined
  • Add FLUX_EXPORT to all the names we want to export
  • Add a module definition file in a new module/ subdir, which #includes all of our stdlib uses into the global module fragment, then does #include <flux.hpp> in the module purview, having first defined FLUX_MODULE_INTERFACE.

This seems to work in initial testing with Clang 16 and GCC 13 using command line incantations. Not tested with MSVC yet.

No CMake support yet either, I might leave that for another time.

...and give it a .cpp extension as Clang and GCC prefer it
This is defined only when FLUX_MODULE_INTERFACE is defined, which is only the case when we're inside the module interface file
Previously, we were #include-ing flux.hpp in the global module fragment, and then exporting certain specific names within that.

With this change, we're now  putting the whole Flux lib in the module purview, and exporting certain names within that.

If I understand correctly (and that's a big "if"!) this means that all the symbols in the library now have module linkage, which seems like what we want?

It also means that we no longer need to maintain a separate list of exported entities, but instead should use the FLUX_EXPORT macro on their definition.

We do now have to pre-include all the standard library headers instead to avoid "taking ownership" of the names therein, but this seems manageable.
@codecov
Copy link

codecov bot commented Jul 27, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (0a0abbb) 97.67% compared to head (141f271) 97.67%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #106   +/-   ##
=======================================
  Coverage   97.67%   97.67%           
=======================================
  Files          66       66           
  Lines        2236     2236           
=======================================
  Hits         2184     2184           
  Misses         52       52           
Files Changed Coverage Δ
include/flux/core/assert.hpp 100.00% <ø> (ø)
include/flux/core/inline_sequence_base.hpp 91.66% <ø> (ø)
include/flux/core/numeric.hpp 90.00% <ø> (ø)
include/flux/core/optional.hpp 100.00% <ø> (ø)
include/flux/core/sequence_access.hpp 100.00% <ø> (ø)
include/flux/core/utils.hpp 100.00% <ø> (ø)
include/flux/op/adjacent.hpp 100.00% <ø> (ø)
include/flux/op/all_any_none.hpp 100.00% <ø> (ø)
include/flux/op/begin_end.hpp 85.10% <ø> (ø)
include/flux/op/cache_last.hpp 0.00% <ø> (ø)
... and 52 more

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tcbrindle tcbrindle merged commit 390c752 into main Jul 28, 2023
25 checks passed
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.

1 participant