From 16a819bb9f5dcc59b77c9e91e9fed5fe29977e8c Mon Sep 17 00:00:00 2001 From: Christopher Friedt Date: Thu, 11 Aug 2022 07:41:41 -0400 Subject: [PATCH] ci: remove dependency on pull/43987/head to track zephyr main directly This is a temporary workaround until the mountain of tech-debt is flattened w.r.t the following: https://github.com/zephyrproject-rtos/zephyr/pull/43987 https://github.com/zephyrproject-rtos/gsoc-2022-thrift/pull/62 https://github.com/zephyrproject-rtos/zephyr/issues/43998 https://github.com/zephyrproject-rtos/zephyr/issues/46910 https://github.com/zephyrproject-rtos/zephyr/issues/45100 but also around the mountain of tech-debt as a result of poor arch/posix software architecture, CONFIG_ARCH_POSIX and CONFIG_POSIX_API incompatibility, and the resultant spillover of moving POSIX definitions into the network subsystem as a result. Fixes #129 Signed-off-by: Christopher Friedt --- .github/workflows/build.yml | 24 +++++++++---------- .upstream | 2 +- lib/thrift/include/sys/poll.h | 2 +- lib/thrift/include/zephyr/posix/sys/ioctl.h | 22 +++++++++++++++++ .../include/zephyr/posix/sys/ioctl_calls.h | 19 +++++++++++++++ lib/thrift/src/thrift/server/TFDServer.cpp | 6 ++--- west.yml | 6 ++--- 7 files changed, 60 insertions(+), 21 deletions(-) create mode 100644 lib/thrift/include/zephyr/posix/sys/ioctl.h create mode 100644 lib/thrift/include/zephyr/posix/sys/ioctl_calls.h diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cf1ed4b..89f89a2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -46,19 +46,19 @@ jobs: source zephyr-env.sh twister -i -G -T tests/ -# - name: Build Samples -# working-directory: thrift-for-zephyr -# shell: bash -# run: | -# source zephyr-env.sh -# twister -i --build-only -G -T samples/ + - name: Build Samples + working-directory: thrift-for-zephyr + shell: bash + run: | + source zephyr-env.sh + twister -i --build-only -G -T samples/ -# - name: Build Samples (POSIX) -# working-directory: thrift-for-zephyr -# shell: bash -# run: | -# make -j -C samples/lib/thrift/hello_client -# make -j -C samples/lib/thrift/hello_server + - name: Build Samples (POSIX) + working-directory: thrift-for-zephyr + shell: bash + run: | + make -j -C samples/lib/thrift/hello_client + make -j -C samples/lib/thrift/hello_server # - name: Archive firmware # uses: actions/upload-artifact@v2 diff --git a/.upstream b/.upstream index 7372973..63cad2e 160000 --- a/.upstream +++ b/.upstream @@ -1 +1 @@ -Subproject commit 7372973987786312da8175e61c58d99e17c12df1 +Subproject commit 63cad2ee536ead54e6ac75fb5401beb9ab2bbee2 diff --git a/lib/thrift/include/sys/poll.h b/lib/thrift/include/sys/poll.h index 55a68e1..6749cd5 100644 --- a/lib/thrift/include/sys/poll.h +++ b/lib/thrift/include/sys/poll.h @@ -17,7 +17,7 @@ * See https://pubs.opengroup.org/onlinepubs/9699919799/functions/poll.html */ -#include +#include /* sneaking this in here to avoid changing zephyr's */ #ifndef FIONREAD diff --git a/lib/thrift/include/zephyr/posix/sys/ioctl.h b/lib/thrift/include/zephyr/posix/sys/ioctl.h new file mode 100644 index 0000000..e06e4fc --- /dev/null +++ b/lib/thrift/include/zephyr/posix/sys/ioctl.h @@ -0,0 +1,22 @@ +/* + * Copyright 2022 Meta + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#define FIONBIO 0x5421 + +#ifdef __cplusplus +extern "C" { +#endif + +/* Zephyr's header does not include this crucial declaration */ +int ioctl(int fd, unsigned long request, ...); + +#include + +#ifdef __cplusplus +} +#endif diff --git a/lib/thrift/include/zephyr/posix/sys/ioctl_calls.h b/lib/thrift/include/zephyr/posix/sys/ioctl_calls.h new file mode 100644 index 0000000..7353eef --- /dev/null +++ b/lib/thrift/include/zephyr/posix/sys/ioctl_calls.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2022 Meta + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +__syscall int zephyr_ioctl(int fd, unsigned long request, va_list args); + +#ifdef __cplusplus +} +#endif + +#include diff --git a/lib/thrift/src/thrift/server/TFDServer.cpp b/lib/thrift/src/thrift/server/TFDServer.cpp index e539c91..8c70499 100644 --- a/lib/thrift/src/thrift/server/TFDServer.cpp +++ b/lib/thrift/src/thrift/server/TFDServer.cpp @@ -8,9 +8,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include diff --git a/west.yml b/west.yml index 3d6c7a7..3944650 100644 --- a/west.yml +++ b/west.yml @@ -14,13 +14,11 @@ manifest: remote: cfriedt path: thrift-for-zephyr/.upstream # corresponds to revision: v0.16.0, but the tag does not exist in cfriedt/thrift - revision: 7372973987786312da8175e61c58d99e17c12df1 + revision: 63cad2ee536ead54e6ac75fb5401beb9ab2bbee2 - name: net-tools remote: zephyrproject-rtos revision: master - name: zephyr remote: zephyrproject-rtos - # Remove the need for 'posix/' prefix when including std headers - # https://github.com/zephyrproject-rtos/zephyr/pull/43987 - revision: pull/43987/head + revision: main import: true