rsnext/packages/next/package.json
Benjamin Woodruff 0b1209edfa
Revert "Revert "Use turbo-tasks-malloc on all platforms" (#66884)", fix aarch64 compilation in CI (#66885)
We either need GCC >= 4.9 or we need to link with libatomic:
https://github.com/microsoft/mimalloc/issues/443

Unfortunately, manylinux2014-cross ships with GCC 4.8.5:
https://github.com/rust-cross/manylinux-cross/blob/main/manylinux2014/aarch64/Dockerfile#L71

We already appear to override the compiler toolchain in CI for x86_64 to
use clang (which is why mimalloc works there), so let's go ahead and do
that here too. This at least means we're using the same compiler across
both architectures.

I'm leaving the aarch64-musl codepath the same (using gcc) because (1)
we don't use mimalloc there yet and (2) it's a bit harder for me to test
as thoroughly.

# Testing

## Local Compilation

Run bash inside the docker image (I also had to install rosetta2 inside
my Linux VM, as this is an x86_64 image used for cross-compilation to
aarch64):

```
podman run --platform=linux/amd64 -t -i ghcr.io/napi-rs/napi-rs/nodejs-rust:stable-2023-09-17-aarch64 bash -l
```

```
git clone https://github.com/vercel/next.js.git --filter=blob:none --branch canary --single-branch
cd next.js
git checkout 6ae9828cce
```

Run the build locally:

```
apt update &&
apt install -y pkg-config xz-utils dav1d libdav1d-dev &&
export JEMALLOC_SYS_WITH_LG_PAGE=16 &&
rustup show &&
rustup target add aarch64-unknown-linux-gnu &&
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" &&
export CC_aarch64_unknown_linux_gnu=/usr/bin/clang &&
export CFLAGS_aarch64_unknown_linux_gnu="--target=aarch64-unknown-linux-gnu --sysroot=/usr/aarch64-unknown-linux-gnu" &&
cd packages/next-swc && npm run build-native-release -- --target aarch64-unknown-linux-gnu &&
llvm-strip -x native/next-swc.*.node &&
objdump -T native/next-swc.*.node | grep GLIBC_
```

Sanity check that the result is an aarch64 binary

```
$ file native/next-swc.linux-arm64-gnu.node
native/next-swc.linux-arm64-gnu.node: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, not stripped
```

## Verifying the binary works

Copy the next-swc binary into a copy of shadcn-ui I have sitting around:

```
podman cp 4e8f61b17965:/next.js/packages/next-swc/native/next-swc.linux-arm64-gnu.node ~/ui/node_modules/.pnpm/file+..+nextpack+tarballs+next-swc.tar/node_modules/@next/swc/native/next-swc.linux-arm64-gnu.node
```

and then try running the dev server and loading pages from it in the
browser:

```
pnpm --filter=www dev --turbo
```

## In CI


https://github.com/vercel/next.js/actions/runs/9523143080/job/26254016137
2024-06-15 03:39:24 +00:00

351 lines
9.9 KiB
JSON

{
"name": "next",
"version": "15.0.0-canary.32",
"description": "The React Framework",
"main": "./dist/server/next.js",
"license": "MIT",
"repository": "vercel/next.js",
"bugs": "https://github.com/vercel/next.js/issues",
"homepage": "https://nextjs.org",
"types": "index.d.ts",
"files": [
"dist",
"app.js",
"app.d.ts",
"babel.js",
"babel.d.ts",
"client.js",
"client.d.ts",
"compat",
"cache.js",
"cache.d.ts",
"config.js",
"config.d.ts",
"constants.js",
"constants.d.ts",
"document.js",
"document.d.ts",
"dynamic.js",
"dynamic.d.ts",
"error.js",
"error.d.ts",
"future",
"legacy",
"script.js",
"script.d.ts",
"server.js",
"server.d.ts",
"head.js",
"head.d.ts",
"image.js",
"image.d.ts",
"link.js",
"link.d.ts",
"router.js",
"router.d.ts",
"jest.js",
"jest.d.ts",
"amp.js",
"amp.d.ts",
"og.js",
"og.d.ts",
"types.d.ts",
"types.js",
"index.d.ts",
"types/global.d.ts",
"types/compiled.d.ts",
"image-types/global.d.ts",
"navigation-types/navigation.d.ts",
"navigation-types/compat/navigation.d.ts",
"font",
"navigation.js",
"navigation.d.ts",
"headers.js",
"headers.d.ts",
"navigation-types",
"web-vitals.js",
"web-vitals.d.ts",
"experimental/testmode/playwright.js",
"experimental/testmode/playwright.d.ts",
"experimental/testmode/playwright/msw.js",
"experimental/testmode/playwright/msw.d.ts",
"experimental/testmode/proxy.js",
"experimental/testmode/proxy.d.ts"
],
"bin": {
"next": "./dist/bin/next"
},
"scripts": {
"dev": "taskr",
"release": "taskr release",
"build": "pnpm release",
"prepublishOnly": "cd ../../ && turbo run build",
"types": "tsc --declaration --emitDeclarationOnly --stripInternal --declarationDir dist",
"typescript": "tsec --noEmit",
"ncc-compiled": "taskr ncc"
},
"taskr": {
"requires": [
"./taskfile-webpack.js",
"./taskfile-ncc.js",
"./taskfile-swc.js",
"./taskfile-watch.js"
]
},
"dependencies": {
"@next/env": "15.0.0-canary.32",
"@swc/helpers": "0.5.11",
"busboy": "1.6.0",
"caniuse-lite": "^1.0.30001579",
"graceful-fs": "^4.2.11",
"postcss": "8.4.31",
"styled-jsx": "5.1.6"
},
"peerDependencies": {
"@opentelemetry/api": "^1.1.0",
"@playwright/test": "^1.41.2",
"babel-plugin-react-compiler": "*",
"react": "19.0.0-rc.0",
"react-dom": "19.0.0-rc.0",
"sass": "^1.3.0"
},
"peerDependenciesMeta": {
"babel-plugin-react-compiler": {
"optional": true
},
"sass": {
"optional": true
},
"@opentelemetry/api": {
"optional": true
},
"@playwright/test": {
"optional": true
}
},
"optionalDependencies": {
"sharp": "^0.33.4"
},
"devDependencies": {
"@ampproject/toolbox-optimizer": "2.8.3",
"@babel/code-frame": "7.22.5",
"@babel/core": "7.22.5",
"@babel/eslint-parser": "7.22.5",
"@babel/generator": "7.22.5",
"@babel/plugin-proposal-class-properties": "7.18.6",
"@babel/plugin-proposal-export-namespace-from": "7.18.9",
"@babel/plugin-proposal-numeric-separator": "7.18.6",
"@babel/plugin-proposal-object-rest-spread": "7.20.7",
"@babel/plugin-syntax-bigint": "7.8.3",
"@babel/plugin-syntax-dynamic-import": "7.8.3",
"@babel/plugin-syntax-import-attributes": "7.22.5",
"@babel/plugin-syntax-jsx": "7.22.5",
"@babel/plugin-transform-modules-commonjs": "7.22.5",
"@babel/plugin-transform-runtime": "7.22.5",
"@babel/preset-env": "7.22.5",
"@babel/preset-react": "7.22.5",
"@babel/preset-typescript": "7.22.5",
"@babel/runtime": "7.22.5",
"@babel/traverse": "7.22.5",
"@babel/types": "7.22.5",
"@capsizecss/metrics": "3.2.0",
"@edge-runtime/cookies": "4.1.1",
"@edge-runtime/ponyfill": "2.4.2",
"@edge-runtime/primitives": "4.1.0",
"@hapi/accept": "5.0.2",
"@jest/transform": "29.5.0",
"@jest/types": "29.5.0",
"@mswjs/interceptors": "0.23.0",
"@napi-rs/triples": "1.2.0",
"@next/polyfill-module": "15.0.0-canary.32",
"@next/polyfill-nomodule": "15.0.0-canary.32",
"@next/react-refresh-utils": "15.0.0-canary.32",
"@next/swc": "15.0.0-canary.32",
"@opentelemetry/api": "1.6.0",
"@playwright/test": "1.41.2",
"@swc/core": "1.5.7",
"@swc/types": "0.1.7",
"@taskr/clear": "1.1.0",
"@taskr/esnext": "1.1.0",
"@types/amphtml-validator": "1.0.0",
"@types/babel__code-frame": "7.0.2",
"@types/babel__core": "7.1.12",
"@types/babel__generator": "7.6.2",
"@types/babel__template": "7.4.0",
"@types/babel__traverse": "7.11.0",
"@types/bytes": "3.1.1",
"@types/ci-info": "2.0.0",
"@types/compression": "0.0.36",
"@types/content-disposition": "0.5.4",
"@types/content-type": "1.1.3",
"@types/cookie": "0.3.3",
"@types/cross-spawn": "6.0.0",
"@types/debug": "4.1.5",
"@types/express-serve-static-core": "4.17.33",
"@types/fresh": "0.5.0",
"@types/glob": "7.1.1",
"@types/graceful-fs": "4.1.9",
"@types/jsonwebtoken": "9.0.0",
"@types/lodash": "4.14.198",
"@types/lodash.curry": "4.1.6",
"@types/lru-cache": "5.1.0",
"@types/path-to-regexp": "1.7.0",
"@types/picomatch": "2.3.3",
"@types/platform": "1.3.4",
"@types/react": "18.2.74",
"@types/react-dom": "18.2.23",
"@types/react-is": "18.2.4",
"@types/semver": "7.3.1",
"@types/send": "0.14.4",
"@types/shell-quote": "1.7.1",
"@types/tar": "6.1.5",
"@types/text-table": "0.2.1",
"@types/ua-parser-js": "0.7.36",
"@types/uuid": "8.3.1",
"@types/webpack-sources1": "npm:@types/webpack-sources@0.1.5",
"@types/ws": "8.2.0",
"@vercel/ncc": "0.34.0",
"@vercel/nft": "0.27.1",
"@vercel/turbopack-ecmascript-runtime": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240614.1",
"acorn": "8.11.3",
"amphtml-validator": "1.0.35",
"anser": "1.4.9",
"arg": "4.1.0",
"assert": "2.0.0",
"async-retry": "1.2.3",
"async-sema": "3.0.0",
"babel-plugin-transform-define": "2.0.0",
"babel-plugin-transform-react-remove-prop-types": "0.4.24",
"browserify-zlib": "0.2.0",
"browserslist": "4.22.2",
"buffer": "5.6.0",
"bytes": "3.1.1",
"ci-info": "watson/ci-info#f43f6a1cefff47fb361c88cf4b943fdbcaafe540",
"cli-select": "1.1.2",
"client-only": "0.0.1",
"commander": "12.1.0",
"comment-json": "3.0.3",
"compression": "1.7.4",
"conf": "5.0.0",
"constants-browserify": "1.0.0",
"content-disposition": "0.5.3",
"content-type": "1.0.4",
"cookie": "0.4.1",
"cross-spawn": "7.0.3",
"crypto-browserify": "3.12.0",
"css.escape": "1.5.1",
"cssnano-preset-default": "5.2.14",
"data-uri-to-buffer": "3.0.1",
"debug": "4.1.1",
"devalue": "2.0.1",
"domain-browser": "4.19.0",
"edge-runtime": "2.5.4",
"events": "3.3.0",
"find-up": "4.1.0",
"fresh": "0.5.2",
"glob": "7.1.7",
"gzip-size": "5.1.1",
"http-proxy": "1.18.1",
"http-proxy-agent": "5.0.0",
"https-browserify": "1.0.0",
"https-proxy-agent": "5.0.1",
"icss-utils": "5.1.0",
"ignore-loader": "0.1.2",
"image-size": "1.1.1",
"is-docker": "2.0.0",
"is-wsl": "2.2.0",
"jest-worker": "27.5.1",
"json5": "2.2.3",
"jsonwebtoken": "9.0.0",
"loader-runner": "4.3.0",
"loader-utils2": "npm:loader-utils@2.0.0",
"loader-utils3": "npm:loader-utils@3.1.3",
"lodash.curry": "4.1.1",
"lru-cache": "5.1.1",
"mini-css-extract-plugin": "2.4.4",
"msw": "2.3.0",
"nanoid": "3.1.32",
"native-url": "0.3.4",
"neo-async": "2.6.1",
"node-html-parser": "5.3.3",
"ora": "4.0.4",
"os-browserify": "0.3.0",
"p-limit": "3.1.0",
"p-queue": "6.6.2",
"path-browserify": "1.0.1",
"path-to-regexp": "6.1.0",
"picomatch": "4.0.1",
"platform": "1.3.6",
"postcss-flexbugs-fixes": "5.0.2",
"postcss-modules-extract-imports": "3.0.0",
"postcss-modules-local-by-default": "4.0.4",
"postcss-modules-scope": "3.0.0",
"postcss-modules-values": "4.0.0",
"postcss-preset-env": "7.4.3",
"postcss-safe-parser": "6.0.0",
"postcss-scss": "4.0.3",
"postcss-value-parser": "4.2.0",
"process": "0.11.10",
"punycode": "2.1.1",
"querystring-es3": "0.2.1",
"raw-body": "2.4.1",
"react-is": "19.0.0-canary-94eed63c49-20240425",
"react-refresh": "0.12.0",
"regenerator-runtime": "0.13.4",
"sass-loader": "12.4.0",
"schema-utils2": "npm:schema-utils@2.7.1",
"schema-utils3": "npm:schema-utils@3.0.0",
"semver": "7.3.2",
"send": "0.17.1",
"server-only": "0.0.1",
"setimmediate": "1.0.5",
"shell-quote": "1.7.3",
"source-map": "0.6.1",
"source-map-loader": "5.0.0",
"source-map08": "npm:source-map@0.8.0-beta.0",
"stacktrace-parser": "0.1.10",
"stream-browserify": "3.0.0",
"stream-http": "3.1.1",
"strict-event-emitter": "0.5.0",
"string-hash": "1.1.3",
"string_decoder": "1.3.0",
"strip-ansi": "6.0.0",
"superstruct": "1.0.3",
"tar": "6.1.15",
"taskr": "1.1.0",
"terser": "5.27.0",
"terser-webpack-plugin": "5.3.9",
"text-table": "0.2.0",
"timers-browserify": "2.0.12",
"tty-browserify": "0.0.1",
"ua-parser-js": "1.0.35",
"unistore": "3.4.1",
"util": "0.12.4",
"uuid": "8.3.2",
"vm-browserify": "1.1.2",
"watchpack": "2.4.0",
"web-vitals": "3.0.0",
"webpack": "5.90.0",
"webpack-sources1": "npm:webpack-sources@1.4.3",
"webpack-sources3": "npm:webpack-sources@3.2.3",
"ws": "8.2.3",
"zod": "3.22.3"
},
"keywords": [
"react",
"framework",
"nextjs",
"web",
"server",
"node",
"front-end",
"back-end",
"cli",
"vercel"
],
"engines": {
"node": ">=18.17.0",
"pnpm": "8.15.7"
},
"packageManager": "pnpm@8.15.7"
}