You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "xuxin930 (via GitHub)" <gi...@apache.org> on 2023/08/23 03:17:31 UTC

[GitHub] [nuttx] xuxin930 commented on issue #10241: cmake: OpenAMP build doesn't work for multiple build directories

xuxin930 commented on issue #10241:
URL: https://github.com/apache/nuttx/issues/10241#issuecomment-1689213221

   > @anchao @xuxin930 Is there any reason why we don't use `PATCH_COMMAND` in `FetchContent_Declare` for patching? It seems that this problem doesn't occur with command like this:
   > 
   > ```
   >   FetchContent_Declare(
   >     open-amp
   >     DOWNLOAD_NAME "libopen-amp-v${OPENAMP_VERSION}.zip"
   >     DOWNLOAD_DIR ${CMAKE_CURRENT_LIST_DIR}
   >     URL "https://github.com/OpenAMP/open-amp/archive/v${OPENAMP_VERSION}.zip"
   >         SOURCE_DIR
   >         ${CMAKE_CURRENT_LIST_DIR}/open-amp
   >         BINARY_DIR
   >         ${CMAKE_BINARY_DIR}/openamp/open-amp
   >         PATCH_COMMAND
   >         patch -p0 -d ${CMAKE_CURRENT_LIST_DIR} <
   >         ${CMAKE_CURRENT_LIST_DIR}/0001-ns-acknowledge-the-received-creation-message.patch
   >         && patch -p0 -d ${CMAKE_CURRENT_LIST_DIR} <
   >         ${CMAKE_CURRENT_LIST_DIR}/0002-Negotiate-individual-buffer-size-dynamically.patch
   >         && patch -p0 -d ${CMAKE_CURRENT_LIST_DIR} <
   >         ${CMAKE_CURRENT_LIST_DIR}/0003-rpmsg-wait-endpoint-ready-in-rpmsg_send-and-rpmsg_se.patch
   >         && patch -p0 -d ${CMAKE_CURRENT_LIST_DIR} <
   >         ${CMAKE_CURRENT_LIST_DIR}/0004-openamp-add-new-ops-notify_wait-support.patch
   >         && patch -p0 -d ${CMAKE_CURRENT_LIST_DIR} <
   >         ${CMAKE_CURRENT_LIST_DIR}/0005-rpmsg_virtio-don-t-need-check-status-when-get_tx_pay.patch
   >         && patch -p0 -d ${CMAKE_CURRENT_LIST_DIR} <
   >         ${CMAKE_CURRENT_LIST_DIR}/0006-rpmsg-notify-the-user-when-the-remote-address-is-rec.patch
   >         && patch -p0 -d ${CMAKE_CURRENT_LIST_DIR} <
   >         ${CMAKE_CURRENT_LIST_DIR}/0007-openamp-avoid-double-calling-ns_bound-when-each-othe.patch
   >         && patch -p0 -d ${CMAKE_CURRENT_LIST_DIR} <
   >         ${CMAKE_CURRENT_LIST_DIR}/0008-remoteproc-make-all-elf_-functions-static-except-elf.patch
   >         && patch -p0 -d ${CMAKE_CURRENT_LIST_DIR} <
   >         ${CMAKE_CURRENT_LIST_DIR}/0009-Fix-warn-declaration-of-vring_rsc-shadows-a-previous.patch
   >         && patch -p0 -d ${CMAKE_CURRENT_LIST_DIR} <
   >         ${CMAKE_CURRENT_LIST_DIR}/0010-rptun-fix-rptun-don-t-wait-issue-when-get-tx-patyloa.patch
   >         && patch -p0 -d ${CMAKE_CURRENT_LIST_DIR} <
   >         ${CMAKE_CURRENT_LIST_DIR}/0011-rpmsg-fix-rpmsg_virtio_get_tx_buffer-no-idx-return.patch
   >         && patch -p0 -d ${CMAKE_CURRENT_LIST_DIR} <
   >         ${CMAKE_CURRENT_LIST_DIR}/0012-rpmsg-add-new-API-rpdev_release_tx-rx_buffer.patch
   >         && patch -p0 -d ${CMAKE_CURRENT_LIST_DIR} <
   >         ${CMAKE_CURRENT_LIST_DIR}/0013-openamp-add-error-log-when-ept-cb-return-error.patch
   >         && patch -p0 -d ${CMAKE_CURRENT_LIST_DIR} <
   >         ${CMAKE_CURRENT_LIST_DIR}/0014-rpmsg-add-cache-flash-when-hold-rx-buffer.patch
   >         && patch -p0 -d ${CMAKE_CURRENT_LIST_DIR} <
   >         ${CMAKE_CURRENT_LIST_DIR}/0015-rpmsg-do-cache_invalidate-when-real-data-returned.patch
   >         && patch -p0 -d ${CMAKE_CURRENT_LIST_DIR} <
   >         ${CMAKE_CURRENT_LIST_DIR}/0016-openamp-add-new-API-rpmsg_virtio_get_rxbuffer_size.patch
   >         && patch -p0 -d ${CMAKE_CURRENT_LIST_DIR} <
   >         ${CMAKE_CURRENT_LIST_DIR}/0017-virtio-follow-virtio-1.2-spec-add-more-virtio-status.patch
   >         && patch -p0 -d ${CMAKE_CURRENT_LIST_DIR} <
   >         ${CMAKE_CURRENT_LIST_DIR}/0018-virtio-decoupling-the-transport-layer-and-virtio-dev.patch
   >         && patch -p0 -d ${CMAKE_CURRENT_LIST_DIR} <
   >         ${CMAKE_CURRENT_LIST_DIR}/0019-virtio.h-add-version-in-device-id-table.patch
   >     DOWNLOAD_NO_PROGRESS true
   >     TIMEOUT 30)
   > ```
   
   hi @raiden00pl , I think now this problem is caused by two reasons:
   
   - duplicate download
   the code is to check whether the `.git` in the open-amp directory exists, apparently this caused it to be downloaded and decompressed twice in two compilations.
   
   - wrong patch target location
   I think the original intention of `patch target` is to mark that openAmp has been patched. This should only be **executed once**, but it is **marked on the outer directory**. this caused the patch to not be applied again during the second download.
   
   I think we should deal with these two issues separately. for the second issue, I think using `PATCH_COMMAND ` is a better way. what do you think? @raiden00pl @anchao 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org