Skip to content

fix: add ppc64le build and dev server support for frontend#2101

Merged
lucaseduoli merged 9 commits into
mainfrom
fix-frontend-ppc64le-build
Jul 21, 2026
Merged

fix: add ppc64le build and dev server support for frontend#2101
lucaseduoli merged 9 commits into
mainfrom
fix-frontend-ppc64le-build

Conversation

@ethanchoe-2

@ethanchoe-2 ethanchoe-2 commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Fixes #2088

What changed

  • frontend/next.config.ts — replace __dirname with process.cwd() (fixes crash when Next.js compiles config as an ES module under the WASM runtime)
  • frontend/build.js — new arch-detection wrapper that adds --webpack flag on ppc64le
  • frontend/package.json — change build script from next build to node build.js
  • Makefile — add ppc64le arch check to make frontend dev server target, passes --webpack on Power hardware

Why

next-swc has no native bindings for linux/ppc64le. The WASM fallback compiles next.config.ts as an ES module where __dirname is undefined, crashing both the build and dev server. Forcing --webpack and using process.cwd() instead makes the build work correctly on ppc64le while remaining unchanged on x86_64 and arm64.

Summary by CodeRabbit

  • Bug Fixes
    • Improved frontend startup and production builds on Power/ppc64le systems, including a webpack fallback for ppc64.
    • Enhanced handling of custom environment-file paths so they resolve reliably and load correctly.
    • Improved behavior when running the frontend on non-default ports.
  • Chores
    • Updated the frontend build process to use a dedicated build runner that selects the right build command based on system architecture.

@ethanchoe-2
ethanchoe-2 requested a review from lucaseduoli July 15, 2026 16:24
@github-actions github-actions Bot added the frontend 🟨 Issues related to the UI/UX label Jul 15, 2026
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 806395a2-4966-4ce8-977a-347254330638

📥 Commits

Reviewing files that changed from the base of the PR and between 84c3edf and 14c2921.

📒 Files selected for processing (1)
  • Makefile
🚧 Files skipped from review as they are similar to previous changes (1)
  • Makefile

Walkthrough

Frontend development and production builds now select Next.js webpack fallbacks on Power architectures. Environment files resolve from the working directory, while development startup configures absolute paths, ports, and port-specific build output directories.

Changes

Frontend Power architecture support

Layer / File(s) Summary
Environment file and development runtime paths
frontend/next.config.ts, Makefile
Environment loading uses process.cwd(). The frontend target exports an absolute ENV_FILE, derives PORT, selects NEXT_DIST_DIR based on the port, and uses webpack on Power architectures.
Architecture-specific build routing
frontend/build.js, frontend/package.json
The package build script invokes build.js, which selects next build --webpack for ppc64 and the standard build command elsewhere, preserving subprocess output and failure status.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • langflow-ai/openrag#2089: Updates the same frontend Power architecture build, development, and environment-file handling paths.

Suggested reviewers: lucaseduoli

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: ppc64le support for the frontend build and dev server.
Linked Issues check ✅ Passed The changes address issue #2088 by adding webpack fallbacks for ppc64le, fixing env loading, and routing build/dev entrypoints through the new logic.
Out of Scope Changes check ✅ Passed The summarized changes all align with the ppc64le support objective and do not show unrelated additions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-frontend-ppc64le-build

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ethanchoe-2 ethanchoe-2 changed the title Fix: add ppc64le build and dev server support for frontend fix: add ppc64le build and dev server support for frontend Jul 15, 2026
@github-actions github-actions Bot added the bug 🔴 Something isn't working. label Jul 15, 2026
@github-actions github-actions Bot added bug 🔴 Something isn't working. and removed bug 🔴 Something isn't working. labels Jul 15, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Makefile`:
- Around line 736-742: Update both next dev command branches in the Makefile to
escape the shell hostname substitution, replacing the Make expansion $(hostname)
with $$(hostname) so the shell resolves the hostname at runtime.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 12f64511-96d8-43f3-a752-38be961cf97f

📥 Commits

Reviewing files that changed from the base of the PR and between 31fdf1d and 6e17da9.

📒 Files selected for processing (4)
  • Makefile
  • frontend/build.js
  • frontend/next.config.ts
  • frontend/package.json

Comment thread Makefile Outdated
@github-actions github-actions Bot added bug 🔴 Something isn't working. and removed bug 🔴 Something isn't working. labels Jul 15, 2026
@github-actions github-actions Bot added bug 🔴 Something isn't working. and removed bug 🔴 Something isn't working. labels Jul 15, 2026
@github-actions github-actions Bot added bug 🔴 Something isn't working. and removed bug 🔴 Something isn't working. labels Jul 20, 2026
@lucaseduoli
lucaseduoli merged commit 2f576b8 into main Jul 21, 2026
38 checks passed
@github-actions github-actions Bot added the lgtm label Jul 21, 2026
@github-actions
github-actions Bot deleted the fix-frontend-ppc64le-build branch July 21, 2026 16:11
lucaseduoli pushed a commit that referenced this pull request Jul 21, 2026
* fix: add ppc64le build support for frontend

Signed-off-by: Ethan Choe <ethanchoe@ibm.com>

* fix: add ppc64le webpack fallback for make frontend dev server

Signed-off-by: Ethan Choe <ethanchoe3@gmail.com>

* fix: use path.resolve for ENV_FILE to support absolute paths

Signed-off-by: Ethan Choe <ethanchoe3@gmail.com>

* fix: escape $(hostname) as $$(hostname) in Makefile frontend target

---------

Signed-off-by: Ethan Choe <ethanchoe@ibm.com>
Signed-off-by: Ethan Choe <ethanchoe3@gmail.com>
Vchen7629 added a commit that referenced this pull request Jul 22, 2026
…nstead of missing (#2139)

* fix: add ppc64le build and dev server support for frontend (#2101)

* fix: add ppc64le build support for frontend

Signed-off-by: Ethan Choe <ethanchoe@ibm.com>

* fix: add ppc64le webpack fallback for make frontend dev server

Signed-off-by: Ethan Choe <ethanchoe3@gmail.com>

* fix: use path.resolve for ENV_FILE to support absolute paths

Signed-off-by: Ethan Choe <ethanchoe3@gmail.com>

* fix: escape $(hostname) as $$(hostname) in Makefile frontend target

---------

Signed-off-by: Ethan Choe <ethanchoe@ibm.com>
Signed-off-by: Ethan Choe <ethanchoe3@gmail.com>

* fix: wire _resolve_service_name into podman and docker status paths

* test: added unit tests for tui status fixes

* style: ruff autofix (auto)

* test: added unit test for docker path

---------

Signed-off-by: Ethan Choe <ethanchoe@ibm.com>
Signed-off-by: Ethan Choe <ethanchoe3@gmail.com>
Co-authored-by: ethanchoe-2 <ethanchoe3@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 🔴 Something isn't working. frontend 🟨 Issues related to the UI/UX lgtm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants