Skip to content

Commit 893d314

Browse files
authored
Merge pull request #399 from HyperloopUPV-H8/control-station/electron-mac
feat: add Intel macOS distributives, change main README.md to include macOS fix
2 parents 18a3922 + ffab59d commit 893d314

7 files changed

Lines changed: 79 additions & 17 deletions

File tree

.github/workflows/release.yaml

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,29 @@ jobs:
4141
needs: determine-version
4242
runs-on: ${{ matrix.os }}
4343
strategy:
44-
fail-fast: false
44+
fail-fast: true
4545
matrix:
46-
os: [ubuntu-latest, windows-latest, macos-latest]
46+
os: [windows-latest, ubuntu-latest, macos-latest, macos-15-intel]
4747
steps:
48+
- name: Debug all contexts
49+
run: |
50+
echo "=== Runner Context ==="
51+
echo "runner.os: ${{ runner.os }}"
52+
echo "runner.arch: ${{ runner.arch }}"
53+
echo "runner.name: ${{ runner.name }}"
54+
echo "runner.temp: ${{ runner.temp }}"
55+
echo "runner.workspace: ${{ runner.workspace }}"
56+
echo ""
57+
echo "=== Matrix Context ==="
58+
echo "matrix.os: ${{ matrix.os }}"
59+
echo "matrix.platform: ${{ matrix.platform }}"
60+
echo "matrix.arch: ${{ matrix.arch }}"
61+
echo ""
62+
echo "=== Environment Variables ==="
63+
echo "RUNNER_OS: $RUNNER_OS"
64+
echo "RUNNER_ARCH: $RUNNER_ARCH"
65+
echo "RUNNER_NAME: $RUNNER_NAME"
66+
4867
- name: Checkout repository
4968
uses: actions/checkout@v4
5069

@@ -83,9 +102,8 @@ jobs:
83102
name: backend-windows
84103
path: electron-app/binaries
85104

86-
# macOS needs both Intel and ARM64 for universal support
87105
- name: Download macOS Intel backend
88-
if: runner.os == 'macOS'
106+
if: runner.os == 'macOS' && runner.arch == 'X64'
89107
uses: dawidd6/action-download-artifact@v3
90108
with:
91109
workflow: build.yaml
@@ -95,7 +113,7 @@ jobs:
95113
path: electron-app/binaries
96114

97115
- name: Download macOS ARM64 backend
98-
if: runner.os == 'macOS'
116+
if: runner.os == 'macOS' && runner.arch == 'ARM64'
99117
uses: dawidd6/action-download-artifact@v3
100118
with:
101119
workflow: build.yaml
@@ -140,20 +158,20 @@ jobs:
140158
ELECTRON_BUILDER_PUBLISH: never
141159

142160
- name: Display structure (Windows)
143-
if: matrix.os == 'windows-latest'
161+
if: runner.os == 'Windows'
144162
working-directory: electron-app
145163
shell: pwsh
146164
run: Get-ChildItem -Recurse dist/ | Select-Object FullName
147165

148166
- name: Display structure (Unix)
149-
if: matrix.os != 'windows-latest'
167+
if: runner.os != 'Windows'
150168
working-directory: electron-app
151169
run: ls -laR dist/
152170

153171
- name: Upload electron artifacts
154172
uses: actions/upload-artifact@v4
155173
with:
156-
name: electron-${{ runner.os }}
174+
name: electron-${{ runner.os }}-${{ runner.arch }}
157175
path: |
158176
electron-app/dist/*.exe
159177
electron-app/dist/*.AppImage

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2025 HyperloopUPV
3+
Copyright (c) 2025 Hyperloop UPV
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

backend/cmd/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ const (
7676

7777
var configFile = flag.String("config", "config.toml", "path to configuration file")
7878
var traceLevel = flag.String("trace", "info", "set the trace level (\"fatal\", \"error\", \"warn\", \"info\", \"debug\", \"trace\")")
79-
var traceFile = flag.String("log", "trace.json", "set the trace log file")
79+
var traceFile = flag.String("log", "", "set the trace log file")
8080
var cpuprofile = flag.String("cpuprofile", "", "write cpu profile to file")
8181
var enableSNTP = flag.Bool("sntp", false, "enables a simple SNTP server on port 123")
8282
var networkDevice = flag.Int("dev", -1, "index of the network device to use, overrides device prompt")

electron-app/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@ npm run dist:mac # macOS
7575
npm run dist:linux # Linux
7676
```
7777

78+
### macOS Requirements
79+
80+
On macOS, the backend requires the loopback address `127.0.0.9` to be configured. If you encounter a "can't assign requested address" error when starting the backend, run:
81+
82+
```
83+
sudo ipconfig set en0 INFORM 127.0.0.9
84+
```
85+
7886
## Available Scripts
7987

8088
```

electron-app/package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,17 @@
9090
"zip"
9191
],
9292
"icon": "icon.icns",
93-
"category": "public.app-category.utilities"
93+
"category": "public.app-category.utilities",
94+
"artifactName": "${productName}-${version}-macos-${arch}.${ext}"
9495
},
9596
"linux": {
9697
"target": [
9798
"AppImage",
9899
"deb"
99100
],
100101
"icon": "icon.png",
101-
"category": "Utility"
102+
"category": "Utility",
103+
"artifactName": "${productName}-${version}-linux-${arch}.${ext}"
102104
}
103105
}
104-
}
106+
}

electron-app/src/processes/backend.js

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ const appPath = getAppPath();
2222
// Store the backend process instance
2323
let backendProcess = null;
2424

25+
// Store error messages (keep last 10 lines to avoid memory issues)
26+
let lastBackendError = null;
27+
2528
/**
2629
* Starts the backend process by spawning the backend binary with the user configuration.
2730
* @returns {void}
@@ -57,6 +60,14 @@ function startBackend() {
5760
logger.backend.info(`${data.toString().trim()}`);
5861
});
5962

63+
// Capture stderr output (where Go errors/panics are written)
64+
backendProcess.stderr.on("data", (data) => {
65+
const errorMsg = data.toString().trim();
66+
logger.backend.error(errorMsg);
67+
// Store the last error message
68+
lastBackendError = errorMsg;
69+
});
70+
6071
// Handle spawn errors
6172
backendProcess.on("error", (error) => {
6273
logger.backend.error(`Failed to start backend: ${error.message}`);
@@ -71,10 +82,18 @@ function startBackend() {
7182
logger.backend.info(`Backend process exited with code ${code}`);
7283
// Show error dialog if process crashed (non-zero exit code)
7384
if (code !== 0 && code !== null) {
74-
dialog.showErrorBox(
75-
"Backend Crashed",
76-
`Backend exited with code ${code}`
77-
);
85+
// Build error message with actual error details
86+
let errorMessage = `Backend exited with code ${code}`;
87+
88+
if (lastBackendError) {
89+
errorMessage += `\n\n${lastBackendError}`;
90+
} else {
91+
errorMessage += "\n\n(No error output captured)";
92+
}
93+
94+
dialog.showErrorBox("Backend Crashed", errorMessage);
95+
// Clear error message after showing
96+
lastBackendError = null;
7897
}
7998
});
8099
}

ethernet-view/package-lock.json

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)