| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
The new module test introduces an unused structured-binding element that is likely to fail MSVC builds under /WX (warnings-as-errors) as configured by the project’s default settings.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overviewThis PR restores Taskflow’s C++ module build on MSVC by correcting module partition exports/includes, updating the module CMake target to inherit the main library’s build settings, and adding regression coverage plus Windows CI to prevent module import/Executor::async failures (e.g., MSVC C3779).
Changes:
| File | Description |
|---|---|
| unittests/modules/test_tf.cppm | New consumer module exercising async returns, dependent async, subflows, hashing, and profiler output. |
| unittests/modules/test_cxx_modules.cpp | Adds a transitive-import doctest case that imports test_tf and validates module behavior across worker counts. |
| unittests/modules/CMakeLists.txt | Builds the new test module interface via FILE_SET CXX_MODULES. |
| taskflow/observer/tfprof.hpp | Changes profiler helper functions’ linkage to remain available when used through a module. |
| modules/tf.utility.cppm | Removes exports for obsolete utility symbols (all_same, all_same_v). |
| modules/tf.core.cppm | Includes the public Taskflow header and updates exported symbols (Subflow, GraphLike). |
| modules/CMakeLists.txt | Requires CMake 3.28 for module builds, links module target to Taskflow::Taskflow, and installs module sources under include/taskflow/modules. |
| .github/workflows/windows.yml | Adds a Windows CI job to build/run module tests in Debug/Release. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Sorry, something went wrong.
| auto [last, done] = executor.dependent_async([&count] { ++count; }, first); | ||
| done.get(); |
| // helper: emit a horizontal rule of width w | ||
| static inline void _tf_rule(std::ostream& os, size_t w, char c = '-') { | ||
| inline void _tf_rule(std::ostream& os, size_t w, char c = '-') { | ||
| for(size_t i = 0; i < w; ++i) os << c; | ||
| os << '\n'; | ||
| } |
| // Helper: _tf_time_scale | ||
| // Given a duration in microseconds, returns a human-readable scaled value | ||
| // and sets unit to the appropriate suffix string. | ||
| // Thresholds: | ||
| // < 10,000 us -> us (microseconds) | ||
| // < 10,000 ms -> ms (milliseconds) | ||
| // < 10,000 s -> s (seconds) | ||
| // otherwise -> min (minutes) | ||
| static inline double _tf_time_scale(size_t us, const char*& unit) { | ||
| inline double _tf_time_scale(size_t us, const char*& unit) { | ||
| if(us < 10000ULL) { |
| Back | FazBrowse Home | New Git URL |
Related to #780.
This PR restores C++ module builds and asynchronous task imports on the current master branch. On MSVC 19.44, importing tf and calling Executor::async produces C3779 because the core partition exports Executor without including its async definitions. The module interfaces also reference symbols that have since been removed or renamed, preventing the module library from building.
The core partition includes the public Taskflow entry point, exports Subflow, and uses the current GraphLike name. Obsolete exports are removed. The module-node constructors are defined in class so MSVC 19.51 can construct the node variant through imported composed_of templates; out-of-class definitions result in C2661 on that compiler. The profiler's two header helpers use external inline linkage so their definitions remain available when the profiler is used through a module; MSVC otherwise reports C2129.
The module target inherits Taskflow's include paths, thread linkage, compile options, and feature definitions. Its installed sources go under include/taskflow/modules, and exported module include paths no longer retain the source checkout. CMake 3.28 is required only when module support is enabled.
A consumer module regression test exercises captured async return values, runtime and dependent async tasks, subflows, hashing, and profiler output through a further import. A Windows Debug/Release CI job builds and runs the module tests.
Validation
Locally tested on Windows x64 with Visual Studio 2022, MSVC 19.44.35225, and CMake 3.31.6:
The installed consumer requires Ninja with this CMake version: its Visual Studio generator does not support the necessary BMI-only compilation. The profiler consumer test includes <chrono>; removing it exposes a separate MSVC chrono-operator import diagnostic. CUDA and other compiler platforms have not been validated locally.
The missing <algorithm> include mentioned in #780 is already present upstream. VS 2026 / MSVC 19.51.36256 passes all 17 module tests in both Debug and Release in the fork Windows workflow. This verifies the C2661 module-composition failure; the original report's internal compiler crash has not been independently reproduced, so this PR does not claim to resolve every symptom in the issue.
Thank you for maintaining Taskflow. I would appreciate your feedback on this approach, particularly whether you would prefer the packaging changes in a separate PR.