From patchwork Wed Mar 8 13:15:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sebastian Weyer X-Patchwork-Id: 1754068 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=140.211.166.133; helo=smtp2.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PWtB34Qg8z1yWr for ; Thu, 9 Mar 2023 00:16:27 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id B37E940C00; Wed, 8 Mar 2023 13:16:25 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org B37E940C00 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id o-iP_uUwCMY2; Wed, 8 Mar 2023 13:16:24 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id C3C5B404F7; Wed, 8 Mar 2023 13:16:23 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org C3C5B404F7 X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 3F4CE1BF3EA for ; Wed, 8 Mar 2023 13:16:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 1A69840292 for ; Wed, 8 Mar 2023 13:16:10 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 1A69840292 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6ANEi8IkC0rn for ; Wed, 8 Mar 2023 13:16:05 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 9D0FB400DD Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by smtp2.osuosl.org (Postfix) with ESMTPS id 9D0FB400DD for ; Wed, 8 Mar 2023 13:16:04 +0000 (UTC) Received: by mail-wm1-x335.google.com with SMTP id az36so9794930wmb.1 for ; Wed, 08 Mar 2023 05:16:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678281362; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=OsVU/Zk1CqKLWTrgJveU1yFf4S5KqM0w+6eacVZFoWc=; b=eMXuk4JwE1PDy0r2qSePB7GQhpne94NDlUHQQYeYOWVdJiH6LHEmITmKpyJ24uvL46 Y+p9rQX7Lo3KEsMpAPWXoIbt6P4jKtSUqhM1NkXFh3HrOh2o2KkpqUFe6uRbmzEnPxPm CcZs+dI3DAarWvV0dApeynaOpEZhCCgpZfDufVQF/AGoU1CG7MNl0QkNxcKR21FjHryr pE5GcewYGhmDTjhaopSpagB+o6M9EQWkAmkKtkSclY4QL1KehqX0jV1B0CaRy/9qrYAL 1xXVs6n8oYXvKkZUWdMHmGSXtcw0t8b3jXwYZXHN/pOKk5ceeWy6WlLWdMQ6vI15N/u+ viUg== X-Gm-Message-State: AO0yUKUWazMFC8BS4xEQU9gQ2ajEwwQX8eQ6Qur3sinmq8pqAXpDrsFJ w3IjlbwTZuoCxOh76f9X5oxBKj+sOA4u5H4LhQo= X-Google-Smtp-Source: AK7set+nbkOjPQKbQTXRFJKe73JJK+lL2fDQv5s3ex1oQeD8REmUEuP5HwwGAc/1MpZZX46QKt+Yzg== X-Received: by 2002:a05:600c:1c9e:b0:3ea:f883:180 with SMTP id k30-20020a05600c1c9e00b003eaf8830180mr16024713wms.7.1678281362353; Wed, 08 Mar 2023 05:16:02 -0800 (PST) Received: from P-NAN-LIMA.lan ([2001:861:5384:6b50:3078:ab00:ee8d:4e07]) by smtp.gmail.com with ESMTPSA id bi25-20020a05600c3d9900b003e89e3284fasm19677624wmb.36.2023.03.08.05.16.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 05:16:02 -0800 (PST) From: Sebastian Weyer To: buildroot@buildroot.org Date: Wed, 8 Mar 2023 14:15:51 +0100 Message-Id: <20230308131554.642965-1-sebastian.weyer@smile.fr> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile-fr.20210112.gappssmtp.com; s=20210112; t=1678281362; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=OsVU/Zk1CqKLWTrgJveU1yFf4S5KqM0w+6eacVZFoWc=; b=1qIPVpmEwvTl8ao/21AvlRSzsd1OUkLYFpSvl0UmRsfxZK/jeu4Cau+3d5g9FSxORq gUsg6SOOYEqZkS0OWHkvndQ8MHbopR8vNSmBShw+txE9FKzm977+YMyhdWgdWMpNMRJ4 sL0rKNyd2P2/rDeTuayOjMTXF9WgkTTsEifqS8Ol8gC6bsVIl5VFnditB+4apmSZRJCH L3JZDnyuUWNjb8sDtwRc7LxTye5bMpKPTRPbLF/kV9Nu3MKOkBTSbxZuG/fjAJ9KPCMW Gf1eqfibiP98PcaaQ1v80GtjqqsWEOA9lfScC3CpDDU+XRy+p5/i6zudQhlym5QTSJno hYXg== X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key) header.d=smile-fr.20210112.gappssmtp.com header.i=@smile-fr.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=1qIPVpmE Subject: [Buildroot] [PATCH v6 1/3] package/nushell: new package X-BeenThere: buildroot@buildroot.org 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: Sebastian Weyer Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" Nushell is a shell - written in Rust - that makes use of the nushell language to interact with the operating system Signed-off-by: Sebastian Weyer --- This new version adds ncurses-target-progs as a dependency which is a hidden dependency of nushell. With this option enabled, nushell is also usable without specifically replacing getty by agetty. Nushell is not POSIX compliant and therefore should not be used as login shell since some programs might assume a POSIX-compliant shell and therefore break the system. Signed-off-by: Sebastian Weyer --- DEVELOPERS | 3 +++ package/Config.in | 1 + package/nushell/Config.in | 12 ++++++++++++ package/nushell/nushell.hash | 3 +++ package/nushell/nushell.mk | 20 ++++++++++++++++++++ 5 files changed, 39 insertions(+) create mode 100644 package/nushell/Config.in create mode 100644 package/nushell/nushell.hash create mode 100644 package/nushell/nushell.mk diff --git a/DEVELOPERS b/DEVELOPERS index 6256576e02..9e3855423e 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -2550,6 +2550,9 @@ F: support/misc/toolchainfile.cmake.in N: Sam Voss F: package/ripgrep/ +N: Sebastian Weyer +F: package/nushell/ + N: Sébastien Szymanski F: package/mmc-utils/ F: package/python-flask-jsonrpc/ diff --git a/package/Config.in b/package/Config.in index 3ace25c665..7fca46afb5 100644 --- a/package/Config.in +++ b/package/Config.in @@ -2577,6 +2577,7 @@ comment "Shells" source "package/bash/Config.in" source "package/dash/Config.in" source "package/mksh/Config.in" + source "package/nushell/Config.in" source "package/zsh/Config.in" comment "Utilities" source "package/apg/Config.in" diff --git a/package/nushell/Config.in b/package/nushell/Config.in new file mode 100644 index 0000000000..edb01d2f72 --- /dev/null +++ b/package/nushell/Config.in @@ -0,0 +1,12 @@ +config BR2_PACKAGE_NUSHELL + bool "nushell" + depends on BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS + select BR2_PACKAGE_HOST_RUSTC + select BR2_PACKAGE_OPENSSL + select BR2_PACKAGE_HOST_PKGCONF + select BR2_PACKAGE_NCURSES + select BR2_PACKAGE_NCURSES_TARGET_PROGS + help + A new type of shell. + + https://github.com/nushell/nushell diff --git a/package/nushell/nushell.hash b/package/nushell/nushell.hash new file mode 100644 index 0000000000..b553a6c2bc --- /dev/null +++ b/package/nushell/nushell.hash @@ -0,0 +1,3 @@ +# Locally generated +sha256 352e807698d5f95e9bfdd9dd5512acab3cbef315379299a32e5f322a76eb718a nushell-0.76.0.tar.gz +sha256 e189616e535e9f7bf410a72e6fc51ad1e0ae461c58d592e186c2669daa5d1e5d LICENSE diff --git a/package/nushell/nushell.mk b/package/nushell/nushell.mk new file mode 100644 index 0000000000..b9c1ee6434 --- /dev/null +++ b/package/nushell/nushell.mk @@ -0,0 +1,20 @@ +################################################################################ +# +# nushell +# +################################################################################ + +NUSHELL_VERSION = 0.76.0 +NUSHELL_SITE = $(call github,nushell,nushell,$(NUSHELL_VERSION)) +NUSHELL_LICENSE = MIT +NUSHELL_LICENSE_FILES = LICENSE +NUSHELL_DEPENDENCIES = host-pkgconf openssl ncurses + +# Add /usr/bin/nu to /etc/shells as in package/bash/bash.mk +define NUSHELL_ADD_NU_TO_SHELLS + grep -qsE '^/usr/bin/nu$$' $(TARGET_DIR)/etc/shells \ + || echo "/usr/bin/nu" >> $(TARGET_DIR)/etc/shells +endef +NUSHELL_TARGET_FINALIZE_HOOKS += NUSHELL_ADD_NU_TO_SHELLS + +$(eval $(cargo-package)) From patchwork Wed Mar 8 13:15:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Weyer X-Patchwork-Id: 1754067 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::133; helo=smtp2.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PWt9q3kfZz1yWr for ; Thu, 9 Mar 2023 00:16:15 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 27CD440BFE; Wed, 8 Mar 2023 13:16:13 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 27CD440BFE X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id q4mQzZHCQyZ3; Wed, 8 Mar 2023 13:16:12 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id 4494B40292; Wed, 8 Mar 2023 13:16:11 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 4494B40292 X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id E9A151BF3EA for ; Wed, 8 Mar 2023 13:16:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id D155F40292 for ; Wed, 8 Mar 2023 13:16:09 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org D155F40292 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dRoxMLXox41D for ; Wed, 8 Mar 2023 13:16:06 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org D550B404F7 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by smtp2.osuosl.org (Postfix) with ESMTPS id D550B404F7 for ; Wed, 8 Mar 2023 13:16:05 +0000 (UTC) Received: by mail-wr1-x42d.google.com with SMTP id v16so15388955wrn.0 for ; Wed, 08 Mar 2023 05:16:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678281364; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RrNzdSKpyClGd83dC9XpRGeGCVHw0agBqoP+fdLp/PQ=; b=G9gbkwg2KUP41QyyXsosX0kRT4FFbmhg/CdlMyyK4yJhfCWKaxU/CeLDAwYwaOQU1Z dfC6xLdF/7zt2MQBXCqf+UZlBOAygbpr8gixqqSrkGDqvrbYoVOVxnrNiW/s2f3IIQOE 4sr0/ABJt81h/csMjYd8Jl0RHrYWauiW+wnzDPNJ6DWFsRZZOgexzLJ9RWt5cFGxeXqm MMahVGMaWt+cDTddU/bwLK4/apgpDxN2TFPVPjvOOV+qlOSHVGfUU9x6qqXLHPW3CcAf EeFQp34K8dyXGGQJyrwfhuL0yc/TSe+vA8MMMll+N7o26rRMnqRoWDeezT0tjFS4GVoN S8WQ== X-Gm-Message-State: AO0yUKXEjorznqlVIHHZyPeAoMiHsELCuHDJ7zRH2R6ZCT1Dbbu+Y5Vq dTwa+NvEHYelt4r2PxdZdjBjRDWyWKAK3Axod5Q= X-Google-Smtp-Source: AK7set+Wmfi1WoyTWpf7M25rlMVp6sdwMJ3zoJMnwFVglFvMAHRTH99FEXX1qAM6qwlDPCNhPpykBw== X-Received: by 2002:a5d:4001:0:b0:2cc:be:be0 with SMTP id n1-20020a5d4001000000b002cc00be0be0mr10444402wrp.41.1678281363734; Wed, 08 Mar 2023 05:16:03 -0800 (PST) Received: from P-NAN-LIMA.lan ([2001:861:5384:6b50:3078:ab00:ee8d:4e07]) by smtp.gmail.com with ESMTPSA id bi25-20020a05600c3d9900b003e89e3284fasm19677624wmb.36.2023.03.08.05.16.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 05:16:03 -0800 (PST) From: Sebastian Weyer To: buildroot@buildroot.org Date: Wed, 8 Mar 2023 14:15:52 +0100 Message-Id: <20230308131554.642965-2-sebastian.weyer@smile.fr> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230308131554.642965-1-sebastian.weyer@smile.fr> References: <20230308131554.642965-1-sebastian.weyer@smile.fr> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile-fr.20210112.gappssmtp.com; s=20210112; t=1678281364; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=RrNzdSKpyClGd83dC9XpRGeGCVHw0agBqoP+fdLp/PQ=; b=AccpbdcyIj83zh3XEPsr/qEnVUjX9F9cQm3u0MmZ0ogS8SObGFatmpm8TdCrw9g0LB VH3ru4GeukOJt7y8nlKVdmo+b1ZjWrtApf1Z6H48OHLslAddE7Bsn4Y3jzB0Q1HpD9NC oRAmiygVHh2QMJ42wUHZit1XntRerTYYWv4X5/+6W9hvQhLW6pFfiEYAn09LthPBhiQ0 em9qG4VizkeSWPCBOXespFWcZtbVNYTlrDz0p14rZcNwsMrBTk+V4EkvvcJhXcgPK3/a H9NTNmfJ72bsir/dHuWmM0fZV81KZl+MmAoK9km1G3RCwNAayT1rTFGgekdhe8/HCCb1 5voA== X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key) header.d=smile-fr.20210112.gappssmtp.com header.i=@smile-fr.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=Accpbdcy Subject: [Buildroot] [PATCH v6 2/3] package/nushell: Add default configs X-BeenThere: buildroot@buildroot.org 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: Sebastian Weyer Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" Automatically place default files for the nushell environment and config in the appropriate folder to avoid the prompt at startup, asking if you want to create them. Signed-off-by: Sebastian Weyer --- These default configs are optional and might not even be necessary, they only prevent the prompt at the first startup of the shell --- package/nushell/nushell.mk | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/package/nushell/nushell.mk b/package/nushell/nushell.mk index b9c1ee6434..8ac3045c9f 100644 --- a/package/nushell/nushell.mk +++ b/package/nushell/nushell.mk @@ -10,6 +10,14 @@ NUSHELL_LICENSE = MIT NUSHELL_LICENSE_FILES = LICENSE NUSHELL_DEPENDENCIES = host-pkgconf openssl ncurses +define NUSHELL_INSTALL_DEFAULT_CONFIG + $(INSTALL) -m 0644 -D $(@D)/crates/nu-utils/src/sample_config/default_config.nu \ + $(TARGET_DIR)/root/.config/nushell/config.nu + $(INSTALL) -m 0644 -D $(@D)/crates/nu-utils/src/sample_config/default_env.nu \ + $(TARGET_DIR)/root/.config/nushell/env.nu +endef +NUSHELL_POST_INSTALL_TARGET_HOOKS += NUSHELL_INSTALL_DEFAULT_CONFIG + # Add /usr/bin/nu to /etc/shells as in package/bash/bash.mk define NUSHELL_ADD_NU_TO_SHELLS grep -qsE '^/usr/bin/nu$$' $(TARGET_DIR)/etc/shells \ From patchwork Wed Mar 8 13:15:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sebastian Weyer X-Patchwork-Id: 1754069 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=140.211.166.133; helo=smtp2.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PWtBJ1z17z1yWr for ; Thu, 9 Mar 2023 00:16:40 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 5D25D40292; Wed, 8 Mar 2023 13:16:38 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 5D25D40292 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ywNr_PQhrFHv; Wed, 8 Mar 2023 13:16:37 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id 73D7140C01; Wed, 8 Mar 2023 13:16:36 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 73D7140C01 X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 669991BF94D for ; Wed, 8 Mar 2023 13:16:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 3F2D3410E7 for ; Wed, 8 Mar 2023 13:16:10 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 3F2D3410E7 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VtZo3afTL68l for ; Wed, 8 Mar 2023 13:16:07 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 8601740A00 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by smtp4.osuosl.org (Postfix) with ESMTPS id 8601740A00 for ; Wed, 8 Mar 2023 13:16:07 +0000 (UTC) Received: by mail-wm1-x331.google.com with SMTP id o11-20020a05600c4fcb00b003eb33ea29a8so1129623wmq.1 for ; Wed, 08 Mar 2023 05:16:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678281365; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=16ZNoxZhc+vRoCXxROau6Sf2qj665W/vy2YWFMHoVe8=; b=g578ml+w4ihe0YmTpEO7gFEi4qH8tjLTKnNaUCaMBOyT+xzt8Kjb2chWiatqTLilGe fxuZcOpuDZpiUjx5CY2NzQHjVLrPu6plMRFPff08Hn/QEzz1QL0iYLYqyFt2qoZduNjY EjQR1tAzbVg44rBmJH5zyHNaPlwOtdRwJw1qXwy1ZjZ0qklyNTslxxXNdKaLNPrgNkj+ 8eO6hT/A4W+1+zqFI0nsCQkeKHXIGWrYqq/6SZKgjqZbaxncZ3iC3O1MAUFbn1eX1ezN MpLcH9asSy2ic6obhclslZe02vgP8UXXHKPhm5YkWL+dtKISgOFLs4bHPNsEL6JGoU0M 8nFQ== X-Gm-Message-State: AO0yUKVZPXQvY4OdJsTI1dNiwH4M9xN4bbPnY4ic2ZKNjdqA5EzR/ykC HHI5gCeRgaef8eEVOt9drP3ijHYx/ZSz5YGkd8o= X-Google-Smtp-Source: AK7set9WLc0NzWaJjDHj4ibuxUHXMk8kHK8MSSo+SKIZUjxahUgx/56zHKJZfXHyIznp4CAL5wxDyw== X-Received: by 2002:a05:600c:1c20:b0:3eb:3945:d3f9 with SMTP id j32-20020a05600c1c2000b003eb3945d3f9mr16889320wms.4.1678281365358; Wed, 08 Mar 2023 05:16:05 -0800 (PST) Received: from P-NAN-LIMA.lan ([2001:861:5384:6b50:3078:ab00:ee8d:4e07]) by smtp.gmail.com with ESMTPSA id bi25-20020a05600c3d9900b003e89e3284fasm19677624wmb.36.2023.03.08.05.16.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 05:16:04 -0800 (PST) From: Sebastian Weyer To: buildroot@buildroot.org Date: Wed, 8 Mar 2023 14:15:53 +0100 Message-Id: <20230308131554.642965-3-sebastian.weyer@smile.fr> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230308131554.642965-1-sebastian.weyer@smile.fr> References: <20230308131554.642965-1-sebastian.weyer@smile.fr> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile-fr.20210112.gappssmtp.com; s=20210112; t=1678281365; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=16ZNoxZhc+vRoCXxROau6Sf2qj665W/vy2YWFMHoVe8=; b=xkx4vjszUnLBJUmOV7emTEO86KKDRsY1I/tVumKfQYK4jN7LI48aiwvNyVZjdm9n/n x4YeX7vfQLwmj2Ljx0WFEwboir62B/jsd+Xp56xwGqq0Uuu9KwTRt8EVK8tpCE/0FnN5 CB5/rAftT0yor70cN/PJspYIfog3D9hJWMLNrUYN0HZXWJNCAIJv/s8JGyNzphugZVmN sIL0n9Pyj7upgtccPkzs95Y1TGPLK0mTLT9W6LP7MgMXhilvrgug9rkFpw5Dih5pWa5d ZC5HaYUkxqDfCOLygUCfrfuGpHyWw9LyCGLeF8UInNFevQKZvCkfYAaaocWYf8+9a6Ak +cdA== X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key) header.d=smile-fr.20210112.gappssmtp.com header.i=@smile-fr.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=xkx4vjsz Subject: [Buildroot] [PATCH v6 3/3] support/testing/tests/package/test_nu.py: New runtime test X-BeenThere: buildroot@buildroot.org 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: Sebastian Weyer Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" Load sample script support/testing/tests/package/sample_nu.nu onto the target and verify proper execution by nushell Signed-off-by: Sebastian Weyer --- DEVELOPERS | 2 + support/testing/tests/package/sample_nu.nu | 6 +++ support/testing/tests/package/test_nu.py | 62 ++++++++++++++++++++++ 3 files changed, 70 insertions(+) create mode 100644 support/testing/tests/package/sample_nu.nu create mode 100644 support/testing/tests/package/test_nu.py diff --git a/DEVELOPERS b/DEVELOPERS index 9e3855423e..9a7257c4b2 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -2552,6 +2552,8 @@ F: package/ripgrep/ N: Sebastian Weyer F: package/nushell/ +F: support/testing/tests/package/test_nu.py +F: support/testing/tests/package/sample_nu.nu N: Sébastien Szymanski F: package/mmc-utils/ diff --git a/support/testing/tests/package/sample_nu.nu b/support/testing/tests/package/sample_nu.nu new file mode 100644 index 0000000000..5287862cf1 --- /dev/null +++ b/support/testing/tests/package/sample_nu.nu @@ -0,0 +1,6 @@ +#! /usr/bin/nu +def greet [name] { + ["hello" $name] +} + +greet "world" diff --git a/support/testing/tests/package/test_nu.py b/support/testing/tests/package/test_nu.py new file mode 100644 index 0000000000..ba2ddb9851 --- /dev/null +++ b/support/testing/tests/package/test_nu.py @@ -0,0 +1,62 @@ +import os + +import infra.basetest + +class TestNuBase(infra.basetest.BRTest): + # infra.basetest.BASIC_TOOLCHAIN_CONFIG cannot be used as it doesn't + # support a host rustc which is necessary for nushell + config = \ + """ + BR2_arm=y + BR2_cortex_a9=y + BR2_ARM_ENABLE_NEON=y + BR2_ARM_ENABLE_VFP=y + BR2_TOOLCHAIN_EXTERNAL=y + BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0" + BR2_SYSTEM_DHCP="eth0" + BR2_PACKAGE_NUSHELL=y + BR2_TARGET_ROOTFS_CPIO=y + """ + + def login(self): + img = os.path.join(self.builddir, "images", "rootfs.cpio") + self.emulator.boot(arch="armv7", + kernel="builtin", + options=["-initrd",img]) + self.emulator.login() + +# load a script on the target and check if it is executed correctly by nu +class TestNu(TestNuBase): + config_sample_scripts = \ + """ + BR2_ROOTFS_POST_BUILD_SCRIPT="{}" + BR2_ROOTFS_POST_SCRIPT_ARGS="{}" + """.format(infra.filepath("tests/package/copy-sample-script-to-target.sh"), + "{sample_scripts}") + + #simple hello world script found in the nushell doc + sample_scripts = ["tests/package/sample_nu.nu"] + + def __init__(self, names): + """Add the scripts to the target in build time.""" + super(TestNuBase, self).__init__(names) + scripts = [infra.filepath(s) for s in self.sample_scripts] + self.config += self.config_sample_scripts.format(sample_scripts=" ".join(scripts)) + + def check_sample_scripts_exist(self): + """Check the scripts were really added to the image.""" + scripts = [os.path.basename(s) for s in self.sample_scripts] + cmd = "md5sum " + " ".join(scripts) + _, exit_code = self.emulator.run(cmd) + self.assertEqual(exit_code, 0) + + def run_sample_scripts(self): + """Run each script previously added to the image.""" + for script in self.sample_scripts: + cmd = "nu " + os.path.basename(script) + self.assertRunOk(cmd) + + def test_run(self): + self.login() + self.check_sample_scripts_exist() + self.run_sample_scripts()