Re: [Buildroot] [PATCH 2/2] package/sass: new package

Thomas Petazzoni via buildroot <[email protected]>
Newsgroups net.busybox.buildroot
Message-ID <anmxxqb2-h3Fy_f-@windsurf>
Hello,

On Mon, Aug 10, 2026 at 11:29:01AM +0200, Alexis Lothoré wrote:

> Yes, this `npm install` downloads 3 dependencies for this sass tool.
> I understand that it is not ideal (having some download in the build
> step), but proposed it anyway, as it was a potential "known issue" in
> Arnout's proposal ([1]). But if this is finally a no-go, thinking a bit
> more about it, I see two main options:
> - find a way to vendor the dependencies (may be as simple as setting a
>   post download hook which performs the npm install ?)

This is what Arnout was proposing. However, a post download hook
doesn't work because it's too late: the tarball has already been
created, while we want the dependencies to be *part* of the tarball,
i.e we want the vendoring (collecting the dependencies) to happen
prior to the tarball being created and added to $(DL_DIR).

Instead, you should have a look at how it works for the cargo and
golang infrastructures.

We have this concept of <pkg>_DOWNLOAD_POST_PROCESS (which is NOT the
same as <pkg>_POST_DOWNLOAD_HOOKS!).

package/pkg-cargo.mk does:

$(2)_DOWNLOAD_POST_PROCESS = cargo

which causes support/download/cargo-post-process to be called in the
middle of the download step.

What it does is basically:

1. Unpack the tarball that was downloaded
2. Run "cargo vendor" to download the dependencies
3. Repack the tarball

support/download/go-post-process works in a similar manner, but runs
"go mod vendor" to download the dependencies.

If you can identify the right incantation to ask npm to download the
dependencies so that we can implement something like this, then it
would be great.

> - this sass package is a node wrapper around the official project
>   dart-sass ([2]). I did not take a look at all at how to build and run
>   it (I am pretty ignorant in Dart), but I can take a look. I am not
>   sure how capable Buildroot is about building Dart projects (I see some
>   flutter-sdk-bin package, I am not sure how re-usable it could be to
>   build some randome dart projects)

I have also no idea :-)

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.