Skip to content

Fixed building ACE for Android with uses_wchar=1#2416

Merged
iguessthislldo merged 1 commit into
DOCGroup:masterfrom
iguessthislldo:igtd/android
Jul 7, 2025
Merged

Fixed building ACE for Android with uses_wchar=1#2416
iguessthislldo merged 1 commit into
DOCGroup:masterfrom
iguessthislldo:igtd/android

Conversation

@iguessthislldo
Copy link
Copy Markdown
Member

@iguessthislldo iguessthislldo commented Jul 3, 2025

Fixes #2415

Summary by CodeRabbit

  • Bug Fixes
    • Resolved an issue with building on Android platforms when the uses_wchar option is enabled, ensuring proper logging output in this configuration.

@iguessthislldo iguessthislldo requested a review from mitza-oci July 3, 2025 20:17
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jul 3, 2025

Walkthrough

The changes update the ACE library's Android logging implementation to ensure log messages are always passed as narrow character strings. Additionally, the release notes are updated to mention a fix for building ACE on Android with the uses_wchar option enabled.

Changes

File(s) Change Summary
ACE/NEWS Added a note for ACE 8.0.5 about a fix for Android builds with uses_wchar set to 1.
ACE/ace/Log_Msg_Android_Logcat.cpp Modified logging to wrap message data with ACE_TEXT_ALWAYS_CHAR() for consistent char* output.

Sequence Diagram(s)

sequenceDiagram
    participant ACE_Log as ACE Log_Msg_Android_Logcat
    participant AndroidLog as __android_log_write

    ACE_Log->>ACE_Log: Prepare log message (msg_data)
    ACE_Log->>ACE_Log: Convert to char* using ACE_TEXT_ALWAYS_CHAR()
    ACE_Log->>AndroidLog: Send log message (as char*)
Loading

Poem

🐇
On Android I log with a cheerful hop,
Now my messages never flip or flop.
With wchar or char, I always comply,
My logcat tales now never go awry.
ACE 8.0.5, a bunny-approved fix—oh my!


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 90630ff and cdfa7a5.

📒 Files selected for processing (2)
  • ACE/NEWS (1 hunks)
  • ACE/ace/Log_Msg_Android_Logcat.cpp (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: likema
PR: DOCGroup/ACE_TAO#2332
File: ACE/ace/Ping_Socket.cpp:227-232
Timestamp: 2025-02-13T18:50:43.028Z
Learning: In ACE framework's logging system (ACE_Log_Msg::log), `%b` is the correct format specifier for printing ssize_t values, not the standard C++ `%zd`.
Learnt from: likema
PR: DOCGroup/ACE_TAO#2332
File: ACE/ace/Ping_Socket.cpp:270-277
Timestamp: 2025-02-13T18:51:40.093Z
Learning: In ACE_Log_Msg logging system, '%b' is the correct format specifier for ssize_t values, not '%zd'. This is a custom format specifier specific to ACE's logging system.
Learnt from: likema
PR: DOCGroup/ACE_TAO#2332
File: ACE/ace/Ping_Socket.cpp:270-277
Timestamp: 2025-02-13T18:51:40.093Z
Learning: In ACE_Log_Msg logging system, '%b' is the correct format specifier to print ssize_t values, not '%zd'.
ACE/ace/Log_Msg_Android_Logcat.cpp (3)
Learnt from: likema
PR: DOCGroup/ACE_TAO#2332
File: ACE/ace/Ping_Socket.cpp:227-232
Timestamp: 2025-02-13T18:50:43.028Z
Learning: In ACE framework's logging system (ACE_Log_Msg::log), `%b` is the correct format specifier for printing ssize_t values, not the standard C++ `%zd`.
Learnt from: likema
PR: DOCGroup/ACE_TAO#2332
File: ACE/ace/Ping_Socket.cpp:270-277
Timestamp: 2025-02-13T18:51:40.093Z
Learning: In ACE_Log_Msg logging system, '%b' is the correct format specifier for ssize_t values, not '%zd'. This is a custom format specifier specific to ACE's logging system.
Learnt from: likema
PR: DOCGroup/ACE_TAO#2332
File: ACE/ace/Ping_Socket.cpp:270-277
Timestamp: 2025-02-13T18:51:40.093Z
Learning: In ACE_Log_Msg logging system, '%b' is the correct format specifier to print ssize_t values, not '%zd'.
⏰ Context from checks skipped due to timeout of 90000ms (20)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: VS2022Release64
  • GitHub Check: VS2022Debug64
  • GitHub Check: VS2022Debug64Cxx17
  • GitHub Check: VS2022WChar
  • GitHub Check: VS2022Debug32
  • GitHub Check: VS2022Release32
  • GitHub Check: VS2022Debug64Cxx20
  • GitHub Check: VS2022WChar
  • GitHub Check: MINGW64-gcc
  • GitHub Check: ubuntu-24.04 g++-10 wchar
  • GitHub Check: ubuntu-22.04 clang++-12
  • GitHub Check: ubuntu-22.04 g++-10
  • GitHub Check: ubuntu-22.04 clang++-13
  • GitHub Check: ubuntu-22.04 g++-9
  • GitHub Check: windows-2022 vs2022
  • GitHub Check: macos-13-C++
  • GitHub Check: macos-14-C++
  • GitHub Check: alpine-3.18
  • GitHub Check: ubuntu-24.04 g++
🔇 Additional comments (2)
ACE/NEWS (1)

4-5: LGTM! Proper release notes documentation.

The release notes entry accurately documents the fix for Android builds with wide character support enabled.

ACE/ace/Log_Msg_Android_Logcat.cpp (1)

68-72: LGTM! Correct fix for wide character compatibility.

The use of ACE_TEXT_ALWAYS_CHAR() ensures that log messages are always converted to narrow character strings for the Android logging API, regardless of ACE's wide character configuration. This is essential because __android_log_write() always expects const char*, but when uses_wchar=1 is set, log_record.msg_data() would return a wide character string.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Post Copyable Unit Tests in a Comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

iguessthislldo added a commit to iguessthislldo/ACE_TAO that referenced this pull request Jul 3, 2025
iguessthislldo added a commit to iguessthislldo/ACE_TAO that referenced this pull request Jul 3, 2025
@iguessthislldo
Copy link
Copy Markdown
Member Author

With wchar or char, I always comply,,
My logcat tales now never go awry.

That's kinda funny.

@iguessthislldo iguessthislldo merged commit d47df96 into DOCGroup:master Jul 7, 2025
36 of 37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

ACE doesn't compile on Android with wchar enabled

2 participants