8000 Add missing .o files to libiotivity-lite-jni.so by Danielius1922 · Pull Request #635 · iotivity/iotivity-lite · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add missing .o files to libiotivity-lite-jni.so #635

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

Merged
merged 2 commits into from
Jul 9, 2024

Conversation

Danielius1922
Copy link
Member

No description provided.

@ocf-conformance-test-tool
Copy link

🎉 Thank you for your code contribution! To guarantee the change/addition is conformant to the OCF Specification, we would like to ask you to execute OCF Conformance Testing of your change ☝️ when your work is ready to be reviewed.


ℹ️ To verify your latest change (27fe5d8), label this PR with OCF Conformance Testing.

⚠️ Label is removed with every code change.

Copy link
coderabbitai bot commented Jul 9, 2024

Walkthrough

The changes incorporate path updates, compilation rule refinements, and new security settings in various Makefiles. The C code adaptations adjust header inclusions based on Android API levels. SWIG interface updates include function renames, conditional implementations, and enhanced type mappings to maintain compatibility and security. Additionally, a GitHub workflow modification sets security arguments for Android builds more explicitly.

Changes

File(s) Change Summary
port/android/Makefile Updated OBJ_PORT_COMMON paths and rules for compiling source files using ${OBJDIR}.
port/android/ipadapter.c Adjusted inclusion of network interface headers and definitions based on Android API level.
swig/Makefile Added flags -Wl,--no-undefined and llog, introduced PORT_COMMON_OBJ_DIR, and added security settings with validation checks.
swig/swig_interfaces/iotivity.swg Corrected typemap declaration for oc_cloud_status_t to ensure proper type casting.
swig/swig_interfaces/oc_api.i Added new function jni_reset_v1, ignored/renamed reset-related functions based on OC_SECURITY.
swig/swig_interfaces/oc_core_res.i Introduced jni_core_is_SVR with conditional logic and ignored the original oc_core_is_SVR.
swig/swig_interfaces/oc_cred.i Added (void)self; statements in conditional blocks for warning-free compilation. Ignored specific credential-related functions and types.
swig/swig_interfaces/oc_obt.i Added oc_sec_get_acl and ignored oc_obt_set_sd_info.
swig/swig_interfaces/oc_pki.i Added an include directive for "oc_sp.h".
.github/workflows/android.yml Modified job configuration to set SECURE and PKI arguments to 0.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

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>.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @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.

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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration 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.

Copy link
@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 4a9fad5 and 27fe5d8.

Files selected for processing (2)
  • port/android/Makefile (2 hunks)
  • swig/Makefile (3 hunks)
Additional comments not posted (6)
swig/Makefile (3)

134-134: Good addition to LDFLAG to ensure all symbols are defined.

Including -Wl,--no-undefined helps catch undefined symbols during the linking stage, improving build robustness.

Also applies to: 141-141


150-150: Introduction of PORT_COMMON_OBJ_DIR enhances modularity.

Centralizing the object files from the port/common directories into a single variable improves maintainability and modularity.


181-181: Update to build_jni_so rule ensures inclusion of common object files.

Including $(PORT_COMMON_OBJ_DIR)*.o in the list of object files ensures that the common object files are correctly linked, completing the build process.

port/android/Makefile (3)

199-199: Update to OBJ_PORT_COMMON path improves consistency.

Using ${OBJDIR}/port/ instead of obj/port/ aligns with the ${OBJDIR} variable, enhancing consistency and flexibility in the build process.


329-329: Update to compilation rules for ../../port/common/ source files improves organization.

Incorporating ${OBJDIR} into the target paths ensures that the compiled object files are placed in the correct directory structure, enhancing organization and maintainability.


333-333: Update to compilation rules for ../../port/common/posix/ source files improves organization.

Incorporating ${OBJDIR} into the target paths ensures that the compiled object files are placed in the correct directory structure, enhancing organization and maintainability.

@Danielius1922 Danielius1922 force-pushed the adam/hotfix/fix-android-missing-symbols branch from 27fe5d8 to 4d4a1de Compare July 9, 2024 11:45
Copy link
@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 27fe5d8 and 4d4a1de.

Files selected for processing (2)
  • port/android/Makefile (2 hunks)
  • swig/Makefile (3 hunks)
