Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next.js next build churns CPU forever in linux/amd64 on arm64 silicon mac #7499

Open
InfraK opened this issue Dec 9, 2024 · 1 comment
Open

Comments

@InfraK
Copy link

InfraK commented Dec 9, 2024

Description

Running next build get stuck, with CPU at 100%, does not respond to SIGINT and does not complete.

Reproduce

  1. docker run --platform linux/amd64 -it node:23 bash
  2. git clone https://github.com/vercel/next-learn.git
  3. cd next-learn/basics/demo
  4. npm install
  5. npm build

Expected behavior

Build should complete in a reasonable amount of time depending on hardware/resources.

docker version

Client:
 Version:           27.3.1
 API version:       1.47
 Go version:        go1.22.7
 Git commit:        ce12230
 Built:             Fri Sep 20 11:38:18 2024
 OS/Arch:           darwin/arm64
 Context:           desktop-linux

Server: Docker Desktop 4.36.0 (175267)
 Engine:
  Version:          27.3.1
  API version:      1.47 (minimum version 1.24)
  Go version:       go1.22.7
  Git commit:       41ca978
  Built:            Fri Sep 20 11:41:19 2024
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          1.7.21
  GitCommit:        472731909fa34bd7bc9c087e4c27943f9835f111
 runc:
  Version:          1.1.13
  GitCommit:        v1.1.13-0-g58aa920
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

docker info

Client:
 Version:    27.3.1
 Context:    desktop-linux
 Debug Mode: false
 Plugins:
  ai: Ask Gordon - Docker Agent (Docker Inc.)
    Version:  v0.1.0
    Path:     /Users/santiagokent/.docker/cli-plugins/docker-ai
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.18.0-desktop.2
    Path:     /Users/santiagokent/.docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.30.3-desktop.1
    Path:     /Users/santiagokent/.docker/cli-plugins/docker-compose
  debug: Get a shell into any image or container (Docker Inc.)
    Version:  0.0.37
    Path:     /Users/santiagokent/.docker/cli-plugins/docker-debug
  desktop: Docker Desktop commands (Alpha) (Docker Inc.)
    Version:  v0.0.15
    Path:     /Users/santiagokent/.docker/cli-plugins/docker-desktop
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.2
    Path:     /Users/santiagokent/.docker/cli-plugins/docker-dev
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.27
    Path:     /Users/santiagokent/.docker/cli-plugins/docker-extension
  feedback: Provide feedback, right in your terminal! (Docker Inc.)
    Version:  v1.0.5
    Path:     /Users/santiagokent/.docker/cli-plugins/docker-feedback
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v1.4.0
    Path:     /Users/santiagokent/.docker/cli-plugins/docker-init
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     /Users/santiagokent/.docker/cli-plugins/docker-sbom
  scout: Docker Scout (Docker Inc.)
    Version:  v1.15.0
    Path:     /Users/santiagokent/.docker/cli-plugins/docker-scout

Server:
 Containers: 2
  Running: 2
  Paused: 0
  Stopped: 0
 Images: 4
 Server Version: 27.3.1
 Storage Driver: overlayfs
  driver-type: io.containerd.snapshotter.v1
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 472731909fa34bd7bc9c087e4c27943f9835f111
 runc version: v1.1.13-0-g58aa920
 init version: de40ad0
 Security Options:
  seccomp
   Profile: unconfined
  cgroupns
 Kernel Version: 6.10.14-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: aarch64
 CPUs: 10
 Total Memory: 7.654GiB
 Name: docker-desktop
 ID: 55ed43ee-d5ba-495a-a708-09b53e49414f
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Labels:
  com.docker.desktop.address=unix:///Users/santiagokent/Library/Containers/com.docker.docker/Data/docker-cli.sock
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5555
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: daemon is not using the default seccomp profile

Diagnostics ID

B5A27C8D-90CC-4ACC-8795-4C4562D94895/20241209154612

Additional Info

Found a related issue from last year #7124, the steps to reproduce are exactly the same, just different versions.

@facundovictor
Copy link

I've reproduced it using docker desktop for mac 4.36.0 with "Use Rosetta for x86_64/amd64 emulation on Apple Silicon" turned on (default). And then tested the following scenarios where it does work (as alternatives) in case it helps:

  1. Using node:22 and keep Rosetta enabled.
root@2d755eee31f9:/app# node --version
v22.12.0
root@2d755eee31f9:/app# npm run build

> build
> next build

Attention: Next.js now collects completely anonymous telemetry regarding usage.
This information is used to shape Next.js' roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://nextjs.org/telemetry

   ▲ Next.js 15.0.4

 ✓ Linting and checking validity of types
   Creating an optimized production build ...
 ✓ Compiled successfully
 ✓ Collecting page data
 ✓ Generating static pages (5/5)
 ✓ Collecting build traces
 ✓ Finalizing page optimization

Route (pages)                             Size     First Load JS
┌ ● / (355 ms)                            1.61 kB        93.6 kB
├   /_app                                 0 B            79.1 kB
├ ○ /404                                  189 B          79.3 kB
├ ƒ /api/hello                            0 B            79.1 kB
└ ● /posts/[id] (699 ms)                  1.36 kB        93.4 kB
    ├ /posts/pre-rendering (351 ms)
    └ /posts/ssg-ssr (348 ms)
+ First Load JS shared by all             79.4 kB
  ├ chunks/framework-06121e066c6696d9.js  44.8 kB
  ├ chunks/main-bc5cca2169ff8412.js       33.2 kB
  └ other shared chunks (total)           1.35 kB

○  (Static)   prerendered as static content
●  (SSG)      prerendered as static HTML (uses getStaticProps)
ƒ  (Dynamic)  server-rendered on demand
  1. Set "UseVirtualizationFrameworkRosetta": false (or from General settings) and restart docker, then try again with node:23. Note: This took around 4.9 times the build time it took using rosetta with node:22.
root@1545b0488277:/app# node --version
v23.3.0
root@1545b0488277:/app# npm run build

> build
> next build

Attention: Next.js now collects completely anonymous telemetry regarding usage.
This information is used to shape Next.js' roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://nextjs.org/telemetry

   ▲ Next.js 15.0.4

 ✓ Linting and checking validity of types
   Creating an optimized production build ...
 ✓ Compiled successfully
 ✓ Collecting page data
 ✓ Generating static pages (5/5)
 ✓ Collecting build traces
 ✓ Finalizing page optimization

Route (pages)                             Size     First Load JS
┌ ● / (1734 ms)                           1.61 kB        93.6 kB
├   /_app                                 0 B            79.1 kB
├ ○ /404                                  189 B          79.3 kB
├ ƒ /api/hello                            0 B            79.1 kB
└ ● /posts/[id] (3428 ms)                 1.36 kB        93.4 kB
    ├ /posts/pre-rendering (1718 ms)
    └ /posts/ssg-ssr (1710 ms)
+ First Load JS shared by all             79.4 kB
  ├ chunks/framework-06121e066c6696d9.js  44.8 kB
  ├ chunks/main-bc5cca2169ff8412.js       33.2 kB
  └ other shared chunks (total)           1.35 kB

○  (Static)   prerendered as static content
●  (SSG)      prerendered as static HTML (uses getStaticProps)
ƒ  (Dynamic)  server-rendered on demand

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants