From 2f10c019167dd38ee5d320dc67316e7534a72246 Mon Sep 17 00:00:00 2001 From: "Lance R. Vick" Date: Wed, 31 Jan 2024 14:17:09 -0800 Subject: [PATCH] WIP nodejs --- src/core/build.mk | 21 ++ src/core/nodejs/Dockerfile | 50 ++++ src/core/nodejs/rust-feature-tables.patch | 305 ++++++++++++++++++++++ 3 files changed, 376 insertions(+) create mode 100644 src/core/nodejs/Dockerfile create mode 100644 src/core/nodejs/rust-feature-tables.patch diff --git a/src/core/build.mk b/src/core/build.mk index a1f434c..ae79d15 100644 --- a/src/core/build.mk +++ b/src/core/build.mk @@ -4,6 +4,7 @@ core: \ out/go.tgz \ out/python.tgz \ out/perl.tgz \ + out/nodejs.tgz \ out/gcc.tgz \ out/llvm.tgz @@ -137,6 +138,26 @@ out/python.tgz: \ out/musl.tgz $(call build,core,python) +out/nodejs.tgz: \ + out/gcc.tgz \ + out/busybox.tgz \ + out/openssl.tgz \ + out/python.tgz \ + out/ninja.tgz \ + out/make.tgz \ + out/musl.tgz + $(call build,core,nodejs) + +out/npm.tgz: \ + out/gcc.tgz \ + out/busybox.tgz \ + out/openssl.tgz \ + out/python.tgz \ + out/ninja.tgz \ + out/make.tgz \ + out/musl.tgz + $(call build,core,nodejs) + out/ninja.tgz: \ out/busybox.tgz \ out/gcc.tgz \ diff --git a/src/core/nodejs/Dockerfile b/src/core/nodejs/Dockerfile new file mode 100644 index 0000000..cfaba46 --- /dev/null +++ b/src/core/nodejs/Dockerfile @@ -0,0 +1,50 @@ +ARG REGISTRY=local +FROM ${REGISTRY}/busybox as busybox +FROM ${REGISTRY}/gcc as gcc +FROM ${REGISTRY}/musl as musl +FROM ${REGISTRY}/openssl as openssl +FROM ${REGISTRY}/python as python +FROM ${REGISTRY}/ninja as ninja +FROM ${REGISTRY}/openssl as openssl +FROM ${REGISTRY}/make as make + +FROM busybox as base +ENV VERSION=20.11.0 +ENV SRC_FILE=node-v${VERSION}.tar.gz +ENV SRC_SITE=https://nodejs.org/dist +ENV SRC_HASH=9884b22d88554d65025352ba7e4cb20f5d17a939231bea41a7894c0344fab1bf +COPY --from=musl . / +COPY --from=gcc . / +COPY --from=ninja . / +COPY --from=python . / +COPY --from=openssl . / + +FROM base as fetch +RUN wget --no-check-certificate ${SRC_SITE}/v${VERSION}/${SRC_FILE} +RUN echo "${SRC_HASH} ${SRC_FILE}" | sha256sum -c + +FROM fetch as build +RUN tar -xzf ${SRC_FILE} +WORKDIR build +RUN set -eux; \ + ../node-v${VERSION}/configure \ + --prefix=/usr \ + --ninja \ + --enable-lto \ + --openssl-use-def-ca-store \ + --without-corepack \ + --without-npm; \ + make BUILDTYPE=Release + +FROM build as install +USER 0:0 +COPY --from=musl /lib/* /rootfs/lib/ +RUN set -eux; \ + make PREFIX=/rootfs install; \ + find /rootfs -exec touch -hcd "@0" "{}" + + +FROM scratch as package +COPY --from=install /rootfs / +USER 100:100 +ENTRYPOINT ["/usr/bin/node"] +CMD ["--version"] diff --git a/src/core/nodejs/rust-feature-tables.patch b/src/core/nodejs/rust-feature-tables.patch new file mode 100644 index 0000000..42fa8f4 --- /dev/null +++ b/src/core/nodejs/rust-feature-tables.patch @@ -0,0 +1,305 @@ + + + +rust-feature-tables.patch « llvm16 « main - aports - Alpine packages build scripts + + + + + + + + + + +
+ + + + +
+aboutsummaryrefslogtreecommitdiffstats
+ + + +
+
+
blob: 2068d51f2b9aae67132d65eb83489b22c9d227c4 (plain) + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+
Patch-Source: https://github.com/rust-lang/llvm-project/commit/0a157fd7a5f61973ffddf96b3d445a718193eb1a
+From 0a157fd7a5f61973ffddf96b3d445a718193eb1a Mon Sep 17 00:00:00 2001
+From: Cameron Hart <cameron.hart@gmail.com>
+Date: Sun, 10 Jul 2016 23:55:53 +1000
+Subject: [PATCH] [rust] Add accessors for MCSubtargetInfo CPU and Feature
+ tables
+
+This is needed for `-C target-cpu=help` and `-C target-feature=help` in rustc
+---
+ llvm/include/llvm/MC/MCSubtargetInfo.h | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/llvm/include/llvm/MC/MCSubtargetInfo.h b/llvm/include/llvm/MC/MCSubtargetInfo.h
+index e1f0a86141e36..1e529bf4fb31e 100644
+--- a/llvm/include/llvm/MC/MCSubtargetInfo.h
++++ b/llvm/include/llvm/MC/MCSubtargetInfo.h
+@@ -230,6 +230,14 @@ class MCSubtargetInfo {
+     return Found != ProcDesc.end() && StringRef(Found->Key) == CPU;
+   }
+ 
++  ArrayRef<SubtargetSubTypeKV> getCPUTable() const {
++    return ProcDesc;
++  }
++
++  ArrayRef<SubtargetFeatureKV> getFeatureTable() const {
++    return ProcFeatures;
++  }
++
+   virtual unsigned getHwMode() const { return 0; }
+ 
+   /// Return the cache size in bytes for the given level of cache.
+
+
+
+ +
+ +