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

Add coreMQTT library #80

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Add coreMQTT library #80

wants to merge 3 commits into from

Conversation

mateuszkobak
Copy link
Contributor

@mateuszkobak mateuszkobak commented Jul 3, 2024

Description

Porting a lightweight MQTT client library coreMQTT

JIRA-NIL588

Motivation and Context

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (refactoring, style fixes, git/CI config, submodule management, no code logic changes)

How Has This Been Tested?

  • Already covered by automatic testing.
  • New test added: (add PR link here).
  • Tested by hand on: armv7m7-imxrt117x.

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing linter checks and tests passed.
  • My changes generate no new compilation warnings for any of the targets.

Special treatment

Copy link

github-actions bot commented Jul 3, 2024

Unit Test Results

6 780 tests   - 680   6 154 ✅  - 591   32m 26s ⏱️ - 4m 9s
  380 suites  -  40     626 💤  -  89 
    1 files   ±  0       0 ❌ ±  0 

Results for commit 1553a5e. ± Comparison against base commit b659aa2.

This pull request removes 890 and adds 210 tests. Note that renamed tests count towards both.
flash ‑ armv7a9-zynq7000-zedboard:flash
phoenix-rtos-tests/cpp/hello-cpp ‑ armv7a9-zynq7000-zedboard:phoenix-rtos-tests/cpp/hello-cpp
phoenix-rtos-tests/initfini/main ‑ armv7a9-zynq7000-zedboard:phoenix-rtos-tests/initfini/main
phoenix-rtos-tests/ioctl/unit ‑ armv7a9-zynq7000-zedboard:phoenix-rtos-tests/ioctl/unit.ioctl.data_in
phoenix-rtos-tests/ioctl/unit ‑ armv7a9-zynq7000-zedboard:phoenix-rtos-tests/ioctl/unit.ioctl.data_in_big
phoenix-rtos-tests/ioctl/unit ‑ armv7a9-zynq7000-zedboard:phoenix-rtos-tests/ioctl/unit.ioctl.data_inout
phoenix-rtos-tests/ioctl/unit ‑ armv7a9-zynq7000-zedboard:phoenix-rtos-tests/ioctl/unit.ioctl.data_inout_big
phoenix-rtos-tests/ioctl/unit ‑ armv7a9-zynq7000-zedboard:phoenix-rtos-tests/ioctl/unit.ioctl.data_out
phoenix-rtos-tests/ioctl/unit ‑ armv7a9-zynq7000-zedboard:phoenix-rtos-tests/ioctl/unit.ioctl.data_out_big
phoenix-rtos-tests/ioctl/unit ‑ armv7a9-zynq7000-zedboard:phoenix-rtos-tests/ioctl/unit.ioctl.in_val
…
phoenix-rtos-tests/libc/misc ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/misc.unistd_file_safe.file_safe_readwrite
phoenix-rtos-tests/libc/misc ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/misc.unistd_file_safe.file_safe_readwrite_badfd
phoenix-rtos-tests/libc/misc ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/misc.unistd_file_safe.file_safe_readwrite_zero
phoenix-rtos-tests/libc/misc ‑ armv7a9-zynq7000-qemu:phoenix-rtos-tests/libc/misc.unistd_file_safe.file_safe_readwrite
phoenix-rtos-tests/libc/misc ‑ armv7a9-zynq7000-qemu:phoenix-rtos-tests/libc/misc.unistd_file_safe.file_safe_readwrite_badfd
phoenix-rtos-tests/libc/misc ‑ armv7a9-zynq7000-qemu:phoenix-rtos-tests/libc/misc.unistd_file_safe.file_safe_readwrite_zero
phoenix-rtos-tests/libc/misc ‑ armv7m4-stm32l4x6-nucleo:phoenix-rtos-tests/libc/misc.unistd_file_safe.file_safe_readwrite
phoenix-rtos-tests/libc/misc ‑ armv7m4-stm32l4x6-nucleo:phoenix-rtos-tests/libc/misc.unistd_file_safe.file_safe_readwrite_badfd
phoenix-rtos-tests/libc/misc ‑ armv7m4-stm32l4x6-nucleo:phoenix-rtos-tests/libc/misc.unistd_file_safe.file_safe_readwrite_zero
phoenix-rtos-tests/libc/misc ‑ armv7m7-imxrt106x-evk:phoenix-rtos-tests/libc/misc.unistd_file_safe.file_safe_readwrite
…

♻️ This comment has been updated with latest results.

Copy link
Member

@nalajcie nalajcie left a comment

Choose a reason for hiding this comment

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

