From patchwork Wed Feb 6 13:23:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 1037531 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="XCR0fJTq"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43vj453Dthz9sMl for ; Thu, 7 Feb 2019 00:30:13 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id AAD1985D6F; Wed, 6 Feb 2019 13:30:10 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nCkYeaNgXgRT; Wed, 6 Feb 2019 13:30:07 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 63E3C85E93; Wed, 6 Feb 2019 13:30:07 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id E29651BF398 for ; Wed, 6 Feb 2019 13:30:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id DFF81877F3 for ; Wed, 6 Feb 2019 13:30:06 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LG9rnfiui23Z for ; Wed, 6 Feb 2019 13:30:05 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ed1-f67.google.com (mail-ed1-f67.google.com [209.85.208.67]) by whitealder.osuosl.org (Postfix) with ESMTPS id 5826887391 for ; Wed, 6 Feb 2019 13:30:05 +0000 (UTC) Received: by mail-ed1-f67.google.com with SMTP id d12so4838903edy.3 for ; Wed, 06 Feb 2019 05:30:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GctmheVyQTeBFwpFnKeNbx30ZfbDWAumH54W7xrwPUw=; b=XCR0fJTq8I508h4llW1sOs3WA0BSHOQCcBDSZbzrUKAkjpUCTP+Yim2GJ7LJP4ub3V TbiRHey/WzyWdyRxpvPQ24BIVEpvo7N8W420s3KMn61hnwP13pQqTwurBylQkABVrnkU hYpz8sROa2otE7n1ul6jmaX80XnE5jbc5gbbI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=GctmheVyQTeBFwpFnKeNbx30ZfbDWAumH54W7xrwPUw=; b=CcL/HRAjtM6RK/J9Ut1T/RWeLRsEABdjdHNe4f+chmICRADNM5z+TbYX3WxkHc14gy ySFyCJNNpmn2OM5EMBROiSaRmAuaKgqGxZmfMezgye/SfulOOnad2n+ZC0NJKjpk2Vha vZrEUtl7dFr/W6lOBME1gGvP1pg9xU22j4XelcP9dT+bK2p+FRizWuAovyeXtDFHOrG2 IMerzEJByJv5n/A4I0wwQwyxdg/4Ad1GzKNsi5aBpE+CKlNUEr0LZJXDGwm78FeWB6Dz uotCyL3wXBn2C9jm4Mb2GuowICTdsX2J6WXcj6BhKdOItTGi7+FpJ3Z7+1QfCrTSvImm Kfrg== X-Gm-Message-State: AHQUAuZi4N292VRfLb6rjVEWA5p2sL/qmpuaW7WkW8zlHwaVDHuEoJtl 73QkaAtbqEnfMwBeUU0Y07vXJJTgLrKMbQ== X-Google-Smtp-Source: AHgI3IZX/Rdml4F5doPbj95qW3X0Ci1JD6KUWMKxwlqgh2TnuPAQJfgUJAXuaM04b9dKPRCnts6dxw== X-Received: by 2002:a50:b32f:: with SMTP id q44mr8290586edd.70.1549459449541; Wed, 06 Feb 2019 05:24:09 -0800 (PST) Received: from angelo-ThinkPad-T470p.t-mobile.de ([88.128.80.15]) by smtp.gmail.com with ESMTPSA id p7sm3626174ejb.15.2019.02.06.05.24.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Feb 2019 05:24:08 -0800 (PST) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Wed, 6 Feb 2019 14:23:57 +0100 Message-Id: <1549459439-2260-2-git-send-email-angelo@amarulasolutions.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1549459439-2260-1-git-send-email-angelo@amarulasolutions.com> References: <1549459439-2260-1-git-send-email-angelo@amarulasolutions.com> Subject: [Buildroot] [PATCH v3 1/3] package/go: refactor host/target dependencies X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Angelo Compagnucci MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" In order to better handling the host/target dependencies of packages, we need to add the new configuration option BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS. All golang target packages should depends on this options. Host packages needs to depend instead on BR2_PACKAGE_HOST_GO_HOST_ARCH_SUPPORTS. Signed-off-by: Angelo Compagnucci Tested-by: Adam Duskett --- docs/manual/adding-packages-golang.txt | 8 +++++--- package/docker-cli/Config.in | 8 ++++---- package/docker-containerd/Config.in | 8 ++++---- package/docker-engine/Config.in | 8 ++++---- package/docker-proxy/Config.in | 8 ++++---- package/flannel/Config.in | 8 ++++---- package/go/Config.in.host | 7 ++++--- package/mender/Config.in | 8 ++++---- package/runc/Config.in | 8 ++++---- 9 files changed, 37 insertions(+), 34 deletions(-) diff --git a/docs/manual/adding-packages-golang.txt b/docs/manual/adding-packages-golang.txt index efcf696..1b46778 100644 --- a/docs/manual/adding-packages-golang.txt +++ b/docs/manual/adding-packages-golang.txt @@ -45,9 +45,11 @@ built. ==== +golang-package+ reference In their +Config.in+ file, packages using the +golang-package+ -infrastructure should depend on +BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS+ -and +BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS+ because Buildroot will -automatically add a dependency on +host-go+ to such packages. +infrastructure should depend on +BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS+ +because Buildroot will automatically add a dependency on +host-go+ +to such packages. +If you need CGO support in your package, you can add a dependency on ++BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS+. The main macro of the Go package infrastructure is +golang-package+. It is similar to the +generic-package+ macro. Only diff --git a/package/docker-cli/Config.in b/package/docker-cli/Config.in index 82c35c4..6f187c9 100644 --- a/package/docker-cli/Config.in +++ b/package/docker-cli/Config.in @@ -1,7 +1,7 @@ config BR2_PACKAGE_DOCKER_CLI bool "docker-cli" - depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS - depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS + depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS + depends on BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS depends on BR2_TOOLCHAIN_HAS_THREADS help Docker is a platform to build, ship, @@ -20,6 +20,6 @@ config BR2_PACKAGE_DOCKER_CLI_STATIC endif comment "docker-cli needs a toolchain w/ threads" - depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS - depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS + depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS + depends on BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS depends on !BR2_TOOLCHAIN_HAS_THREADS diff --git a/package/docker-containerd/Config.in b/package/docker-containerd/Config.in index 851345f..5c0897d 100644 --- a/package/docker-containerd/Config.in +++ b/package/docker-containerd/Config.in @@ -1,7 +1,7 @@ config BR2_PACKAGE_DOCKER_CONTAINERD bool "docker-containerd" - depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS - depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS + depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS + depends on BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS depends on BR2_TOOLCHAIN_HAS_THREADS depends on BR2_USE_MMU # util-linux select BR2_PACKAGE_RUNC # runtime dependency @@ -28,7 +28,7 @@ config BR2_PACKAGE_DOCKER_CONTAINERD_DRIVER_BTRFS endif comment "docker-containerd needs a toolchain w/ threads" - depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS - depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS + depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS + depends on BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS depends on BR2_USE_MMU depends on !BR2_TOOLCHAIN_HAS_THREADS diff --git a/package/docker-engine/Config.in b/package/docker-engine/Config.in index 2a0c130..6780769 100644 --- a/package/docker-engine/Config.in +++ b/package/docker-engine/Config.in @@ -1,7 +1,7 @@ config BR2_PACKAGE_DOCKER_ENGINE bool "docker-engine" - depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS - depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS + depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS + depends on BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS depends on BR2_TOOLCHAIN_HAS_THREADS depends on BR2_USE_MMU # docker-containerd select BR2_PACKAGE_DOCKER_CONTAINERD # runtime dependency @@ -50,7 +50,7 @@ config BR2_PACKAGE_DOCKER_ENGINE_DRIVER_VFS endif comment "docker-engine needs a toolchain w/ threads" - depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS - depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS + depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS + depends on BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS depends on !BR2_TOOLCHAIN_HAS_THREADS depends on BR2_USE_MMU diff --git a/package/docker-proxy/Config.in b/package/docker-proxy/Config.in index 596e18a..7e40536 100644 --- a/package/docker-proxy/Config.in +++ b/package/docker-proxy/Config.in @@ -1,7 +1,7 @@ config BR2_PACKAGE_DOCKER_PROXY bool "docker-proxy" - depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS - depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS + depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS + depends on BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS depends on BR2_TOOLCHAIN_HAS_THREADS help Libnetwork is a Container Network Model that provides a @@ -14,6 +14,6 @@ config BR2_PACKAGE_DOCKER_PROXY https://github.com/docker/libnetwork comment "docker-proxy needs a toolchain w/ threads" - depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS - depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS + depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS + depends on BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS depends on !BR2_TOOLCHAIN_HAS_THREADS diff --git a/package/flannel/Config.in b/package/flannel/Config.in index 134111b..3263610 100644 --- a/package/flannel/Config.in +++ b/package/flannel/Config.in @@ -1,12 +1,12 @@ comment "flannel needs a toolchain w/ threads" - depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS && \ - BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS + depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS + depends on BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS depends on !BR2_TOOLCHAIN_HAS_THREADS config BR2_PACKAGE_FLANNEL bool "flannel" - depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS - depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS + depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS + depends on BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS depends on BR2_TOOLCHAIN_HAS_THREADS help Flannel is a virtual network that gives a subnet to each diff --git a/package/go/Config.in.host b/package/go/Config.in.host index f619ca0..893a448 100644 --- a/package/go/Config.in.host +++ b/package/go/Config.in.host @@ -1,4 +1,5 @@ -config BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS +# Target go packages should depend on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS +config BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS bool default y depends on !BR2_TOOLCHAIN_HAS_BINUTILS_BUG_20006 @@ -10,10 +11,10 @@ config BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS # MIPS R6 support in Go has not yet been developed. depends on !BR2_MIPS_CPU_MIPS64R6 -config BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS +config BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS bool default y - depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS + depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS # Go doesn't support CGO linking on MIPS64x platforms # See: https://github.com/karalabe/xgo/issues/46 depends on !BR2_mips64 && !BR2_mips64el diff --git a/package/mender/Config.in b/package/mender/Config.in index aeb0b26..5ab2304 100644 --- a/package/mender/Config.in +++ b/package/mender/Config.in @@ -1,7 +1,7 @@ config BR2_PACKAGE_MENDER bool "mender" - depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS - depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS + depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS + depends on BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS depends on BR2_TOOLCHAIN_HAS_THREADS select BR2_PACKAGE_UBOOT_TOOLS # runtime select BR2_PACKAGE_UBOOT_TOOLS_FWPRINTENV # runtime @@ -14,6 +14,6 @@ config BR2_PACKAGE_MENDER https://github.com/mendersoftware/mender comment "mender needs a toolchain w/ threads" - depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS - depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS + depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS + depends on BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS depends on !BR2_TOOLCHAIN_HAS_THREADS diff --git a/package/runc/Config.in b/package/runc/Config.in index fd5dee7..9e06d2b 100644 --- a/package/runc/Config.in +++ b/package/runc/Config.in @@ -1,7 +1,7 @@ config BR2_PACKAGE_RUNC bool "runc" - depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS - depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS + depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS + depends on BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS depends on BR2_TOOLCHAIN_HAS_THREADS help runC is a CLI tool for spawning and running containers @@ -10,6 +10,6 @@ config BR2_PACKAGE_RUNC https://github.com/opencontainers/runc comment "runc needs a toolchain w/ threads" - depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS && \ - BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS + depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS + depends on BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS depends on !BR2_TOOLCHAIN_HAS_THREADS From patchwork Wed Feb 6 13:23:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 1037533 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="fzIc54aG"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43vj4x6lf1z9sML for ; Thu, 7 Feb 2019 00:30:57 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 2AA38312FD; Wed, 6 Feb 2019 13:30:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id l8FIPM-HDlKV; Wed, 6 Feb 2019 13:30:54 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id AD73A22005; Wed, 6 Feb 2019 13:30:54 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id EA2341BF868 for ; Wed, 6 Feb 2019 13:30:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id E7B2121F68 for ; Wed, 6 Feb 2019 13:30:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id g9t1YD-ALfSa for ; Wed, 6 Feb 2019 13:30:53 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ed1-f68.google.com (mail-ed1-f68.google.com [209.85.208.68]) by silver.osuosl.org (Postfix) with ESMTPS id E987422668 for ; Wed, 6 Feb 2019 13:30:52 +0000 (UTC) Received: by mail-ed1-f68.google.com with SMTP id r15so4411827eds.9 for ; Wed, 06 Feb 2019 05:30:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=yjQoisZZPzWZ5FbKK5YjwfnEQNe7TkiIoaw9RxKMTwQ=; b=fzIc54aGoPQX+FLPiYrTj9PNKNp94ZJDQ3piX5Xz9CSG4TNrjk1Z/hrk7Mk+RK1O3P vJ8A23I9OfvHVqp5GfjQ7djY4c1iny7W6fLMckYUq4wemC8jxAY+O5UvDDSo/Ejm71ei 2qYN+1wxn7wz3UTSScthWUvYy/aQqh5dAMNvo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=yjQoisZZPzWZ5FbKK5YjwfnEQNe7TkiIoaw9RxKMTwQ=; b=bWrH/+1zqa4p2iKrPZtCxAA5hvlLdG6h283p2yAxhWrx4fqLiSQ2j88Yk/kgt8lwbi Br0WPYXkuEgpu+M66QLdXSvpD7ZKIH4d+tBkhwIgZvMv0Q5pnh74rdkAP0n7c3HF5VnS 22XXf+WsHk97cFV9snifQT5ZThF4hK+ISm8pWklPLQHvKf8Kz7PbVnjxc4Opyr22rzWl GSSacbMT57xmv0z/GotNRfhEJO+vqJXdIYLQG3fofLB1z85s15qZudW2F+gmumDmLPFH j6XWwcscMV0tglaWr3seNxqWmrehaGmLVWIGOV8Kw9VbjjDILSuOqvbGWuLenixFrQ/L l8ZQ== X-Gm-Message-State: AHQUAuawtgOQQYuH6hfuH5bbBxDnOkHR3iMgedWi5a+lLba0wd61HWkv TEdKooWlxrECpSr8vsF0KfVrGtHfNkjYyQ== X-Google-Smtp-Source: AHgI3IZVeDqvN7Q1xfFX418TuyJhJMWguivpzbSDkMejpyc983n3AwjaeGMW9Ad3mUwkvdR4gZuKhw== X-Received: by 2002:a50:ba5c:: with SMTP id 28mr8119239eds.91.1549459451215; Wed, 06 Feb 2019 05:24:11 -0800 (PST) Received: from angelo-ThinkPad-T470p.t-mobile.de ([88.128.80.15]) by smtp.gmail.com with ESMTPSA id p7sm3626174ejb.15.2019.02.06.05.24.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Feb 2019 05:24:09 -0800 (PST) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Wed, 6 Feb 2019 14:23:58 +0100 Message-Id: <1549459439-2260-3-git-send-email-angelo@amarulasolutions.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1549459439-2260-1-git-send-email-angelo@amarulasolutions.com> References: <1549459439-2260-1-git-send-email-angelo@amarulasolutions.com> Subject: [Buildroot] [PATCH v3 2/3] package/pkg-golang: add support for building host packages X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mirza Krak , Angelo Compagnucci MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Mirza Krak With this you can add: $(eval $(host-golang-package)) to a package .mk file to build for host. Signed-off-by: Mirza Krak Acked-by: Angelo Compagnucci Tested-by: Angelo Compagnucci Signed-off-by: Angelo Compagnucci Tested-by: Adam Duskett --- docs/manual/adding-packages-golang.txt | 7 +++++-- package/go/Config.in.host | 6 ++++++ package/pkg-golang.mk | 37 +++++++++++++++++++++++++++++++--- 3 files changed, 45 insertions(+), 5 deletions(-) diff --git a/docs/manual/adding-packages-golang.txt b/docs/manual/adding-packages-golang.txt index 1b46778..f6aed39 100644 --- a/docs/manual/adding-packages-golang.txt +++ b/docs/manual/adding-packages-golang.txt @@ -52,8 +52,11 @@ If you need CGO support in your package, you can add a dependency on +BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS+. The main macro of the Go package infrastructure is -+golang-package+. It is similar to the +generic-package+ macro. Only -target packages are supported with +golang-package+. ++golang-package+. It is similar to the +generic-package+ macro. The +ability to build host packages is also available, with the ++host-golang-package+ macro. +Host packages built by +host-golang-package+ macro should depend on +BR2_PACKAGE_HOST_GO_HOST_ARCH_SUPPORTS. Just like the generic infrastructure, the Go infrastructure works by defining a number of variables before calling the +golang-package+. diff --git a/package/go/Config.in.host b/package/go/Config.in.host index 893a448..3f16dba 100644 --- a/package/go/Config.in.host +++ b/package/go/Config.in.host @@ -18,3 +18,9 @@ config BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS # Go doesn't support CGO linking on MIPS64x platforms # See: https://github.com/karalabe/xgo/issues/46 depends on !BR2_mips64 && !BR2_mips64el + +# Host go packages should depend on BR2_PACKAGE_HOST_GO_HOST_ARCH_SUPPORTS +config BR2_PACKAGE_HOST_GO_HOST_ARCH_SUPPORTS + bool + default y + depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_ARCH_SUPPORTS diff --git a/package/pkg-golang.mk b/package/pkg-golang.mk index 4f2c7e7..b4e8a53 100644 --- a/package/pkg-golang.mk +++ b/package/pkg-golang.mk @@ -25,12 +25,18 @@ GO_BIN = $(HOST_DIR)/bin/go # We pass an empty GOBIN, otherwise "go install: cannot install # cross-compiled binaries when GOBIN is set" -GO_TARGET_ENV = \ - $(HOST_GO_TARGET_ENV) \ +GO_COMMON_ENV = \ PATH=$(BR_PATH) \ GOBIN= \ CGO_ENABLED=$(HOST_GO_CGO_ENABLED) +GO_TARGET_ENV = \ + $(HOST_GO_TARGET_ENV) \ + $(GO_COMMON_ENV) + +GO_HOST_ENV = \ + $(GO_COMMON_ENV) + ################################################################################ # inner-golang-package -- defines how the configuration, compilation and # installation of a Go package should be done, implements a few hooks to tune @@ -44,7 +50,6 @@ GO_TARGET_ENV = \ # packages # argument 4 is the type (target or host) # -# NOTE Only type target is supported at the moment ################################################################################ define inner-golang-package @@ -98,6 +103,8 @@ endif # Build step. Only define it if not already defined by the package .mk # file. ifndef $(2)_BUILD_CMDS +ifeq ($(4),target) +# Build package for target define $(2)_BUILD_CMDS $$(foreach d,$$($(2)_BUILD_TARGETS),\ cd $$($(2)_SRC_PATH); \ @@ -109,6 +116,20 @@ define $(2)_BUILD_CMDS ./$$(d) ) endef +else +# Build package for host +define $(2)_BUILD_CMDS + $$(foreach d,$$($(2)_BUILD_TARGETS),\ + cd $$($(2)_SRC_PATH); \ + $$(GO_HOST_ENV) \ + GOPATH="$$(@D)/$$($(2)_WORKSPACE)" \ + $$($(2)_GO_ENV) \ + $$(GO_BIN) build -v $$($(2)_BUILD_OPTS) \ + -o $$(@D)/bin/$$(or $$($(2)_BIN_NAME),$$(notdir $$(d))) \ + ./$$(d) + ) +endef +endif endif # Target installation step. Only define it if not already defined by the @@ -121,6 +142,15 @@ define $(2)_INSTALL_TARGET_CMDS endef endif +# Host installation step +ifndef $(2)_INSTALL_CMDS +define $(2)_INSTALL_CMDS + $$(foreach d,$$($(2)_INSTALL_BINS),\ + $(INSTALL) -D -m 0755 $$(@D)/bin/$$(d) $(HOST_DIR)/bin/$$(d) + ) +endef +endif + # Call the generic package infrastructure to generate the necessary make # targets $(call inner-generic-package,$(1),$(2),$(3),$(4)) @@ -132,3 +162,4 @@ endef # inner-golang-package ################################################################################ golang-package = $(call inner-golang-package,$(pkgname),$(call UPPERCASE,$(pkgname)),$(call UPPERCASE,$(pkgname)),target) +host-golang-package = $(call inner-golang-package,host-$(pkgname),$(call UPPERCASE,host-$(pkgname)),$(call UPPERCASE,$(pkgname)),host) From patchwork Wed Feb 6 13:23:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 1037532 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="SxhMaSvs"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43vj4h1plmz9sML for ; Thu, 7 Feb 2019 00:30:44 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id BE8BD8685D; Wed, 6 Feb 2019 13:30:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ybkTfm82-5lu; Wed, 6 Feb 2019 13:30:41 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 3FEF386E1F; Wed, 6 Feb 2019 13:30:41 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id AECF41BF868 for ; Wed, 6 Feb 2019 13:30:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id A98DE22849 for ; Wed, 6 Feb 2019 13:30:39 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KmTFqz8lL9DC for ; Wed, 6 Feb 2019 13:30:38 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ed1-f66.google.com (mail-ed1-f66.google.com [209.85.208.66]) by silver.osuosl.org (Postfix) with ESMTPS id C2BFE22668 for ; Wed, 6 Feb 2019 13:30:37 +0000 (UTC) Received: by mail-ed1-f66.google.com with SMTP id y56so5844100edd.11 for ; Wed, 06 Feb 2019 05:30:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=iTbj6pZi9WHpaCsccAAgm8XZm+PNvmo7zNV8QTHUJco=; b=SxhMaSvsC/KzpcJS+jEz2ImO2IpeYVAiEcyRuzdf89NwR0pinqHKOI4p9OmT0ob0tQ 1B5l6ru1gLA7SQrv6/JW6Md2eaChtHABWoD7c5KrnO1TWzcMvkch4m0D7k5/3yc0xJ9M gda52Cnp3phn/XVcXl/jx2ulYtPMrWO4AHw3M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=iTbj6pZi9WHpaCsccAAgm8XZm+PNvmo7zNV8QTHUJco=; b=HZahPPsVs5nIS6437r6O6ine+IrwxqxGjFdeCGWBBohWoZFe1P3BMwSe0Su4V/bCar WK1TQFlRbCxvGf4CWpPmP2A6W8+tWcmMVfx22XLNdZT9M0AWSVGak6DpT9JC3edNaDAL GJYn6jeZONbLC77m0/19qDvRU4e5J02dnHTxRPkj9WBGwh7t3N6HeIbMWHakYEcTSCue rJV+e1dEu2qOO0z9ypBKa24Yhz+8U7Tvz2rtHvF0a30pGzwH3/frIhJzVOlr2hABaLs7 cdHHD/5y26/aViTfOJb5Yg6FyBCz4qlWi2ic1Mi9CsEoHAIato4FgBmCnaNTI0k/Aq/T NGQA== X-Gm-Message-State: AHQUAuZ+lKp8Ck31VLO8WZA1SI7cXmIPpdPmmTd/bPMDVXODp/V8xKsS YMgCAmFUO8zox4lb5WCHs4v68zSKIebGyQ== X-Google-Smtp-Source: AHgI3IbkCM2g079C4FiR/Mbas0rbuxJlnTFe4Du97qRpxKKJvZf0c7L16BLvwzd6+pjsKvcpdvbLqg== X-Received: by 2002:a50:87a7:: with SMTP id a36mr8331788eda.96.1549459452978; Wed, 06 Feb 2019 05:24:12 -0800 (PST) Received: from angelo-ThinkPad-T470p.t-mobile.de ([88.128.80.15]) by smtp.gmail.com with ESMTPSA id p7sm3626174ejb.15.2019.02.06.05.24.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Feb 2019 05:24:11 -0800 (PST) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Wed, 6 Feb 2019 14:23:59 +0100 Message-Id: <1549459439-2260-4-git-send-email-angelo@amarulasolutions.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1549459439-2260-1-git-send-email-angelo@amarulasolutions.com> References: <1549459439-2260-1-git-send-email-angelo@amarulasolutions.com> Subject: [Buildroot] [PATCH v3 3/3] package/mender-artifact: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Angelo Compagnucci MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" mender-artifact is a host tool to generate update images in the Mender artifact file format. This package uses the binary archive from github because it bundles the external dependencies. Example usage: $ mender-artifact write rootfs-image \ --update rootfs.ext4 \ --output-path rootfs.mender \ --artifact-name "release-v1.0.0" \ --device-type "beaglebone" Above will generate a Mender artifact called "rootfs.mender" containing the "rootfs.ext4" image along with meta-data. One can read-out the meta-data with the following command: $ mender-artifact read rootfs.mender Mender artifact: Name: release-v1.0.0 Format: mender Version: 2 Signature: no signature Compatible devices: '[beaglebone]' Updates: 0000: Type: rootfs-image Files: name: rootfs.ext4 size: 52428800 modified: 2018-08-27 09:10:55 +0200 CEST checksum: e70b113fb0964a810a3043586eb4fc1c48e684ba78b02ba65fead4aa3e540d87 Signed-off-by: Angelo Compagnucci Tested-by: Adam Duskett --- DEVELOPERS | 1 + package/Config.in.host | 1 + package/mender-artifact/Config.in.host | 18 ++++++++++++++++ package/mender-artifact/mender-artifact.hash | 28 ++++++++++++++++++++++++ package/mender-artifact/mender-artifact.mk | 32 ++++++++++++++++++++++++++++ 5 files changed, 80 insertions(+) create mode 100644 package/mender-artifact/Config.in.host create mode 100644 package/mender-artifact/mender-artifact.hash create mode 100644 package/mender-artifact/mender-artifact.mk diff --git a/DEVELOPERS b/DEVELOPERS index 59e1f32..7a3147d 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -152,6 +152,7 @@ F: package/corkscrew/ F: package/fail2ban/ F: package/i2c-tools/ F: package/mender/ +F: package/mender-artifact/ F: package/mono/ F: package/mono-gtksharp3/ F: package/monolite/ diff --git a/package/Config.in.host b/package/Config.in.host index 3b75f23..9916114 100644 --- a/package/Config.in.host +++ b/package/Config.in.host @@ -33,6 +33,7 @@ menu "Host utilities" source "package/jsmin/Config.in.host" source "package/lpc3250loader/Config.in.host" source "package/lttng-babeltrace/Config.in.host" + source "package/mender-artifact/Config.in.host" source "package/mfgtools/Config.in.host" source "package/mkpasswd/Config.in.host" source "package/mtd/Config.in.host" diff --git a/package/mender-artifact/Config.in.host b/package/mender-artifact/Config.in.host new file mode 100644 index 0000000..c7be0ed --- /dev/null +++ b/package/mender-artifact/Config.in.host @@ -0,0 +1,18 @@ +config BR2_PACKAGE_HOST_MENDER_ARTIFACT + bool "host mender-artifact" + depends on BR2_PACKAGE_HOST_GO_HOST_ARCH_SUPPORTS + help + The mender-artifact tool is a CLI implementation of the + Mender artifacts library. + + A Mender artifact can be recognized by its .mender suffix. + Mender artifacts can contain binaries, metadata, checksums, + signatures and scripts that are used during a deployment. + The artifact format acts as a wrapper, and uses the tar + format to bundle several files into one. + + In its simplest form, an artifact contains just a rootfs + image, along with its checksum, id and device type + compatibility. + + https://github.com/mendersoftware/mender-artifact diff --git a/package/mender-artifact/mender-artifact.hash b/package/mender-artifact/mender-artifact.hash new file mode 100644 index 0000000..d44244d --- /dev/null +++ b/package/mender-artifact/mender-artifact.hash @@ -0,0 +1,28 @@ +# Locally computed: +sha256 fde448af4811600a130b243d59e21b1f9cdd60fd991bd418246c913ebf945206 2.4.0.tar.gz + +# License hash extracted from LIC_FILES_CHKSUM.sha256 using the +# following command: +# +# sed '/^[A-Za-z0-9_]/s/^/sha256 /' LIC_FILES_CHKSUM.sha256 + +# Apache 2.0 licenses. +sha256 98ed35b5a138f58164b5c0dbccd9d7f01ef4d84b9dba01e896f0a3241c50c0f7 LICENSE +sha256 ceb1b36ff073bd13d9806d4615b931707768ca9023805620acc32dd1cfc2f680 vendor/github.com/mendersoftware/mendertesting/LICENSE +# +# BSD 2 Clause licenses. +sha256 8d427fd87bc9579ea368fde3d49f9ca22eac857f91a9dec7e3004bdfab7dee86 vendor/github.com/pkg/errors/LICENSE +# +# BSD 3 Clause licenses. +sha256 2eb550be6801c1ea434feba53bf6d12e7c71c90253e0a9de4a4f46cf88b56477 vendor/github.com/pmezard/go-difflib/LICENSE +sha256 2d36597f7117c38b006835ae7f537487207d8ec407aa9d9980794b2030cbc067 vendor/golang.org/x/sys/LICENSE +sha256 2d36597f7117c38b006835ae7f537487207d8ec407aa9d9980794b2030cbc067 vendor/golang.org/x/crypto/LICENSE +# +# ISC licenses. +sha256 3525392c6db3b804af76980b2c560ee9ec1abdadd907d76a26091df7c78f3a25 vendor/github.com/davecgh/go-spew/LICENSE +# +# MIT licenses. +sha256 402f39eed8a1851385d0703999aa9f23d067c2ea3e15c63c074e389cbf8f8f8f vendor/github.com/stretchr/testify/LICENSE +sha256 402f39eed8a1851385d0703999aa9f23d067c2ea3e15c63c074e389cbf8f8f8f vendor/github.com/stretchr/testify/LICENSE +sha256 da277af11b85227490377fbcac6afccc68be560c4fff36ac05ca62de55345fd7 vendor/github.com/urfave/cli/LICENSE +sha256 51a0c9ec7f8b7634181b8d4c03e5b5d204ac21d6e72f46c313973424664b2e6b vendor/github.com/sirupsen/logrus/LICENSE diff --git a/package/mender-artifact/mender-artifact.mk b/package/mender-artifact/mender-artifact.mk new file mode 100644 index 0000000..90d0071 --- /dev/null +++ b/package/mender-artifact/mender-artifact.mk @@ -0,0 +1,32 @@ +################################################################################ +# +# host-mender-artifact +# +################################################################################ + +HOST_MENDER_ARTIFACT_VERSION = 2.4.0 +HOST_MENDER_ARTIFACT_SITE = https://github.com/mendersoftware/mender-artifact/archive +HOST_MENDER_ARTIFACT_SOURCE = $(HOST_MENDER_ARTIFACT_VERSION).tar.gz +HOST_MENDER_ARTIFACT_LICENSE = Apache2.0, BSD-2-Clause, BSD-3-Clause, ISC, MIT +HOST_MENDER_ARTIFACT_LICENSE_FILES = \ + LICENSE \ + LIC_FILES_CHKSUM.sha256 \ + vendor/github.com/mendersoftware/mendertesting/LICENSE \ + vendor/github.com/pkg/errors/LICENSE \ + vendor/github.com/pmezard/go-difflib/LICENSE \ + vendor/golang.org/x/sys/LICENSE \ + vendor/golang.org/x/crypto/LICENSE \ + vendor/github.com/davecgh/go-spew/LICENSE \ + vendor/github.com/stretchr/testify/LICENSE \ + vendor/github.com/stretchr/testify/LICENSE \ + vendor/github.com/urfave/cli/LICENSE \ + vendor/github.com/sirupsen/logrus/LICENSE + +HOST_MENDER_ARTIFACT_LDFLAGS = -X main.Version=$(HOST_MENDER_ARTIFACT_VERSION) + +HOST_MENDER_ARTIFACT_BUILD_TARGETS = cli/mender-artifact + +HOST_MENDER_ARTIFACT_BIN_NAME = mender-artifact +HOST_MENDER_ARTIFACT_INSTALL_BINS = $(HOST_MENDER_ARTIFACT_BIN_NAME) + +$(eval $(host-golang-package))