Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Thomas Claveirole <thomas.claveirole@green-communications.fr>
Cc: Daniel Price <daniel.price@gmail.com>,
	Martin Bark <martin@barkynet.com>,
	Johan Oudinet <johan.oudinet@gmail.com>,
	buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 1/2] package/nodejs: introduce BR2_PACKAGE_HOST_NODEJS_COREPACK
Date: Sun, 16 Apr 2023 21:48:20 +0200	[thread overview]
Message-ID: <20230416194820.GF2819@scaer> (raw)
In-Reply-To: <20220913174039.182887-2-thomas.claveirole@green-communications.fr>

Thomas C., All,

On 2022-09-13 19:40 +0200, Thomas Claveirole spake thusly:
> Corepack is a zero-runtime-dependency Node.js script that acts as a
> bridge between Node.js projects and the package managers.  It ships
> with Node.js but is disabled by default.
> 
> Some JavaScript packages, such as vuejs and vuejs-router can benefit
> from having Corepack installed on the host.  Therefore, add an option
> to enable Corepack with host-nodejs.
> 
> Signed-off-by: Thomas Claveirole <thomas.claveirole@green-communications.fr>

My understanding of the thread, is that  this patch was introduced to be
able to build vuejs, which you bumped in the following patch.

Yet, the consensus was that we could bump vuejs and use the pre-compiled
variant, instead of needing to build host-nodejs.

However, nothing prevents us from merging the corepack feature, and
still update to the precompiled vuejs anyway.

