Skip to content

Commit 48977c2

Browse files
committed
Add mvx self-build capability and fix CGO handling
- Add build and test commands to .mvx/config.json5 so mvx can build itself - Fix CGO_ENABLED handling in release workflow for macOS compatibility - Use CGO_ENABLED=1 for macOS builds, CGO_ENABLED=0 for other platforms - mvx can now build itself with './mvx build' (basic build) - Makefile still provides platform-optimized builds with proper flags This prepares for v0.3.0 release and future transition to mvx-only builds.
1 parent ed733e1 commit 48977c2

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

.github/workflows/release.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,19 +66,20 @@ jobs:
6666
env:
6767
GOOS: ${{ matrix.goos }}
6868
GOARCH: ${{ matrix.goarch }}
69-
CGO_ENABLED: 0
69+
# Use CGO_ENABLED=1 for macOS to avoid security restrictions, 0 for others
70+
CGO_ENABLED: ${{ matrix.goos == 'darwin' && '1' || '0' }}
7071
run: |
7172
BINARY_NAME="mvx-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.suffix }}"
72-
73+
7374
go build \
7475
-ldflags "-s -w -X main.Version=${{ steps.version.outputs.version_no_v }} -X main.Commit=${{ github.sha }} -X main.Date=$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
7576
-o "dist/${BINARY_NAME}" \
7677
.
77-
78+
7879
# Create checksums
7980
cd dist
8081
sha256sum "${BINARY_NAME}" > "${BINARY_NAME}.sha256"
81-
82+
8283
echo "Built: ${BINARY_NAME}"
8384
ls -la "${BINARY_NAME}"*
8485

.mvx/config.json5

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,18 @@
2727

2828
// Custom commands
2929
commands: {
30+
build: {
31+
description: "Build mvx binary (use make build for platform-optimized builds)",
32+
script: "go build -o mvx-binary .",
33+
override: true
34+
},
35+
36+
test: {
37+
description: "Run all tests",
38+
script: "go test -v ./...",
39+
override: true
40+
},
41+
3042
hello: {
3143
description: "Say hello",
3244
script: "echo Hello from mvx! && mvn -v"

0 commit comments

Comments
 (0)