Files skipped from review as they are similar to previous changes (2)
  • port/android/Makefile
  • swig/Makefile

@Danielius1922 Danielius1922 force-pushed the adam/hotfix/fix-android-missing-symbols branch from 4d4a1de to bbd3148 Compare July 9, 2024 12:07
Copy link
@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Outside diff range and nitpick comments (1)
swig/swig_interfaces/oc_api.i (1)

Line range hint 555-564:
Add a comment explaining the conditional compilation.

The function jni_reset_device conditionally calls oc_reset_device based on OC_SECURITY. Adding a comment to explain this would improve code readability.

#ifdef OC_SECURITY
  // If security is enabled, call oc_reset_device with the device parameter.
  oc_reset_device(device);
#else
  // If security is not enabled, the device parameter is unused.
  (void)device;
#endif /* OC_SECURITY */
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 4d4a1de and bbd3148.

Files selected for processing (9)
  • port/android/Makefile (2 hunks)
  • port/android/ipadapter.c (2 hunks)
  • swig/Makefile (5 hunks)
  • swig/swig_interfaces/iotivity.swg (1 hunks)
  • swig/swig_interfaces/oc_api.i (3 hunks)
  • swig/swig_interfaces/oc_core_res.i (1 hunks)
  • swig/swig_interfaces/oc_cred.i (4 hunks)
  • swig/swig_interfaces/oc_obt.i (2 hunks)
  • swig/swig_interfaces/oc_pki.i (1 hunks)
Files skipped from review due to trivial changes (2)
  • swig/swig_interfaces/oc_cred.i
  • swig/swig_interfaces/oc_pki.i
Files skipped from review as they are similar to previous changes (1)
  • port/android/Makefile
Additional comments not posted (10)
swig/swig_interfaces/oc_core_res.i (1)

54-68: LGTM!

The introduction of the jni_core_is_SVR function with conditional logic based on OC_SECURITY is well-implemented. The renaming and debug statements are appropriate.

swig/Makefile (4)

69-71: LGTM!

The introduction of SECURE and PKI settings along with the security check to ensure PKI is not enabled without security is appropriate and necessary for maintaining secure builds.

Also applies to: 94-96


140-140: LGTM!

The addition of -Wl,--no-undefined and -llog to the linker flags for Linux and Android builds enhances the build process by ensuring all symbols are defined and adding logging support for Android.

Also applies to: 147-147


156-156: LGTM!

The introduction of PORT_COMMON_OBJ_DIR enhances the organization and modularity of the build process.


187-187: LGTM!

The update to the build_jni_so rule to include the common object directory ensures that all necessary object files are included in the shared library build process.

swig/swig_interfaces/iotivity.swg (1)

69-69: LGTM!

The correction to the typemap declaration for oc_cloud_status_t ensures proper input casting.

swig/swig_interfaces/oc_obt.i (1)

83-84: LGTM!

Ignoring functions and types that are not yet implemented and adding TODO comments for future implementation help in maintaining the codebase and planning future development.

Also applies to: 117-118

port/android/ipadapter.c (2)

67-70: Ensure __ANDROID_API__ is defined.

The inclusion of <android/api-level.h> and the check for __ANDROID_API__ ensures that the Android API level is defined. If not, it raises a preprocessor error.


71-79: Conditional inclusion of headers based on Android API level.

The code correctly includes the appropriate headers and defines macros for getifaddrs and freeifaddrs based on the Android API level.

swig/swig_interfaces/oc_api.i (1)

1013-1014: LGTM!

Ignoring the function oc_reset_v1 is acceptable.

Copy link
@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between bbd3148 and 9262553.

Files selected for processing (1)
  • .github/workflows/android.yml (1 hunks)
Additional comments not posted (1)
.github/workflows/android.yml (1)

46-47: Verify the new configuration disabling security and PKI.

Ensure that the configuration SECURE=0 PKI=0 is intended and verify its impact on the build and runtime behavior.

Copy link
sonarqubecloud bot commented Jul 9, 2024

@Danielius1922 Danielius1922 merged commit 122d8f5 into master Jul 9, 2024
131 checks passed
@Danielius1922 Danielius1922 deleted the adam/hotfix/fix-android-missing-symbols branch July 9, 2024 14:34
@github-actions github-actions bot locked and limited conversation to collaborators Jul 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0