Given the feedback from Thomas P. in the thread, I understand that
corepack is indeed working as expected, and is not actually requiring
download during the host-nodejs build itself (using it may trigger
download in the package that calls it, but that's another issue).

So, for those who perfer to always build from source at the expense of
build time (like I am), having corepack will be a useful addition.

Applied to master, thanks.

Regards,
Yann E. MORIN.

> ---
>  package/nodejs/Config.in.host | 23 ++++++++++++++++++++---
>  package/nodejs/nodejs.mk      | 21 +++++++++++++++++----
>  2 files changed, 37 insertions(+), 7 deletions(-)
> 
> diff --git a/package/nodejs/Config.in.host b/package/nodejs/Config.in.host
> index 4ceaf0c73e..316a02d9d6 100644
> --- a/package/nodejs/Config.in.host
> +++ b/package/nodejs/Config.in.host
> @@ -1,3 +1,7 @@
> +comment "host nodejs needs a host gcc >= 8"
> +	depends on BR2_PACKAGE_HOST_QEMU_USER_ARCH_SUPPORTS
> +	depends on !BR2_HOST_GCC_AT_LEAST_8
> +
>  config BR2_PACKAGE_HOST_NODEJS
>  	bool "host nodejs"
>  	depends on BR2_PACKAGE_HOST_QEMU_USER_ARCH_SUPPORTS
> @@ -13,6 +17,19 @@ config BR2_PACKAGE_HOST_NODEJS
>  
>  	  http://nodejs.org/
>  
> -comment "host nodejs needs a host gcc >= 8"
> -	depends on BR2_PACKAGE_HOST_QEMU_USER_ARCH_SUPPORTS
> -	depends on !BR2_HOST_GCC_AT_LEAST_8
> +if BR2_PACKAGE_HOST_NODEJS
> +
> +config BR2_PACKAGE_HOST_NODEJS_COREPACK
> +	bool "Corepack"
> +	help
> +	  Enable Corepack with host nodejs.
> +
> +	  Corepack is a zero-runtime-dependency Node.js script that
> +	  acts as a bridge between Node.js projects and the package
> +	  managers they are intended to be used with during
> +	  development. In practical terms, Corepack will let you use
> +	  Yarn and pnpm without having to install them - just like
> +	  what currently happens with npm, which is shipped by Node.js
> +	  by default.
> +
> +endif
> diff --git a/package/nodejs/nodejs.mk b/package/nodejs/nodejs.mk
> index 3154dcd7ec..1a95e1351f 100644
> --- a/package/nodejs/nodejs.mk
> +++ b/package/nodejs/nodejs.mk
> @@ -117,6 +117,12 @@ define HOST_NODEJS_BUILD_CMDS
>  		$(HOST_NODEJS_MAKE_OPTS)
>  endef
>  
> +ifeq ($(BR2_PACKAGE_HOST_NODEJS_COREPACK),y)
> +define HOST_NODEJS_ENABLE_COREPACK
> +	$(COREPACK) enable
> +endef
> +endif
> +
>  define HOST_NODEJS_INSTALL_CMDS
>  	$(HOST_MAKE_ENV) PYTHON=$(HOST_DIR)/bin/python3 \
>  		$(MAKE) -C $(@D) install \
> @@ -125,6 +131,7 @@ define HOST_NODEJS_INSTALL_CMDS
>  	$(foreach f,$(NODEJS_HOST_TOOLS), \
>  		$(INSTALL) -m755 -D $(@D)/out/Release/$(f) $(HOST_DIR)/bin/$(f)
>  	)
> +	$(HOST_NODEJS_ENABLE_COREPACK)
>  endef
>  
>  ifeq ($(BR2_i386),y)
> @@ -235,8 +242,7 @@ endef
>  NODEJS_MODULES_LIST= $(call qstrip,\
>  	$(BR2_PACKAGE_NODEJS_MODULES_ADDITIONAL))
>  
> -# Define NPM for other packages to use
> -NPM = $(TARGET_CONFIGURE_OPTS) \
> +NODEJS_BIN_ENV = $(TARGET_CONFIGURE_OPTS) \
>  	LDFLAGS="$(NODEJS_LDFLAGS)" \
>  	LD="$(TARGET_CXX)" \
>  	npm_config_arch=$(NODEJS_CPU) \
> @@ -244,8 +250,15 @@ NPM = $(TARGET_CONFIGURE_OPTS) \
>  	npm_config_build_from_source=true \
>  	npm_config_nodedir=$(BUILD_DIR)/nodejs-$(NODEJS_VERSION) \
>  	npm_config_prefix=$(TARGET_DIR)/usr \
> -	npm_config_cache=$(BUILD_DIR)/.npm-cache \
> -	$(HOST_DIR)/bin/npm
> +	npm_config_cache=$(BUILD_DIR)/.npm-cache
> +
> +# Define various packaging tools for other packages to use
> +NPM = $(NODEJS_BIN_ENV) $(HOST_DIR)/bin/npm
> +ifeq ($(BR2_PACKAGE_HOST_NODEJS_COREPACK),y)
> +COREPACK = $(NODEJS_BIN_ENV) $(HOST_DIR)/bin/corepack
> +PNPM = $(NODEJS_BIN_ENV) $(HOST_DIR)/bin/pnpm
> +YARN = $(NODEJS_BIN_ENV) $(HOST_DIR)/bin/yarn
> +endif
>  
>  #
>  # We can only call NPM if there's something to install.
> -- 
> 2.37.2
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  parent reply	other threads:[~2023-04-16 19:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-13 17:40 [Buildroot] [PATCH 0/2] Update host-nodejs and build vuejs from source Thomas Claveirole
2022-09-13 17:40 ` [Buildroot] [PATCH 1/2] package/nodejs: introduce BR2_PACKAGE_HOST_NODEJS_COREPACK Thomas Claveirole
2022-09-25 19:47   ` Thomas Petazzoni
2022-09-25 19:53     ` Thomas Petazzoni
2022-09-26  9:04       ` Thomas Claveirole
2022-09-26 10:01         ` Thomas Petazzoni
2022-09-26 10:17           ` Johan Oudinet
2022-09-26 10:24             ` Thomas Petazzoni
2023-04-16 19:48   ` Yann E. MORIN [this message]
2022-09-13 17:40 ` [Buildroot] [PATCH 2/2] package/vuejs: bump to version 3.2.39 Thomas Claveirole

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230416194820.GF2819@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@buildroot.org \
    --cc=daniel.price@gmail.com \
    --cc=johan.oudinet@gmail.com \
    --cc=martin@barkynet.com \
    --cc=thomas.claveirole@green-communications.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox