From nobody Fri Jun 23 11:11:41 2023 X-Original-To: freebsd-ports@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QnZLm3NFtz4h9sg for ; Fri, 23 Jun 2023 11:11:44 +0000 (UTC) (envelope-from tagattie@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QnZLm2sZSz3wbG; Fri, 23 Jun 2023 11:11:44 +0000 (UTC) (envelope-from tagattie@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687518704; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2LV92O6qDK9KG6DLOriOmnMcVUacxXcTnEtWu6n6IEo=; b=wpHkIFyLdqJMpUrjsrCx95tRnoZSvWLMF7hpx3nFeEZjwWaC9S5gkx6/mw3dwCMN7cxE47 NcWHxydYyKVopdl3M30DrjRP9o2Pj+muE+iEz+Oyq3J+fzwGCH057EDDLmgeIoExEiGeJn /tfnbO8xbiL7E4DD0zJYcmjM9NWUpkkqCBBr9TS0fwdeg3BCynxxApxKMlmTYuWhDvVsiY b20BxwfoChqd+wJuvljBEDB+SSVe0Zi4ZYkfaNKjEgQrQKTSBgpzHF5peJFfYfV703srdJ e6lX/z2yOpNyu3p1H0AXmv+fRy2d5m5zO2XaeYizuLhgkZuWiouE2ZBks6ETLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687518704; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2LV92O6qDK9KG6DLOriOmnMcVUacxXcTnEtWu6n6IEo=; b=ow03xZ+1DmlsT3ZDQNP8wOS+FWAoUL539Hn3RXAuxaETcL28/dOTcJX4ZFnRX4SSH6Yw/Z pkX9s79B0cGOFyFsyineIjT+p9FcSMgdzJLE0O3ez4y+iW0hDQWwHwLxnkTZgfjuwI/IZK VhYQqFJ4BdvgfjZhRZ567+8OAXoQ8SsvUfFOChBKPvGhJuWnfmsxrbentjezOBxrqpwGem nV1/COABaA8M2jFiV7VaFiXZo4GHmvEQ9+uPiwQZaz5EvobbdZXwb5jz2Qaq9McIgAJ519 YbABJfJM5n04c/JdwSESOM+Lo+asR0TxEcMTJD1TrSMDwI/4u7fGR4wlo1VUyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687518704; a=rsa-sha256; cv=none; b=O7LD8T6NgtIMaaK3a/o+bGp66KgumEFOAVQWuJTnMMvXmJFzQY91wYpw/QGESYjbEyV1Ch k35mMQVMnJyAy9cf+Vr/puzYS8dQmrGkPz2EF1YBaoOrywn2phuaumhdaV0zerE0sIojGi OxHnRI0kSSaVxjr2sNaRfy9pzmEO3XSUC/lhRbmvZtO/6BwmSTdL5UYJX8ORAXhEZfCC4B zE8uG1Ms7pqmP4FxnO/FFqlIHFukHCSebGvjzqi4rPIkeSdPMetwVt/lHmNETbLWFCO4x8 WKGjcueqE7ojXOKkIqXFgMZ5ExCL8EhKLwv4JdP7ueHwlMgRiajF/+am+YnfcQ== Received: from [IPV6:2409:11:22a0:8900::34] (unknown [IPv6:2409:11:22a0:8900::34]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) (Authenticated sender: tagattie/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4QnZLl3smrzQSH; Fri, 23 Jun 2023 11:11:43 +0000 (UTC) (envelope-from tagattie@FreeBSD.org) Message-ID: <5be6c0d2-5d71-38c9-028a-8ce065102be9@FreeBSD.org> Date: Fri, 23 Jun 2023 20:11:41 +0900 List-Id: Porting software to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-ports List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ports@freebsd.org X-BeenThere: freebsd-ports@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: Is it possible to build node package as single executable binary? Content-Language: en-US To: Miroslav Lachman <000.fbsd@quip.cz>, FreeBSD Ports References: From: Hiroki Tagato In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ThisMailContainsUnwantedMimeParts: N Hi Miroslav, I have a WIP port of Bitwarden CLI in my forked ports repository. Take a look at: https://github.com/tagattie/freebsd-ports/tree/main/security/bitwarden-cli It generates a single binary executable "bw" by packaging the node command and necessary node modules. I have only lightly tested the package on FreeBSD 13/amd64 and it seems working. Hope this helps. Cheers, Hiroki On 2023/06/23 5:44, Miroslav Lachman wrote: > Node.js / npm packages can be built in to single executable binary > containing all node modules and node.js executable = everything packaged > in one large executable, but by default it works for Win, Mac and Linux, > not for FreeBSD. > > Is there somebody successfully using it on FreeBSD? > > I would like to build Bitwarden's CLI command "bw" > https://bitwarden.com/help/cli/ > It can be installed on FreeBSD by "npm install @bitwarden/cli" and it > works but can easily break with Node.js upgrade, that's why I would > prefer to build it as single executable as it is distributed for Win, > Max and Linux (it is called "Native executable" on Bitwearden's web) > > Source code is on Github > https://github.com/bitwarden/clients/tree/master/apps/cli > > But I don't know how to build only apps/cli (npm install in this > subdirectory failed with missing modules and npm install in top level > failed on electron install, because it tries to build everything, not > only CLI bw) > > Info for npm pkg https://github.com/vercel/pkg > > I am not node / JS developer, my knowledge of building node packages > with npm / npx is very limited. > Any help is really appreciated. > > > Kind regards > Miroslav Lachman