Skip to content

Conversation

@GordonSmith
Copy link
Owner

No description provided.

@GordonSmith GordonSmith requested a review from Copilot October 13, 2025 18:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes the code generator to properly handle WIT use statements by expanding support for cross-interface and cross-namespace type imports, rather than only generating using declarations for same-namespace imports.

  • Removes restrictions that prevented cross-interface use statements from generating using declarations
  • Adds support for type renaming in use statements via type_renames mapping
  • Implements proper namespace qualification for cross-namespace references (host vs guest)

@github-actions
Copy link

github-actions bot commented Oct 13, 2025

Ubuntu Test Results

wit-stub-generation-test Results

This test is expected to have failures due to known issues with tuple wrapper types.

Compilation Summary

Metric Value
Total targets 37
✅ Passed 35 (94.6%)
❌ Failed 2 (5.4%)
Total errors 114

Error Breakdown

Error Type Count
std::get<> function call errors 0
result_ok_wrapper related 144
result_err_wrapper related 144
Missing file errors 2

Sample Errors

/home/runner/work/component-model-cpp/component-model-cpp/test/../include/cmcpp/variant.hpp:32:48: error: no match for ‘operator=’ (operand types are ‘std::variant<std::monostate, std::monostate>’ and ‘std::monostate’)
/home/runner/work/component-model-cpp/component-model-cpp/test/../include/cmcpp/variant.hpp:32:48: error: no match for ‘operator=’ (operand types are ‘std::variant<std::monostate, unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, cmcpp::record_t<host::variants::empty_data>, std::monostate, unsigned int, float>’ and ‘std::monostate’)
/usr/include/c++/13/tuple:2303:42: error: no matching function for call to ‘get<0>(cmcpp::result_err_wrapper<std::tuple<unsigned int> >&)’
/usr/include/c++/13/tuple:2303:42: error: no matching function for call to ‘get<0>(cmcpp::result_ok_wrapper<std::tuple<unsigned int> >&)’
/usr/include/c++/13/tuple:2303:42: error: type/value mismatch at argument 1 in template parameter list for ‘template<class _Tp, class ... _Types> constexpr _Tp& std::get(tuple<_UTypes ...>&)’

Known Issues

The main issue is that result_ok_wrapper and result_err_wrapper types don't support std::get<> operations needed for tuple unpacking in generated code.

Goal: These failures should ideally decrease over time or remain stable. Any increase warrants investigation.


Updated: 2025-10-14T04:53:30.864Z

Signed-off-by Gordon Smith <GordonJSmith@gmail.com>
@codecov
Copy link

codecov bot commented Oct 14, 2025

Codecov Report

❌ Patch coverage is 75.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.13%. Comparing base (3934d24) to head (974b2e8).

Files with missing lines Patch % Lines
include/cmcpp/string.hpp 75.00% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main      #17   +/-   ##
=======================================
  Coverage   78.13%   78.13%           
=======================================
  Files          21       21           
  Lines        1537     1537           
  Branches      131      131           
=======================================
  Hits         1201     1201           
  Misses        236      236           
  Partials      100      100           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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