From patchwork Mon Jan 28 23:22:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 1032309 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.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="sYn6JGCm"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43pQf56CJ0z9sN6 for ; Tue, 29 Jan 2019 10:22:53 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 59BB4876C3; Mon, 28 Jan 2019 23:22:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qYw8ykxv0WuC; Mon, 28 Jan 2019 23:22:47 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id B236787697; Mon, 28 Jan 2019 23:22:47 +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 1002F1BF2C8 for ; Mon, 28 Jan 2019 23:22:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 0C14186406 for ; Mon, 28 Jan 2019 23:22:45 +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 votN87PjNo+x for ; Mon, 28 Jan 2019 23:22:44 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-io1-f67.google.com (mail-io1-f67.google.com [209.85.166.67]) by whitealder.osuosl.org (Postfix) with ESMTPS id 4D36984540 for ; Mon, 28 Jan 2019 23:22:44 +0000 (UTC) Received: by mail-io1-f67.google.com with SMTP id r200so15010234iod.11 for ; Mon, 28 Jan 2019 15:22:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=K1Dl6BWVvwLg147KSJjh/dFla+WLbV2djrL80ctLA1I=; b=sYn6JGCm7VikSrpxk6NiY+GP/Jb5wu8wT7pXClDvgcspXS4pi4OdsRkvHWWiukG7ZL AA066iqUA0OBwo/+TtAiRkdphe2YKM8nNMK8unDupVnQz63nNQicx04axinAfYkTw2IO LsZppC8Mcar8FwK/ldWGBzB/lJwzAJA23Mu+eNNZGCZ+lHPYfoEuuzv4xQic1biprN4J 7B98gkI0pesyyd5yfE8L+tT7sHqVJB4suNeWLJyYmxA6aQaLGcc3iyW66UgFC9Yy9vjv BuT/Q361cE8t1unQR8kcHHxqM/p+/jEO3HEur/v0g7o9ubfQ44BJn81aEIlZTNW66O+w dXrg== 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:mime-version:content-transfer-encoding; bh=K1Dl6BWVvwLg147KSJjh/dFla+WLbV2djrL80ctLA1I=; b=QMYJF8e3muYZwiiAsOES51h0h4Id6xXZ9JscixG+/2PDKDaURceDlTBC31gzh90r9X NxeAeJ0WMW0COtSLFgmkNQBlJhdy4JC0u+5NWNnYGz8jtln92lHt+6V4smtBTil4kzfB Po/0Sw0EJNySrW4hx5/xZbv/DVG35tOWMKUwcTzLC0w1EU5nn/YH5wQ4TW/5rnotwEJi 1mih0zpXFwXykcsM9Zae/X/bccDE/7S4paA3zigs79PTwFSe7DJRu3OK6WKukf3VR2qD JfxiDcmROBL/OrMzQL9yqUWhgO/NgS+Xc423GRZYo72BkrR9pYqzoO/H6GSyaWctL758 FUcg== X-Gm-Message-State: AJcUukces8oc8dnAkzkoDE6g+UiuVxnz7xKfYi8LnX8nlTJuCYIOvDKa aTvyRmOwq4ltVU2Z6VKecfxl3az/ X-Google-Smtp-Source: AHgI3IZbhDicG2U8qg56iQIieI0XQdk56UKeDRuDuXES5KMYGf5/H878gCI2W5O6M3sfZgZJdCsDmQ== X-Received: by 2002:a6b:7113:: with SMTP id q19mr14231528iog.9.1548717763308; Mon, 28 Jan 2019 15:22:43 -0800 (PST) Received: from localhost.localdomain (68-188-149-81.dhcp.aldl.mi.charter.com. [68.188.149.81]) by smtp.gmail.com with ESMTPSA id r195sm492325ita.3.2019.01.28.15.22.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 28 Jan 2019 15:22:42 -0800 (PST) From: aduskett@gmail.com To: buildroot@buildroot.org Date: Mon, 28 Jan 2019 18:22:05 -0500 Message-Id: <20190128232209.17485-2-aduskett@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190128232209.17485-1-aduskett@gmail.com> References: <20190128232209.17485-1-aduskett@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v3 1/5] testing/infra/builder: build with target and environment 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: Ricardo Martincoski , dleach@belcan.com, matthew.weber@collins.com, Adam Duskett Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Ricardo Martincoski Make the builder able to call 'VAR1=1 make VAR2=2 target'. Allow sending extra parameters to be added to the end of make command line. Uses for these purposes: - to configure a br2-external, using the 'BR2_EXTERNAL="dir" variable. - to specify a make target, such as 'foo-source.' Allow adding variables to the environment when calling make. These added variables allow a user to override default values from BuildRoot, such as 'BR2_DL_DIR="dl"'. Signed-off-by: Ricardo Martincoski Cc: Arnout Vandecappelle Signed-off-by: Matt Weber Signed-off-by: Daniel J. Leach Signed-off-by: Adam Duskett --- Changes v1 -> v3: - Added this patch to the series. support/testing/infra/builder.py | 36 ++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/support/testing/infra/builder.py b/support/testing/infra/builder.py index fc318fe26e..018747555d 100644 --- a/support/testing/infra/builder.py +++ b/support/testing/infra/builder.py @@ -12,7 +12,17 @@ class Builder(object): self.builddir = builddir self.logfile = infra.open_log_file(builddir, "build", logtofile) - def configure(self): + def configure(self, make_extra_opts=[], make_extra_env={}): + """Configure the build. + + make_extra_opts: a list of arguments to be passed to the make + command. + e.g. make_extra_opts=["BR2_EXTERNAL=/path"] + + make_extra_env: a dict of variables to be appended (or replaced) + in the environment that calls make. + e.g. make_extra_env={"BR2_DL_DIR": "/path"} + """ if not os.path.isdir(self.builddir): os.makedirs(self.builddir) @@ -25,22 +35,40 @@ class Builder(object): self.logfile.flush() env = {"PATH": os.environ["PATH"]} + env.update(make_extra_env) + cmd = ["make", - "O={}".format(self.builddir), - "olddefconfig"] + "O={}".format(self.builddir)] + cmd += make_extra_opts + cmd += ["olddefconfig"] + ret = subprocess.call(cmd, stdout=self.logfile, stderr=self.logfile, env=env) if ret != 0: raise SystemError("Cannot olddefconfig") - def build(self): + def build(self, make_extra_opts=[], make_extra_env={}): + """Perform the build. + + make_extra_opts: a list of arguments to be passed to the make + command. It can include a make target. + e.g. make_extra_opts=["foo-source"] + + make_extra_env: a dict of variables to be appended (or replaced) + in the environment that calls make. + e.g. make_extra_env={"BR2_DL_DIR": "/path"} + """ env = {"PATH": os.environ["PATH"]} if "http_proxy" in os.environ: self.logfile.write("Using system proxy: " + os.environ["http_proxy"] + "\n") env['http_proxy'] = os.environ["http_proxy"] env['https_proxy'] = os.environ["http_proxy"] + env.update(make_extra_env) + cmd = ["make", "-C", self.builddir] + cmd += make_extra_opts + ret = subprocess.call(cmd, stdout=self.logfile, stderr=self.logfile, env=env) if ret != 0: From patchwork Mon Jan 28 23:22:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 1032308 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=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="E1+LQf9I"; 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 43pQf54yc3z9sMr for ; Tue, 29 Jan 2019 10:22:52 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 506D9864E0; Mon, 28 Jan 2019 23:22:50 +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 riV6t0G8R7AP; Mon, 28 Jan 2019 23:22:49 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 68CA386406; Mon, 28 Jan 2019 23:22:49 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id A58B31BF2C8 for ; Mon, 28 Jan 2019 23:22:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id A2E0985BF2 for ; Mon, 28 Jan 2019 23:22:48 +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 svxldrb7N3fi for ; Mon, 28 Jan 2019 23:22:45 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-it1-f195.google.com (mail-it1-f195.google.com [209.85.166.195]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 7E99284F24 for ; Mon, 28 Jan 2019 23:22:45 +0000 (UTC) Received: by mail-it1-f195.google.com with SMTP id g85so1378615ita.3 for ; Mon, 28 Jan 2019 15:22:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kpSAkWpOoEmYdt4MWNxR+Xuc92y+R750Q8qgHZu+CjY=; b=E1+LQf9IGWMnoc+i/NY3Vb0SLBRHuynkkZ926EPns5MaUnk3qqI/zzq+Zz8evKLsGN T00ru/zlEgwsdmfSQxr++00tL/5QXHiyBaUAyoCVtqKH+HQ+qi6eaYnsHn9yKwGzabLJ a+W4cA9DOlpfFUuGB5T104t7KK7+tuyQwBDRJ64zXm1w/MRvgLZjaTDQitLNRY2t6kZJ MNR5jm2AShg2Vq+HDXw0+Z3dSI7y8XkLiRjo8KMTL8WG7j0BEfemZ6gY9zoKlcbo1+XR K9o316uOZPmQwpeetKGbH7OVNYN0kh4T/g6RK0/hP8olyy6xk7nRbhJOSEpBLgZcStGr xOCw== 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:mime-version:content-transfer-encoding; bh=kpSAkWpOoEmYdt4MWNxR+Xuc92y+R750Q8qgHZu+CjY=; b=I97Keb4Gx7fGlOH+OSpSYnQ5CMrNOMKg/ff+zitFdAjIEuk/uC0XyyQQrfudkTrv7l nHwNyMZBWp/sKKSdwD2RUDSPp8TaNesXMGnXPqWQRbsdvDoaLmvW+O2MV/lIFnMvObJg E/4qCjSxVJ5GwQTP2BT9KiC5damMPLC4ImCy6o0/XBmnf94mTJHbOtRVA19JWuibv4q+ n5TDF7Sfzd/SoDCfuZUAlg1ACPS5rgJrVI3QPmE86aju9LTDnxBLTbKOxekMxOvBEAG2 S+qkTvRQ0lTGZ9aVeeLmqIpzWx9yPZUk/cHHoqfc7b8iHD6sNeWDUzZumDZLVUy9gXph ao3g== X-Gm-Message-State: AJcUukf2YXA7hLweZk3/ESMpRO2UvtihFrB/OOFnGoorV4GlKzsvRxgQ rs9CuN5QTX4Wu88VoLMr3g57jCUI X-Google-Smtp-Source: ALg8bN5GzJA1Hz9XcAHZqInlIcOHuVQygDGAgbHdEFRJYw442OgRhHXuU6vFX8q1m26iWeeOb2SXLQ== X-Received: by 2002:a24:455d:: with SMTP id y90mr11196029ita.28.1548717764558; Mon, 28 Jan 2019 15:22:44 -0800 (PST) Received: from localhost.localdomain (68-188-149-81.dhcp.aldl.mi.charter.com. [68.188.149.81]) by smtp.gmail.com with ESMTPSA id r195sm492325ita.3.2019.01.28.15.22.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 28 Jan 2019 15:22:43 -0800 (PST) From: aduskett@gmail.com To: buildroot@buildroot.org Date: Mon, 28 Jan 2019 18:22:06 -0500 Message-Id: <20190128232209.17485-3-aduskett@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190128232209.17485-1-aduskett@gmail.com> References: <20190128232209.17485-1-aduskett@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v3 2/5] testing/infra/basetest: support br2-external 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: Ricardo Martincoski , dleach@belcan.com, matthew.weber@collins.com, Adam Duskett Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Ricardo Martincoski Some upcoming test cases can use one or more br2-external trees as fixtures that provide packages used only in runtime tests. Add support for br2-external into the BRTest class. Any test case can then provide a list of paths for being used as br2-external trees during the build of the image to test. Signed-off-by: Ricardo Martincoski Cc: Arnout Vandecappelle Signed-off-by: Matt Weber Signed-off-by: Daniel J. Leach Signed-off-by: Adam Duskett Tested-by: Matthew Weber --- Changes v1 -> v3: - Added this patch to the series. support/testing/infra/basetest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/support/testing/infra/basetest.py b/support/testing/infra/basetest.py index 5014fefafa..84139438bc 100644 --- a/support/testing/infra/basetest.py +++ b/support/testing/infra/basetest.py @@ -30,6 +30,7 @@ MINIMAL_CONFIG = \ class BRTest(unittest.TestCase): config = None + br2_external = list() downloaddir = None outputdir = None logtofile = True @@ -58,7 +59,7 @@ class BRTest(unittest.TestCase): if not self.b.is_finished(): self.show_msg("Building") - self.b.configure() + self.b.configure(["BR2_EXTERNAL={}".format(":".join(self.br2_external))]) self.b.build() self.show_msg("Building done") From patchwork Mon Jan 28 23:22:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 1032310 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=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="KVXqCIfz"; 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 43pQf65PdBz9sDL for ; Tue, 29 Jan 2019 10:22:54 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 3E95923E65; Mon, 28 Jan 2019 23:22: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 3CKoY8IeR9hO; Mon, 28 Jan 2019 23:22:52 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 2DBA623E6B; Mon, 28 Jan 2019 23:22:52 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 176241BF2C8 for ; Mon, 28 Jan 2019 23:22:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 1498684F24 for ; Mon, 28 Jan 2019 23:22:49 +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 a4xXYzC-6iBZ for ; Mon, 28 Jan 2019 23:22:46 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-it1-f195.google.com (mail-it1-f195.google.com [209.85.166.195]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 973BD84F76 for ; Mon, 28 Jan 2019 23:22:46 +0000 (UTC) Received: by mail-it1-f195.google.com with SMTP id z7so1404749iti.0 for ; Mon, 28 Jan 2019 15:22:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6ozQD5f/AY45eoIppX5+K6Kr3Jx02irJo5HqrwuPEw4=; b=KVXqCIfz0HdvqvREYzo5fVOpUjVGrVDyFgdf0qO6OLr5U0WY12Qx8QaT64j0tfjJkm AzbNQk8ynARsPqVGReRJ5Gq5EBhR6kvMVJL7dH1eQUCCy2PW72hdsa5nBYRxF/stYnEF OpOJMkNqfk8QYQSUJ1xAobyngpvgjpGG86j2yfnNIgRzZfTLtHMBkfDIZNzsLBkfDrvK s0iSZRVP4jnkHPhW3/B3FcK6YhAeAAoT4oQg92UUbYKLt+rT3yPVjNvuQ87a2/TZYDLm +lndmSiuB6Kf2sZQenDqbrr2wVpEmrCG/W5bJXAlUeiC0oJbT/zfvHsFxRFt32WMZx6F L+Ng== 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:mime-version:content-transfer-encoding; bh=6ozQD5f/AY45eoIppX5+K6Kr3Jx02irJo5HqrwuPEw4=; b=aUCAAWdil86nu6wPH6owjdMlEivi6xvJHBarWhoYKKnlqYWEAKsgLjxWZxuCp3DUdX BLOj3duKno4yCdWIydiZLQRBc4tHM8u0w53O6gaCOXIiPx59P7phq3g1IxMENYSeGi4J 6k/FMYRIwTNY3Z8MfgacfO7wYrylmW4CeItAPbKXR7erhCSQeRZlQZfsFZ0b2eRJgkeF GZzuUWaQV8duCPRPbQ1V1o6mzAFOeQPA7qF7gm+FlplyPgdQZSYhnkqmoqaVdffINykK KRH//z2JqQzIFjXkO5EHUJ3l3WeEXb3Lr33G3yjQpefc/6budylus9kGntZMI6pb2/Tb 1B0Q== X-Gm-Message-State: AHQUAuZFRc14VLOjr0mM/op32+gdxtrHym8vPRByoZB+to/m/R+E4+DT 0ackePnD8DRKxCrUk4AsqSn6ai1U X-Google-Smtp-Source: ALg8bN6ABLATyjQsxW+TtEyfhde9UQphpgQ4+GdxHAzQjWJScC5Emko8uM4XlWsYhcUbr48P6k3+EQ== X-Received: by 2002:a24:81d4:: with SMTP id q203mr12488013itd.23.1548717765652; Mon, 28 Jan 2019 15:22:45 -0800 (PST) Received: from localhost.localdomain (68-188-149-81.dhcp.aldl.mi.charter.com. [68.188.149.81]) by smtp.gmail.com with ESMTPSA id r195sm492325ita.3.2019.01.28.15.22.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 28 Jan 2019 15:22:44 -0800 (PST) From: aduskett@gmail.com To: buildroot@buildroot.org Date: Mon, 28 Jan 2019 18:22:07 -0500 Message-Id: <20190128232209.17485-4-aduskett@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190128232209.17485-1-aduskett@gmail.com> References: <20190128232209.17485-1-aduskett@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v3 3/5] openjdk-bin: 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: dleach@belcan.com, matthew.weber@collins.com, Adam Duskett Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Adam Duskett Paradoxically, building OpenJDK requires a pre-existing JDK. This pre-existing JDK is called the "boot JDK." The boot JDK for building JDK major version N should be a JDK of major version N-1, so for building JDK11, JDK10 would be needed. This requirement is an issue when building on most distributions, as the host JDK tends to be JDK8. The AdoptOpenJDK project provides binaries that can act as the boot JDK to build the target JDK, which is what this package provides. Currently, only a x86_64 host is supported, for two reasons: 1) A 32bit x86 binary distribution is not available from AdoptOpenJDK 2) I do not have access to a machine that is not x86_64 that can build Buildroot. OpenJDK-bin installs to $(HOST_DIR)/openjdk/ because the RPATH of the provided java binaries do not have a proper RPATH, which causes a build failure. Signed-off-by: Adam Duskett --- Changes v1 -> v2: - No change Changes v2 -> v3: - Changed the location of the installed binaries to just $(HOST_DIR)/openjdk - Added a more in-depth commit message explaining some of the my reasoning for some of the quirks in the package files. DEVELOPERS | 1 + package/Config.in.host | 1 + package/openjdk-bin/Config.in.host | 12 ++++++++++++ package/openjdk-bin/openjdk-bin.hash | 6 ++++++ package/openjdk-bin/openjdk-bin.mk | 23 +++++++++++++++++++++++ 5 files changed, 43 insertions(+) create mode 100644 package/openjdk-bin/Config.in.host create mode 100644 package/openjdk-bin/openjdk-bin.hash create mode 100644 package/openjdk-bin/openjdk-bin.mk diff --git a/DEVELOPERS b/DEVELOPERS index c1950bb0f4..28ba480d85 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -50,6 +50,7 @@ F: package/libselinux/ F: package/libsemanage/ F: package/libsepol/ F: package/nginx-naxsi/ +F: package/openjdk-bin/ F: package/policycoreutils/ F: package/python-flask-sqlalchemy/ F: package/python-mutagen/ diff --git a/package/Config.in.host b/package/Config.in.host index 16b474fc9d..0499589c4f 100644 --- a/package/Config.in.host +++ b/package/Config.in.host @@ -39,6 +39,7 @@ menu "Host utilities" source "package/mtools/Config.in.host" source "package/mxsldr/Config.in.host" source "package/omap-u-boot-utils/Config.in.host" + source "package/openjdk-bin/Config.in.host" source "package/openocd/Config.in.host" source "package/opkg-utils/Config.in.host" source "package/parted/Config.in.host" diff --git a/package/openjdk-bin/Config.in.host b/package/openjdk-bin/Config.in.host new file mode 100644 index 0000000000..e3dd438a0f --- /dev/null +++ b/package/openjdk-bin/Config.in.host @@ -0,0 +1,12 @@ +config BR2_PACKAGE_HOST_OPENJDK_BIN_ARCH_SUPPORTS + bool + default y if BR2_HOSTARCH = "x86_64" + +config BR2_PACKAGE_HOST_OPENJDK_BIN + bool "host openjdk-bin" + depends on BR2_PACKAGE_HOST_OPENJDK_BIN_ARCH_SUPPORTS + help + Pre-packaged OpenJDK binaries used to compile the target + OpenJDK. + + https://adoptopenjdk.net/ diff --git a/package/openjdk-bin/openjdk-bin.hash b/package/openjdk-bin/openjdk-bin.hash new file mode 100644 index 0000000000..35d0b5c44b --- /dev/null +++ b/package/openjdk-bin/openjdk-bin.hash @@ -0,0 +1,6 @@ +# From https://github.com/AdoptOpenJDK/openjdk11-binaries/releases +sha256 d89304a971e5186e80b6a48a9415e49583b7a5a9315ba5552d373be7782fc528 OpenJDK11U-jdk_x64_linux_hotspot_11.0.2_7.tar.gz + +# Locally calculated +sha256 4b9abebc4338048a7c2dc184e9f800deb349366bdf28eb23c2677a77b4c87726 legal/java.prefs/LICENSE +sha256 a44eb7b5caf5534c6ef536b21edb40b4d6babf91bf97d9d45596868618b2c6fb legal/java.prefs/ASSEMBLY_EXCEPTION diff --git a/package/openjdk-bin/openjdk-bin.mk b/package/openjdk-bin/openjdk-bin.mk new file mode 100644 index 0000000000..197ccd8eec --- /dev/null +++ b/package/openjdk-bin/openjdk-bin.mk @@ -0,0 +1,23 @@ +################################################################################ +# +# host-openjdk-bin +# +################################################################################ + +HOST_OPENJDK_BIN_VERSION_MAJOR = 11.0.2 +HOST_OPENJDK_BIN_VERSION_MINOR = 7 +HOST_OPENJDK_BIN_VERSION = $(HOST_OPENJDK_BIN_VERSION_MAJOR)_$(HOST_OPENJDK_BIN_VERSION_MINOR) +HOST_OPENJDK_BIN_SOURCE = OpenJDK11U-jdk_x64_linux_hotspot_$(HOST_OPENJDK_BIN_VERSION).tar.gz +HOST_OPENJDK_BIN_SITE = https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-$(HOST_OPENJDK_BIN_VERSION_MAJOR)%2B$(HOST_OPENJDK_BIN_VERSION_MINOR) +HOST_OPENJDK_BIN_LICENSE = GPLv2+ with exception +HOST_OPENJDK_BIN_LICENSE_FILES = legal/java.prefs/LICENSE legal/java.prefs/ASSEMBLY_EXCEPTION + +# If the files are installed to $(HOST_DIR)/bin and $(HOST_DIR)/lib +# the build will fail because the RPATH of java binaries do not have a proper +# RPATH +define HOST_OPENJDK_BIN_INSTALL_CMDS + mkdir -p $(HOST_DIR)/openjdk + cp -aLrf $(@D)/* $(HOST_DIR)/openjdk/ +endef + +$(eval $(host-generic-package)) From patchwork Mon Jan 28 23:22:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 1032311 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=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="oXHolriD"; 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 43pQfB3LbCz9sDL for ; Tue, 29 Jan 2019 10:22:58 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id D915285C63; Mon, 28 Jan 2019 23:22:55 +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 7CIlsOwLtzVZ; Mon, 28 Jan 2019 23:22:53 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id ED7CB84F76; Mon, 28 Jan 2019 23:22:52 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 541A81BF2C8 for ; Mon, 28 Jan 2019 23:22:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 5166C84F24 for ; Mon, 28 Jan 2019 23:22:49 +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 rF7Sm896GQSX for ; Mon, 28 Jan 2019 23:22:48 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-it1-f193.google.com (mail-it1-f193.google.com [209.85.166.193]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 0D15685BCD for ; Mon, 28 Jan 2019 23:22:48 +0000 (UTC) Received: by mail-it1-f193.google.com with SMTP id a6so1264064itl.4 for ; Mon, 28 Jan 2019 15:22:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NtlC3D0OypQpoQlZh7vz49L5/OaT8EFZPCrhfgJU0dg=; b=oXHolriDovGB2ouoUbXZmWhIBzx656r7hCZ4Q5QeJpW7t0WcIul/EVKVgee3Ty3vxY P8GJkx4uSaaeJKXobio3NuQwnTIyhdq+7mpfPaAS2VKtZPSiZf5M3dItJSxo/sGm/Z6h /60nmpnxtI4sXmfuvawjS9aSNzuK+LiHRQ0ykKz142Zh/h9JVCH71MIUv4lvl2zVYgho T1+/oeaP/GgbiQfWjj2Wj/OSsGmh8S9skBOwVtDIuX7N8qsAP1tHoGQCQNemntP9TnPu 1jZ+Z8t7XVSq17j8EMrxHWzB1rjxt62erTxPo5Ltb2qdqKX78T9r0DLHg4n3aSOyvMts 53sw== 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:mime-version:content-transfer-encoding; bh=NtlC3D0OypQpoQlZh7vz49L5/OaT8EFZPCrhfgJU0dg=; b=SzyLqFCpynv9YeJjMnSEzDcWOGc2akgrpeU7jfDbZjv0KYLisCieoPVVHCU2XAQJaA u12I6zZgqNJCeTvUvb2qf6msltc+9vuzpFREiYCTzETUf4zULSzxYHMvNep2Z667FGdA B1EfA0AR52yIg3BlPKbM0PHwInx+2KoRPsEHASra6tWcsBQC9gt7xpznLU0ZvCKxAsYi k06eJIA1zrgyarHdsuIM1N3AV6LGkhkUkkVJ7CTSutgMb2oQ07aPQBsxsiX8ZUZEstet ii/07hLLNO24WaZ12HZD/WqOl9h1+gRilZ5WJoLoR0FPRTF52m9UDTzAYGJTllN2/djx L9Rw== X-Gm-Message-State: AHQUAuaaL5qh7ph+HpCgwkSUazDHMI4pxWgjxKO3coX6D2822oBaZjxj HYB16xDc0x3yYrZGCJClDKLY6BNR X-Google-Smtp-Source: ALg8bN5vuICpuyhIT7rmxrjcrBbPat4FzjKEt4yAi91Yqq+YtaNnaJMoB4/qoK98PJj4wL7tVpdsQQ== X-Received: by 2002:a24:7284:: with SMTP id x126mr11415367itc.15.1548717766934; Mon, 28 Jan 2019 15:22:46 -0800 (PST) Received: from localhost.localdomain (68-188-149-81.dhcp.aldl.mi.charter.com. [68.188.149.81]) by smtp.gmail.com with ESMTPSA id r195sm492325ita.3.2019.01.28.15.22.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 28 Jan 2019 15:22:46 -0800 (PST) From: aduskett@gmail.com To: buildroot@buildroot.org Date: Mon, 28 Jan 2019 18:22:08 -0500 Message-Id: <20190128232209.17485-5-aduskett@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190128232209.17485-1-aduskett@gmail.com> References: <20190128232209.17485-1-aduskett@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v3 4/5] openjdk: 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: dleach@belcan.com, matthew.weber@collins.com, Adam Duskett Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Adam Duskett OpenJDK is a free and open-source implementation of the Java Platform. This package provides the option to build a client or a server JVM interpreter. The default option is the server option, as that is what the majority of users use. This JVM interpreter loads more slowly, putting more effort into JIT compilations to yield higher performance. Unlike most autotools packages, OpenJDK is exceptionally different and has many quirks, some of which are documented below: - X11, alsa, and cups are required to build Java, even if it's a headless build. - There is no autogen.sh file, instead, a user calls ./configure autogen. - If ccache is enabled, BuildRoot sets CC, CXX, and CPP to the ccache binary, which causes OpenJDK to throw an error during the configure step, so LD, CC, CXX, and CPP must set explicitly to the actual binaries. - Some variables are ignored unless set as a configure option. These variables are OBJCOPY, OBJDUMP, NM, STRIP, and AR. - Other variables must be environment variables, these are PATH, LD, CC, CXX, and CPP. - Parallel make is possible, but not with make -jN, instead, one has to pass the --with-jobs=$(PARALLEL_JOBS) to configure, or pass JOBS=$(PARALLEL_JOBS) to make. I chose the former because it seems cleaner. Signed-off-by: Adam Duskett Tested-by: Daniel J. Leach --- Changes v1 -> v2: - Fixed the patch name. Changes v2 -> v3: - Changed the install location of the libraries and binaries to $(TARGET_DIR)/bin and $(TARGET_DIR)/lib. - Changed -with-boot-jdk location to $(HOST_DIR)/openjdk - Added a more in-depth commit message explaining some of the my reasoning for some of the quirks in the package files. DEVELOPERS | 1 + package/Config.in | 1 + package/openjdk/Config.in | 55 ++++++++++++++ package/openjdk/openjdk.hash | 3 + package/openjdk/openjdk.mk | 136 +++++++++++++++++++++++++++++++++++ 5 files changed, 196 insertions(+) create mode 100644 package/openjdk/Config.in create mode 100644 package/openjdk/openjdk.hash create mode 100644 package/openjdk/openjdk.mk diff --git a/DEVELOPERS b/DEVELOPERS index 28ba480d85..0893af58dc 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -50,6 +50,7 @@ F: package/libselinux/ F: package/libsemanage/ F: package/libsepol/ F: package/nginx-naxsi/ +F: package/openjdk/ F: package/openjdk-bin/ F: package/policycoreutils/ F: package/python-flask-sqlalchemy/ diff --git a/package/Config.in b/package/Config.in index 5036421a73..e150e32563 100644 --- a/package/Config.in +++ b/package/Config.in @@ -671,6 +671,7 @@ menu "Mono libraries/modules" endmenu endif source "package/nodejs/Config.in" + source "package/openjdk/Config.in" source "package/perl/Config.in" if BR2_PACKAGE_PERL menu "Perl libraries/modules" diff --git a/package/openjdk/Config.in b/package/openjdk/Config.in new file mode 100644 index 0000000000..f23cedc7ca --- /dev/null +++ b/package/openjdk/Config.in @@ -0,0 +1,55 @@ +config BR2_PACKAGE_OPENJDK + bool "OpenJDK" + depends on !BR2_SOFT_FLOAT + depends on !BR2_STATIC_LIBS + depends on BR2_INSTALL_LIBSTDCPP # gtk2, cups + depends on BR2_PACKAGE_HOST_OPENJDK_BIN_ARCH_SUPPORTS + depends on BR2_PACKAGE_XORG7 + depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # C++11 + depends on BR2_TOOLCHAIN_HAS_SYNC_4 # gtk2 -> pango -> harfbuzz + depends on BR2_TOOLCHAIN_HAS_THREADS # gtk2 -> glib2 + depends on BR2_TOOLCHAIN_USES_GLIBC + depends on BR2_USE_MMU # gtk2 -> glib2 + depends on BR2_USE_WCHAR # gtk2 -> glib2 + select BR2_PACKAGE_ALSA_LIB + select BR2_PACKAGE_CUPS + select BR2_PACKAGE_FONTCONFIG + select BR2_PACKAGE_HOST_OPENJDK_BIN + select BR2_PACKAGE_LIBUSB + select BR2_PACKAGE_XLIB_LIBXRENDER + select BR2_PACKAGE_XLIB_LIBXT + select BR2_PACKAGE_XLIB_LIBXTST + help + OpenJDK is a free and open-source implementation of the + Java Platform. + + http://openjdk.java.net/ + +if BR2_PACKAGE_OPENJDK + +menu "JVM Variants" + +config BR2_PACKAGE_OPENJDK_JVM_VARIANT_CLIENT + bool "client" + help + Quick loading, but slower run-time performance. + +config BR2_PACKAGE_OPENJDK_JVM_VARIANT_SERVER + bool "server" + default y + help + Slower loading, but faster run-time performance. + +endmenu +endif + +comment "OpenJDK needs a glibc toolchain w/ wchar, dynamic library, threads, C++, gcc >= 4.9" + depends on BR2_USE_MMU + depends on BR2_TOOLCHAIN_HAS_SYNC_4 + depends on BR2_PACKAGE_XORG7 + depends on !BR2_USE_WCHAR || BR2_STATIC_LIBS || !BR2_INSTALL_LIBSTDCPP || \ + !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 || !BR2_TOOLCHAIN_HAS_THREADS || \ + !BR2_TOOLCHAIN_USES_GLIBC + +comment "OpenJDK does not support soft floats" + depends on BR2_SOFT_FLOAT diff --git a/package/openjdk/openjdk.hash b/package/openjdk/openjdk.hash new file mode 100644 index 0000000000..dc201863a7 --- /dev/null +++ b/package/openjdk/openjdk.hash @@ -0,0 +1,3 @@ +# Locally computed +sha256 9bb8c44e42fbfcee8402f6d0722fbe2209647b7959544d924a6790bc053e8f20 openjdk-jdk-11.0.2+7.tar.gz +sha256 4b9abebc4338048a7c2dc184e9f800deb349366bdf28eb23c2677a77b4c87726 LICENSE diff --git a/package/openjdk/openjdk.mk b/package/openjdk/openjdk.mk new file mode 100644 index 0000000000..97c55434b6 --- /dev/null +++ b/package/openjdk/openjdk.mk @@ -0,0 +1,135 @@ +################################################################################ +# +# openjdk +# +################################################################################ + +OPENJDK_VERSION_MAJOR = 11.0.2 +OPENJDK_VERSION_MINOR = 7 +OPENJDK_VERSION=jdk-$(OPENJDK_VERSION_MAJOR)+$(OPENJDK_VERSION_MINOR) +OPENJDK_RELEASE = jdk11u +OPENJDK_SITE = $(call github,AdoptOpenJDK,openjdk-jdk11u,$(OPENJDK_VERSION)) +OPENJDK_LICENSE = GPLv2+ with exception +OPENJDK_LICENSE_FILES = LICENSE + +OPENJDK_DEPENDENCIES = \ + host-openjdk-bin \ + host-pkgconf \ + alsa-lib \ + cups \ + fontconfig \ + libusb \ + xlib_libXrender \ + xlib_libXt \ + xlib_libXtst + +# JVM variants +ifeq ($(BR2_PACKAGE_OPENJDK_JVM_VARIANT_CLIENT),y) +OPENJDK_JVM_VARIANTS += client +endif + +ifeq ($(BR2_PACKAGE_OPENJDK_JVM_VARIANT_SERVER),y) +OPENJDK_JVM_VARIANTS += server +endif +OPENJDK_JVM_VARIANT_LIST = $(subst $(space),$(comma),$(OPENJDK_JVM_VARIANTS)) + +# Some environment variables will be ignored unless passed via environment +# variables. +# OpenJDK will default to ld, but will pass -Xlinker and -z as arguments, +# which will cause compilation failures. Instead, tell OpenJDK to use gcc. +# Furthermore, if ccache is enabled, BuildRoot will set CC,CXX, and CPP to +# the ccache binary, which will cause OpenJDK to throw an error during the +# configure step, so we must set these variables explicitly to the actual +# binaries. +OPENJDK_CONF_ENV = \ + PATH=$(BR_PATH) \ + LD=$(TARGET_CC) \ + CC=$(TARGET_CC) \ + CXX=$(TARGET_CXX) \ + CPP=$(TARGET_CPP) + +OPENJDK_CONF_OPTS = \ + --disable-full-docs \ + --disable-hotspot-gtest \ + --disable-manpages \ + --disable-warnings-as-errors \ + --enable-headless-only \ + --enable-openjdk-only \ + --enable-unlimited-crypto \ + --openjdk-target=$(GNU_TARGET_NAME) \ + --prefix=$(TARGET_DIR)/usr \ + --with-boot-jdk=$(HOST_DIR)/openjdk \ + --with-debug-level=release \ + --with-devkit=$(HOST_DIR) \ + --with-extra-cflags="$(TARGET_CFLAGS)" \ + --with-extra-cxxflags="$(TARGET_CXXFLAGS)" \ + --with-extra-path=$(HOST_DIR)/bin:$(HOST_DIR)/sbin \ + --with-giflib=bundled \ + --with-jobs=$(PARALLEL_JOBS) \ + --with-jvm-variants=$(OPENJDK_JVM_VARIANT_LIST) \ + --with-libjpeg=bundled \ + --with-libpng=bundled \ + --with-native-debug-symbols=none \ + --without-version-pre \ + --with-sysroot=$(STAGING_DIR) \ + --with-vendor-name="AdoptOpenJDK" \ + --with-vendor-url="https://adoptopenjdk.net/" \ + --with-vendor-version-string="AdoptOpenJDK" \ + --with-version-build="$(OPENJDK_VERSION_MAJOR)" \ + --with-version-string="$(OPENJDK_VERSION_MAJOR)" \ + --with-zlib=bundled \ + OBJCOPY=$(TARGET_OBJCOPY) \ + OBJDUMP=$(TARGET_OBJDUMP) \ + NM=$(TARGET_NM) \ + STRIP=$(TARGET_STRIP) \ + AR=$(TARGET_AR) + +ifeq ($(BR2_aarch64),y) +OPENJDK_CONF_OPTS += --with-cpu-port=aarch64 --with-abi-profile=aarch64 +endif + +ifeq ($(BR2_CCACHE),y) +OPENJDK_CONF_OPTS += \ + --enable-ccache \ + --with-ccache-dir=$(BR2_CCACHE_DIR) +endif + +ifeq ($(BR2_PACKAGE_JPEG),y) +OPENJDK_DEPENDENCIES += jpeg +OPENJDK_CONF_OPTS += --with-libjpeg=system +endif + +ifeq ($(BR2_PACKAGE_GIFLIB),y) +OPENJDK_DEPENDENCIES += giflib +OPENJDK_CONF_OPTS += --with-giflib=system +endif + +ifeq ($(BR2_PACKAGE_LIBPNG),y) +OPENJDK_DEPENDENCIES += libpng +OPENJDK_CONF_OPTS += --with-libpng=system +endif + +ifeq ($(BR2_PACKAGE_ZLIB),y) +OPENJDK_DEPENDENCIES += libzlib +OPENJDK_CONF_OPTS += --with-zlib=system +endif + +# Autogen and configure are done in a single step. +define OPENJDK_CONFIGURE_CMDS + chmod +x $(@D)/configure + cd $(@D); $(OPENJDK_CONF_ENV) ./configure autogen $(OPENJDK_CONF_OPTS) +endef + +# Build just the JRE image for the target. +define OPENJDK_BUILD_CMDS + $(MAKE1) -C $(@D) legacy-jre-image +endef + +# Calling make install will build and install the JDK instad of the JRE, +# which makes manual installation necessary. +define OPENJDK_INSTALL_TARGET_CMDS + cp -rf $(@D)/build/linux-*-release/images/jre/bin/* $(TARGET_DIR)/usr/bin/ + cp -rf $(@D)/build/linux-*-release/images/jre/lib/* $(TARGET_DIR)/usr/lib/ +endef + +$(eval $(generic-package)) From patchwork Mon Jan 28 23:22:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 1032312 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=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="X8ji4OMD"; 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 43pQfJ3b1fz9sDL for ; Tue, 29 Jan 2019 10:23:04 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 799CF84F24; Mon, 28 Jan 2019 23:22:59 +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 aQitHevKYKhT; Mon, 28 Jan 2019 23:22:55 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id B3C2685C1D; Mon, 28 Jan 2019 23:22:53 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 3AE2A1BF2C8 for ; Mon, 28 Jan 2019 23:22:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 375388774C for ; Mon, 28 Jan 2019 23:22:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HfDfDDt77Vy1 for ; Mon, 28 Jan 2019 23:22:49 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-it1-f193.google.com (mail-it1-f193.google.com [209.85.166.193]) by hemlock.osuosl.org (Postfix) with ESMTPS id 0B50A876F2 for ; Mon, 28 Jan 2019 23:22:49 +0000 (UTC) Received: by mail-it1-f193.google.com with SMTP id c9so1294972itj.1 for ; Mon, 28 Jan 2019 15:22:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hpklzjmp7XKVt/pI9Pk83pQCkNxJHU7NCFxljA/zIMs=; b=X8ji4OMDz4SZKmlhTpGRivu++DkgOSozeq8eKpOLNyFffInKjFXyEUDIdv48Y43dDa V5vfpXBRRBU0MTrmfQZ7XGYedQC4opu4PqS8/hynMQZqFO0W45aHl2esBnLRaIPUZxk8 fUlUGdtqUVGjDPbgB2PTr6hDFNKO8sLOzHx5+p/Ot7LnMSKnr1tcvdOvocBwZz+N+o1W z2ylCLj4aWNpB5k0K3aS13PsDKS5ZtN+QbdkMESaIwvP46eYpD/FNiQ5TwcgjO+MWtVB nMRM1v9UUqt4cCh6GHdjodOZdtwpyNTu31k5gDW34WYMa3+Xlxp1v96ZaySwj4jnTL3d tCIA== 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:mime-version:content-transfer-encoding; bh=hpklzjmp7XKVt/pI9Pk83pQCkNxJHU7NCFxljA/zIMs=; b=c5+XMALvHikS29Egj/varvVhdPPhdaMSf30Jx0koEBnPsEWlpKSXAszUwaNqBxlOvM RD2oepcdr6ytoVr+1dsBMIecYGWUNA4vgxQ7iCIdjSBBiv0lRudJ2W1muCmyS1xbENIo VQ4kLRZi6lR7dJKMVr/McccduHCXtOfbCtmqH5TqfZZg1o9wa8ApdT2MA0DdGGquvKU/ cbK+LLSz3ZgHrxBB0UCHHURll84I9LZCRxTaEwPvJPs8fkgjjTsKCBPN7FmI1aeSURWb pHBYt5kUSaeQ9J4lmNMyRq8+bk6sTV5os3yGavaRTu7WD7SuEXSna701RtRtyGUSMeFG Xi9Q== X-Gm-Message-State: AJcUukfMQskoZCNV3uhqreQ0c0fxYEGefotiR6cVU/epPpQAqoiiMC05 yOUT4BRfXZw+l918O/CGnwctLTq8 X-Google-Smtp-Source: ALg8bN7svNzLx6bDvmYRz4x+4IYfU+H6aOFVTf1oU6adyCEZAOS4d7W4hptUvZ0/KySXb/NBrHHpOA== X-Received: by 2002:a02:330d:: with SMTP id c13mr15092608jae.95.1548717768046; Mon, 28 Jan 2019 15:22:48 -0800 (PST) Received: from localhost.localdomain (68-188-149-81.dhcp.aldl.mi.charter.com. [68.188.149.81]) by smtp.gmail.com with ESMTPSA id r195sm492325ita.3.2019.01.28.15.22.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 28 Jan 2019 15:22:47 -0800 (PST) From: aduskett@gmail.com To: buildroot@buildroot.org Date: Mon, 28 Jan 2019 18:22:09 -0500 Message-Id: <20190128232209.17485-6-aduskett@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190128232209.17485-1-aduskett@gmail.com> References: <20190128232209.17485-1-aduskett@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v3 5/5] openjdk-hello-world: new test 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: dleach@belcan.com, matthew.weber@collins.com, Adam Duskett Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: "Daniel J. Leach" This test is a simple "Hello, World" integration test of the OpenJDK package. It compiles the Java app on the host, then runs it on an emulated AARCH64 target and verifies "Hello, World" is printed. Signed-off-by: Daniel J. Leach Signed-off-by: Adam Duskett --- Changes v1 -> v3: - Added this patch to the series. .gitlab-ci.yml | 1 + DEVELOPERS | 1 + .../package/br2-external/openjdk/Config.in | 1 + .../br2-external/openjdk/external.desc | 1 + .../package/br2-external/openjdk/external.mk | 1 + .../package/openjdk-hello-world/Config.in | 26 ++++++++++++ .../openjdk-hello-world/HelloWorld.java | 8 ++++ .../openjdk-hello-world.mk | 19 +++++++++ support/testing/tests/package/test_openjdk.py | 42 +++++++++++++++++++ 9 files changed, 100 insertions(+) create mode 100644 support/testing/tests/package/br2-external/openjdk/Config.in create mode 100644 support/testing/tests/package/br2-external/openjdk/external.desc create mode 100644 support/testing/tests/package/br2-external/openjdk/external.mk create mode 100644 support/testing/tests/package/br2-external/openjdk/package/openjdk-hello-world/Config.in create mode 100644 support/testing/tests/package/br2-external/openjdk/package/openjdk-hello-world/HelloWorld.java create mode 100644 support/testing/tests/package/br2-external/openjdk/package/openjdk-hello-world/openjdk-hello-world.mk create mode 100644 support/testing/tests/package/test_openjdk.py diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8f1e4ae804..8a8bd29d14 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -323,6 +323,7 @@ tests.package.test_ipython.TestIPythonPy2: *runtime_test tests.package.test_ipython.TestIPythonPy3: *runtime_test tests.package.test_lua.TestLua: *runtime_test tests.package.test_lua.TestLuajit: *runtime_test +tests.package.test_openjdk.TestOpenJdk: *runtime_test tests.package.test_perl.TestPerl: *runtime_test tests.package.test_perl_class_load.TestPerlClassLoad: *runtime_test tests.package.test_perl_dbd_mysql.TestPerlDBDmysql: *runtime_test diff --git a/DEVELOPERS b/DEVELOPERS index 0893af58dc..baa325eead 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1470,6 +1470,7 @@ F: package/valijson/ F: package/wpa_supplicant/ F: package/wireless_tools/ F: package/xen/ +F: support/testing/tests/package/br2-external/openjdk/ N: Mauro Condarelli F: package/mc/ diff --git a/support/testing/tests/package/br2-external/openjdk/Config.in b/support/testing/tests/package/br2-external/openjdk/Config.in new file mode 100644 index 0000000000..00c7fd4799 --- /dev/null +++ b/support/testing/tests/package/br2-external/openjdk/Config.in @@ -0,0 +1 @@ +source "$BR2_EXTERNAL_OPENJDK_PATH/package/openjdk-hello-world/Config.in" diff --git a/support/testing/tests/package/br2-external/openjdk/external.desc b/support/testing/tests/package/br2-external/openjdk/external.desc new file mode 100644 index 0000000000..f28ba5060c --- /dev/null +++ b/support/testing/tests/package/br2-external/openjdk/external.desc @@ -0,0 +1 @@ +name: OPENJDK diff --git a/support/testing/tests/package/br2-external/openjdk/external.mk b/support/testing/tests/package/br2-external/openjdk/external.mk new file mode 100644 index 0000000000..54c24e8c64 --- /dev/null +++ b/support/testing/tests/package/br2-external/openjdk/external.mk @@ -0,0 +1 @@ +include $(sort $(wildcard $(BR2_EXTERNAL_OPENJDK_PATH)/package/*/*.mk)) diff --git a/support/testing/tests/package/br2-external/openjdk/package/openjdk-hello-world/Config.in b/support/testing/tests/package/br2-external/openjdk/package/openjdk-hello-world/Config.in new file mode 100644 index 0000000000..4f9022fb92 --- /dev/null +++ b/support/testing/tests/package/br2-external/openjdk/package/openjdk-hello-world/Config.in @@ -0,0 +1,26 @@ +config BR2_PACKAGE_OPENJDK_HELLO_WORLD + bool "openjdk hello world" + depends on BR2_PACKAGE_HOST_OPENJDK_BIN_ARCH_SUPPORTS + depends on BR2_TOOLCHAIN_USES_GLIBC + depends on BR2_PACKAGE_XORG7 + depends on BR2_USE_WCHAR # gtk2 -> glib2 + depends on BR2_TOOLCHAIN_HAS_THREADS # gtk2 -> glib2 + depends on BR2_USE_MMU # gtk2 -> glib2 + depends on BR2_INSTALL_LIBSTDCPP # gtk2, cups + depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # C++11 + depends on BR2_TOOLCHAIN_HAS_SYNC_4 # gtk2 -> pango -> harfbuzz + depends on !BR2_STATIC_LIBS + select BR2_PACKAGE_OPENJDK + help + Simple class for testing openjdk + +comment "OpenJDK-hello-world needs a glibc toolchain w/ wchar, dynamic library, threads, C++, gcc >= 4.9" + depends on BR2_USE_MMU + depends on BR2_TOOLCHAIN_HAS_SYNC_4 + depends on BR2_PACKAGE_XORG7 + depends on !BR2_USE_WCHAR || \ + BR2_STATIC_LIBS || \ + !BR2_INSTALL_LIBSTDCPP || \ + !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 || \ + !BR2_TOOLCHAIN_HAS_THREADS || \ + !BR2_TOOLCHAIN_USES_GLIBC diff --git a/support/testing/tests/package/br2-external/openjdk/package/openjdk-hello-world/HelloWorld.java b/support/testing/tests/package/br2-external/openjdk/package/openjdk-hello-world/HelloWorld.java new file mode 100644 index 0000000000..612d661cdd --- /dev/null +++ b/support/testing/tests/package/br2-external/openjdk/package/openjdk-hello-world/HelloWorld.java @@ -0,0 +1,8 @@ +public class HelloWorld +{ + public static void main(String[] args) + { + System.out.println("Hello, World"); + } + +} diff --git a/support/testing/tests/package/br2-external/openjdk/package/openjdk-hello-world/openjdk-hello-world.mk b/support/testing/tests/package/br2-external/openjdk/package/openjdk-hello-world/openjdk-hello-world.mk new file mode 100644 index 0000000000..1847a11d4f --- /dev/null +++ b/support/testing/tests/package/br2-external/openjdk/package/openjdk-hello-world/openjdk-hello-world.mk @@ -0,0 +1,18 @@ +################################################################################ +# +# openjdk hello world +# +################################################################################ + +OPENJDK_HELLO_WORLD_DEPENDENCIES = openjdk + +define OPENJDK_HELLO_WORLD_BUILD_CMDS + $(INSTALL) -D $(OPENJDK_HELLO_WORLD_PKGDIR)/HelloWorld.java $(@D)/HelloWorld.java + $(HOST_DIR)/openjdk/bin/javac $(@D)/HelloWorld.java +endef + +define OPENJDK_HELLO_WORLD_INSTALL_TARGET_CMDS + $(INSTALL) -D -m 755 $(@D)/HelloWorld.class $(TARGET_DIR)/usr/bin/HelloWorld.class +endef + +$(eval $(generic-package)) diff --git a/support/testing/tests/package/test_openjdk.py b/support/testing/tests/package/test_openjdk.py new file mode 100644 index 0000000000..ed8a1f1be4 --- /dev/null +++ b/support/testing/tests/package/test_openjdk.py @@ -0,0 +1,42 @@ +import os + +import infra.basetest + + +class TestOpenJdk(infra.basetest.BRTest): + br2_external = [infra.filepath("tests/package/br2-external/openjdk")] + config = \ + """ + BR2_aarch64=y + BR2_TOOLCHAIN_EXTERNAL=y + BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0" + BR2_LINUX_KERNEL=y + BR2_LINUX_KERNEL_CUSTOM_VERSION=y + BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.16.7" + BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y + BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/aarch64-virt/linux.config" + BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y + BR2_TARGET_ROOTFS_CPIO=y + BR2_TARGET_ROOTFS_CPIO_GZIP=y + BR2_PACKAGE_XORG7=y + BR2_PACKAGE_OPENJDK=y + BR2_PACKAGE_OPENJDK_HELLO_WORLD=y + """ + + def login(self): + img = os.path.join(self.builddir, "images", "rootfs.cpio.gz") + kern = os.path.join(self.builddir, "images", "Image") + self.emulator.boot(arch="aarch64", + kernel=kern, + kernel_cmdline=["console=ttyAMA0"], + options=["-M", "virt", "-cpu", "cortex-a57", "-m", "512M", "-initrd", img]) + self.emulator.login() + + def test_run(self): + self.login() + + cmd = "java -cp /usr/bin HelloWorld" + output, exit_code = self.emulator.run(cmd) + print(output) + self.assertEqual(exit_code, 0) + self.assertEqual(output, ["Hello, World"])