left some remarks :)

coreMQTT/build.sh Outdated Show resolved Hide resolved

cp "${PREFIX_COREMQTT}/CMakeLists.txt" "${PREFIX_COREMQTT_BUILD}/CMakeLists.txt"

cmake -S "$PREFIX_COREMQTT_BUILD" -B "$PREFIX_COREMQTT_INSTALL"
Copy link
Member

Choose a reason for hiding this comment

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

what? building inside install dir?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure how this should be done. Is it better now?


mkdir -p "$PREFIX_COREMQTT_BUILD" "$PREFIX_COREMQTT_INSTALL"
if [ ! -f "$PREFIX_COREMQTT/v${COREMQTT_VERSION}.tar.gz" ]; then
wget "$PKG_URL" -P "${PREFIX_COREMQTT}" --no-check-certificate;
Copy link
Member

Choose a reason for hiding this comment

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

add mirror location, maybe we can wait for #78 to be merged and use utility functions from there? (@Darchiv)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am using functions from #78 now, but I haven't created the mirror yet

coreMQTT/CMakeLists.txt Outdated Show resolved Hide resolved
coreMQTT/CMakeLists.txt Outdated Show resolved Hide resolved
coreMQTT/build.sh Outdated Show resolved Hide resolved
@nalajcie nalajcie requested a review from Darchiv July 5, 2024 10:03
coreMQTT/CMakeLists.txt Outdated Show resolved Hide resolved
coreMQTT/CMakeLists.txt Outdated Show resolved Hide resolved
coreMQTT/CMakeLists.txt Outdated Show resolved Hide resolved
coreMQTT/CMakeLists.txt Outdated Show resolved Hide resolved
coreMQTT/build.sh Outdated Show resolved Hide resolved
Default version changed from 5.3.5 to 5.3.6.

Added port build options:
 - PORTS_LUA_VERSION - version to download (must be supported by
   respective patches);
 - PORTS_LUA_STACK_SIZE - size of Lua's internal stack;
 - PORTS_LUA_CSTACK_SIZE - size of stack (when using linked lua binary);
 - PORTS_LUA_COMPAT_5_2 - backward compatibility with Lua 5.2;
 - PORTS_LUA_DEBUG - enable debug features, e.g. API checks;
 - PORTS_LUA_INSTALL_TESTS - download and install external Lua test
   scripts;
 - PORTS_LUA_RESTRAIN - disable Lua features which may be used to crash
   the interpreter or perform side-effects in the operating system.

JIRA: NIL-595
fi

mycflags=(
${CFLAGS}

Choose a reason for hiding this comment

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

⚠️ [shellcheck] reported by reviewdog 🐶
Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a. SC2206

fi

mycflags=(
${CFLAGS}
-DLUAI_MAXSTACK=${PORTS_LUA_STACK_SIZE:-2000}

Choose a reason for hiding this comment

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

⚠️ [shellcheck] reported by reviewdog 🐶
Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a. SC2206

if [ "${PORTS_LUA_COMPAT_5_2}" = "y" ]; then mycflags+=("-DLUA_COMPAT_5_2"); fi
if [ "${PORTS_LUA_DEBUG}" = "y" ]; then mycflags+=("-DLUA_USE_APICHECK"); fi

myldflags=(

Choose a reason for hiding this comment

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

⚠️ [shellcheck] reported by reviewdog 🐶
Use spaces, not commas, to separate array elements. SC2054

if [ "${PORTS_LUA_DEBUG}" = "y" ]; then mycflags+=("-DLUA_USE_APICHECK"); fi

myldflags=(
${LDFLAGS}

Choose a reason for hiding this comment

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

⚠️ [shellcheck] reported by reviewdog 🐶
Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a. SC2206


myldflags=(
${LDFLAGS}
-Wl,-z,stack-size=${PORTS_LUA_CSTACK_SIZE:-4096}

Choose a reason for hiding this comment

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

⚠️ [shellcheck] reported by reviewdog 🐶
Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a. SC2206

JIRA: NIL-588
"coreMQTT"
)

source "${PREFIX_PROJECT}/phoenix-rtos-ports/build.subr"

Choose a reason for hiding this comment

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

📝 [shellcheck] reported by reviewdog 🐶
Not following: ./phoenix-rtos-ports/build.subr: openBinaryFile: does not exist (No such file or directory) SC1091

@mateuszkobak
Copy link
Contributor Author

@nalajcie @Darchiv, I revised my code according to your suggestions. Please take a look if it is better now :)

@mateuszkobak mateuszkobak marked this pull request as draft September 20, 2024 08:35
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.

3 participants