Skip to content

[Bug] Fix dashboard backend build and socket tests on macOS - #4829

Open
JiaweiGithub wants to merge 1 commit into
vllm-project:mainfrom
JiaweiGithub:feat/macos-dashboard-compatibility
Open

JiaweiGithub wants to merge 1 commit into
vllm-project:mainfrom
JiaweiGithub:feat/macos-dashboard-compatibility

Conversation

@JiaweiGithub

@JiaweiGithub JiaweiGithub commented Oct 10, 2026 •

Copy link
Copy Markdown

Closes #4828

Purpose

Fix two macOS-only failures in dashboard/backend reported in #4828:

  1. handlers/runtime_config_lock_unix.go passes stat.Mode directly to
    unix.Fchmod. The file builds for all non-Windows platforms
    (//go:build !windows), but unix.Stat_t.Mode is uint16 on darwin
    while unix.Fchmod expects uint32, so the whole handlers package
    fails to compile on macOS.
  2. handlers/instance_test.go joins t.TempDir() with control.sock.
    t.TempDir() embeds the full test name, which exceeds the 104-byte
    sun_path limit for unix sockets on macOS, so
    TestInstanceUnixStatusAndModels and
    TestInstanceEngineUsesPersistentFrontendForInference always fail
    with bind: invalid argument.

Fixes: convert the mode with uint32(stat.Mode) (an identity conversion on
linux/freebsd where Mode is already uint32), and create the test socket
in a short os.MkdirTemp("", "sr") directory instead of t.TempDir().

Affected module: dashboard/backend only. No behavior change on Linux.
Windows is unaffected (file excluded by build tag).

Test Plan

cd dashboard/backend

# on main, macOS (darwin/arm64) — reproduces both failures
go build ./handlers/
go test ./handlers/ -run 'TestInstanceUnixStatusAndModels|TestInstanceEngineUsesPersistentFrontendForInference' -count=1

# with this PR
go build ./...
go test ./handlers/ -count=1

# cross-platform regression check
for p in 'linux amd64' 'linux arm64' 'darwin amd64' 'darwin arm64' 'freebsd amd64'; do
  GOOS=${p%% *} GOARCH=${p##* } go build ./handlers/ && \
  GOOS=${p%% *} GOARCH=${p##* } go vet ./handlers/
done

Test Result

Before (macOS, darwin/arm64):

handlers/runtime_config_lock_unix.go:62:33: cannot use stat.Mode & 0o777 | 0o060
(value of type uint16) as uint32 value in argument to unix.Fchmod

With only the compile fix applied, the two socket tests still fail:

listen unix /var/folders/.../TestInstanceEngineUsesPersistentFrontendForInference.../control.sock:
bind: invalid argument

After this PR:

  • macOS: go build ./... passes; go test ./handlers/ -count=1 reports ok (all tests pass)
  • go build and go vet pass on linux/amd64, linux/arm64, darwin/amd64, darwin/arm64, freebsd/amd64

Remaining risk: none expected; uint32(stat.Mode) is an identity conversion
on platforms where Mode is already uint32.

@JiaweiGithub
JiaweiGithub force-pushed the feat/macos-dashboard-compatibility branch from a4d5bac to c35668a Compare October 10, 2026 07:52
@github-actions github-actions Bot added the pr/blocked Blocked on a named decision, dependency, or required check. label Oct 10, 2026

@Xunzhuo Xunzhuo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for fixing the macOS build and socket-path issues. One required Linux lint failure needs a scoped fix before this can land; details inline. Both Source Checks and Dashboard CI reproduce it. Darwin runtime tests were not run.

if int(stat.Uid) == os.Getuid() && stat.Mode&0o060 != 0o060 {
if err := unix.Fchmod(lockFD, stat.Mode&0o777|0o060); err != nil {
// stat.Mode is uint16 on darwin; convert for Fchmod portability.
if err := unix.Fchmod(lockFD, uint32(stat.Mode)&0o777|0o060); err != nil {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[P2] Keep the Darwin conversion lint-clean on Linux

The cast is needed on Darwin, but on Linux Stat_t.Mode is already uint32, so the required unconvert check rejects this line. Both Source Checks (make check) and Dashboard CI fail here at this commit, before the backend tests run. Please retain the portability fix and add a narrowly scoped //nolint:unconvert with the Darwin type rationale (or an equivalent platform-aware helper), then rerun both checks.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks for the review! Fixed in the latest commit.

Signed-off-by: jiawei.liu <jiawei.liu@daocloud.io>
@JiaweiGithub
JiaweiGithub force-pushed the feat/macos-dashboard-compatibility branch from 66150dc to 1694eea Compare October 10, 2026 09:24
@github-actions github-actions Bot added pr/needs-author Waiting for author changes or response. wg/developer-experience-ecosystem Owned by the Developer Experience and Ecosystem Workgroup. and removed pr/blocked Blocked on a named decision, dependency, or required check. labels Oct 10, 2026

@Xunzhuo Xunzhuo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the focused lint fix. Both Darwin cross-builds and the Linux socket and lock regressions pass. Native macOS runtime tests were not run; no blockers found.

@wilsonwu wilsonwu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@github-actions github-actions Bot added pr/needs-rebase Needs rebase or conflict resolution. and removed pr/needs-author Waiting for author changes or response. labels Oct 10, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr/needs-rebase Needs rebase or conflict resolution. wg/developer-experience-ecosystem Owned by the Developer Experience and Ecosystem Workgroup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Dashboard backend fails to build and two instance tests fail on macOS

3 participants