[OpenWrt-Devel] [PATCH] libnl-tiny: move source code into separate Git repository

Hauke Mehrtens hauke at hauke-m.de
Mon Oct 7 15:23:38 EDT 2019


On 10/7/19 4:28 PM, Petr Štetiar wrote:
> In order to make the source code usable and testable separately out of
> buildroot.
> 
> Signed-off-by: Petr Štetiar <ynezz at true.cz>

Acked-by: Hauke Mehrtens <hauke at hauke-m.de>

I Like this especially as this is pretty big.

> ---
> 
> tl;dr this is just a first step, having more in the pipeline[0]
> 
> I'm working on a proof-of-concept CI suite[1] based on GitLab (but it could be
> used on anything which supports Docker) and which could be hopefully re-used
> for CI testing of all OpenWrt C language based projects without much hassle,
> currently it boils down to about 3-7 lines of YAML code in .gitlab-ci.yml
> file[2].
> 
> So far I've added two CI compile tests[3], one of them is `ci-sdk-oot-build`
> which is building the source code out of the tree[4] with the provided SDK for
> a (randomly selected) list of platforms ath79, imx6, malta_be and
> mvebu_cortexa53 in order to cover different CPUs, endianess, register widths
> etc. This tests works fine with the source code in the buildroot.
> 
> The 2nd test is a "frankenstein" one[5] called `ci-native-checks`, which is
> compile testing the source code natively on x86/64 with gcc-{7,8,9},clang-9
> and then with scan-build and cppcheck static analyzers. This doesn't work
> currently for me with odhcpd as it depends on libnl-tiny, and in order to
> provide libnl-tiny one would need to check out complete OpenWrt tree in order
> to get its source code and build it.
> 
> To be clear, getting the source code is a no brainer for me, I could solve it
> somehow even with the buildroot (putting aside the waste of resources), but
> running the CI test suite on libnl-tiny itself uncovers some issues[6] and I
> think, that it would simply make sense to allow running of those test easily
> for anyone (clone the repo on GitLab; push; profit) in the future as well.
> 
> 0. https://gitlab.com/ynezz/openwrt-libnl-tiny/commits/wip
> 1. https://gitlab.com/ynezz/gitlab-evaluation/blob/wip/gitlab-ci/README.md
> 2. https://gitlab.com/ynezz/openwrt-libnl-tiny/blob/wip/.gitlab-ci.yml
> 3. https://gitlab.com/ynezz/gitlab-evaluation/blob/wip/gitlab-ci/gitlab-ci-pipeline.yml
> 4. https://gitlab.com/ynezz/gitlab-evaluation/blob/wip/gitlab-ci/sdk-build.mk#L45
> 5. https://gitlab.com/ynezz/gitlab-evaluation/blob/wip/gitlab-ci/native-build.mk
> 6. https://ynezz.gitlab.io/-/openwrt-libnl-tiny/-/jobs/313680815/artifacts/build/scan/2019-10-07-122715-143-1/index.html
> 
>  package/libs/libnl-tiny/Makefile              |  19 +-
>  package/libs/libnl-tiny/files/libnl-tiny.pc   |  10 -
>  package/libs/libnl-tiny/src/Makefile          |  17 -
>  package/libs/libnl-tiny/src/attr.c            | 668 ----------------
>  package/libs/libnl-tiny/src/cache.c           | 376 ---------
>  package/libs/libnl-tiny/src/cache_mngt.c      | 131 ----
>  package/libs/libnl-tiny/src/error.c           | 116 ---
>  package/libs/libnl-tiny/src/genl.c            | 268 -------
>  package/libs/libnl-tiny/src/genl_ctrl.c       | 380 ---------
>  package/libs/libnl-tiny/src/genl_family.c     | 169 ----
>  package/libs/libnl-tiny/src/genl_mngt.c       | 193 -----
>  package/libs/libnl-tiny/src/handlers.c        | 162 ----
>  .../libnl-tiny/src/include/netlink-generic.h  |  20 -
>  .../libnl-tiny/src/include/netlink-local.h    | 160 ----
>  .../libnl-tiny/src/include/netlink-types.h    |  88 ---
>  .../libnl-tiny/src/include/netlink/addr.h     |  69 --
>  .../libnl-tiny/src/include/netlink/attr.h     | 726 ------------------
>  .../src/include/netlink/cache-api.h           | 199 -----
>  .../libnl-tiny/src/include/netlink/cache.h    | 128 ---
>  .../libnl-tiny/src/include/netlink/data.h     |  41 -
>  .../libnl-tiny/src/include/netlink/errno.h    |  64 --
>  .../src/include/netlink/genl/ctrl.h           |  40 -
>  .../src/include/netlink/genl/family.h         | 134 ----
>  .../src/include/netlink/genl/genl.h           |  47 --
>  .../src/include/netlink/genl/mngt.h           |  87 ---
>  .../libnl-tiny/src/include/netlink/handlers.h | 231 ------
>  .../libnl-tiny/src/include/netlink/list.h     |  88 ---
>  .../libs/libnl-tiny/src/include/netlink/msg.h | 308 --------
>  .../src/include/netlink/netlink-compat.h      |  50 --
>  .../src/include/netlink/netlink-kernel.h      | 196 -----
>  .../libnl-tiny/src/include/netlink/netlink.h  |  82 --
>  .../src/include/netlink/object-api.h          | 331 --------
>  .../libnl-tiny/src/include/netlink/object.h   | 164 ----
>  .../libnl-tiny/src/include/netlink/socket.h   | 231 ------
>  .../libnl-tiny/src/include/netlink/types.h    | 121 ---
>  .../libnl-tiny/src/include/netlink/utils.h    |  78 --
>  .../libnl-tiny/src/include/netlink/version.h  |  18 -
>  package/libs/libnl-tiny/src/include/unl.h     |  47 --
>  package/libs/libnl-tiny/src/msg.c             | 561 --------------
>  package/libs/libnl-tiny/src/nl.c              | 720 -----------------
>  package/libs/libnl-tiny/src/object.c          | 147 ----
>  package/libs/libnl-tiny/src/socket.c          | 406 ----------
>  package/libs/libnl-tiny/src/unl.c             | 287 -------
>  43 files changed, 12 insertions(+), 8366 deletions(-)
>  delete mode 100644 package/libs/libnl-tiny/files/libnl-tiny.pc
>  delete mode 100644 package/libs/libnl-tiny/src/Makefile
>  delete mode 100644 package/libs/libnl-tiny/src/attr.c
>  delete mode 100644 package/libs/libnl-tiny/src/cache.c
>  delete mode 100644 package/libs/libnl-tiny/src/cache_mngt.c
>  delete mode 100644 package/libs/libnl-tiny/src/error.c
>  delete mode 100644 package/libs/libnl-tiny/src/genl.c
>  delete mode 100644 package/libs/libnl-tiny/src/genl_ctrl.c
>  delete mode 100644 package/libs/libnl-tiny/src/genl_family.c
>  delete mode 100644 package/libs/libnl-tiny/src/genl_mngt.c
>  delete mode 100644 package/libs/libnl-tiny/src/handlers.c
>  delete mode 100644 package/libs/libnl-tiny/src/include/netlink-generic.h
>  delete mode 100644 package/libs/libnl-tiny/src/include/netlink-local.h
>  delete mode 100644 package/libs/libnl-tiny/src/include/netlink-types.h
>  delete mode 100644 package/libs/libnl-tiny/src/include/netlink/addr.h
>  delete mode 100644 package/libs/libnl-tiny/src/include/netlink/attr.h
>  delete mode 100644 package/libs/libnl-tiny/src/include/netlink/cache-api.h
>  delete mode 100644 package/libs/libnl-tiny/src/include/netlink/cache.h
>  delete mode 100644 package/libs/libnl-tiny/src/include/netlink/data.h
>  delete mode 100644 package/libs/libnl-tiny/src/include/netlink/errno.h
>  delete mode 100644 package/libs/libnl-tiny/src/include/netlink/genl/ctrl.h
>  delete mode 100644 package/libs/libnl-tiny/src/include/netlink/genl/family.h
>  delete mode 100644 package/libs/libnl-tiny/src/include/netlink/genl/genl.h
>  delete mode 100644 package/libs/libnl-tiny/src/include/netlink/genl/mngt.h
>  delete mode 100644 package/libs/libnl-tiny/src/include/netlink/handlers.h
>  delete mode 100644 package/libs/libnl-tiny/src/include/netlink/list.h
>  delete mode 100644 package/libs/libnl-tiny/src/include/netlink/msg.h
>  delete mode 100644 package/libs/libnl-tiny/src/include/netlink/netlink-compat.h
>  delete mode 100644 package/libs/libnl-tiny/src/include/netlink/netlink-kernel.h
>  delete mode 100644 package/libs/libnl-tiny/src/include/netlink/netlink.h
>  delete mode 100644 package/libs/libnl-tiny/src/include/netlink/object-api.h
>  delete mode 100644 package/libs/libnl-tiny/src/include/netlink/object.h
>  delete mode 100644 package/libs/libnl-tiny/src/include/netlink/socket.h
>  delete mode 100644 package/libs/libnl-tiny/src/include/netlink/types.h
>  delete mode 100644 package/libs/libnl-tiny/src/include/netlink/utils.h
>  delete mode 100644 package/libs/libnl-tiny/src/include/netlink/version.h
>  delete mode 100644 package/libs/libnl-tiny/src/include/unl.h
>  delete mode 100644 package/libs/libnl-tiny/src/msg.c
>  delete mode 100644 package/libs/libnl-tiny/src/nl.c
>  delete mode 100644 package/libs/libnl-tiny/src/object.c
>  delete mode 100644 package/libs/libnl-tiny/src/socket.c
>  delete mode 100644 package/libs/libnl-tiny/src/unl.c
> 
> diff --git a/package/libs/libnl-tiny/Makefile b/package/libs/libnl-tiny/Makefile
> index cabbb084218f..0536c6b73ec7 100644
> --- a/package/libs/libnl-tiny/Makefile
> +++ b/package/libs/libnl-tiny/Makefile
> @@ -8,8 +8,13 @@
>  include $(TOPDIR)/rules.mk
>  
>  PKG_NAME:=libnl-tiny
> -PKG_VERSION:=0.1
> -PKG_RELEASE:=5
> +PKG_RELEASE:=1
> +
> +PKG_SOURCE_PROTO:=git
> +PKG_SOURCE_URL=$(PROJECT_GIT)/project/libnl-tiny.git
> +PKG_SOURCE_DATE:=2017-11-16
> +PKG_SOURCE_VERSION:=8ee5f3a4023f822d1c916bb2b5e845d3597ac674
> +PKG_MIRROR_HASH:=e3dd137d69848b8cf2dbc58d70452586dd4178b55977896ea3a9dedaf62c768c
>  
>  PKG_LICENSE:=LGPL-2.1
>  PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>
> @@ -29,7 +34,7 @@ endef
>  TARGET_CFLAGS += $(FPIC)
>  
>  define Build/Compile
> -	$(MAKE) -C $(PKG_BUILD_DIR) \
> +	$(MAKE) -C $(PKG_BUILD_DIR)/src \
>  		$(TARGET_CONFIGURE_OPTS) \
>  		CFLAGS="$(TARGET_CFLAGS)" \
>  		all
> @@ -37,14 +42,14 @@ endef
>  
>  define Build/InstallDev
>  	$(INSTALL_DIR) $(1)/usr/lib/pkgconfig $(1)/usr/include/libnl-tiny
> -	$(CP) $(PKG_BUILD_DIR)/include/* $(1)/usr/include/libnl-tiny
> -	$(CP) $(PKG_BUILD_DIR)/libnl-tiny.so $(1)/usr/lib/
> -	$(CP) ./files/libnl-tiny.pc $(1)/usr/lib/pkgconfig
> +	$(CP) $(PKG_BUILD_DIR)/src/include/* $(1)/usr/include/libnl-tiny
> +	$(CP) $(PKG_BUILD_DIR)/src/libnl-tiny.so $(1)/usr/lib/
> +	$(CP) $(PKG_BUILD_DIR)/files/libnl-tiny.pc $(1)/usr/lib/pkgconfig
>  endef
>  
>  define Package/libnl-tiny/install
>  	$(INSTALL_DIR) $(1)/usr/lib
> -	$(CP) $(PKG_BUILD_DIR)/libnl-tiny.so $(1)/usr/lib/
> +	$(CP) $(PKG_BUILD_DIR)/src/libnl-tiny.so $(1)/usr/lib/
>  endef
>  

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20191007/18361a7a/attachment.sig>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list