Skip to content

Conversation

@ibetitsmike
Copy link
Contributor

This PR improves Windows build compatibility by introducing a conditional RUNNER variable in the Makefile.

Changes

  • Add RUNNER variable that conditionally uses:

    • npx on Windows (where bun x doesn't correctly pass arguments)
    • bun x on non-Windows systems for better performance
  • Update all 30+ commands to use $(RUNNER) instead of hardcoded bun x or npx

  • Add explanatory comments for Windows-specific behavior

Why this matters

On Windows, bun x doesn't correctly pass arguments to commands, causing build failures. This change ensures consistent build behavior across all platforms by using the appropriate tool for each OS.

Implementation

ifeq ($(OS),Windows_NT)
# Windows: Use npm/npx because bun x doesn't correctly pass arguments
RUNNER := npx
else
# Non-Windows: Use bun x for better performance  
RUNNER := bun x
endif

All commands now use $(RUNNER) for cross-platform compatibility.

Generated with cmux

- Add RUNNER variable that uses npx on Windows, bun x elsewhere
- Windows: bun x doesn't correctly pass arguments, so use npm run/npx
- Non-Windows: Continue using bun x for better performance
- Update all commands to use $(RUNNER) instead of hardcoded bun x or npx
- Add comments explaining why Windows needs different approach

This ensures consistent build behavior across all platforms while
working around Windows-specific limitations with bun's argument passing.
- Move bashPath.ts to src/utils/main/ (main-process-only utilities)
- Update all imports to use the new path
- Replace || with ?? for nullish coalescing (ESLint rule)
- Fixes static checks failing in CI
@ibetitsmike ibetitsmike merged commit 95b7df0 into mike/windows-build-fix Nov 13, 2025
6 of 9 checks passed
@ibetitsmike ibetitsmike deleted the runner-improvements-for-mike branch November 13, 2025 19:15
ibetitsmike added a commit that referenced this pull request Nov 13, 2025
…#572)

This PR improves Windows build compatibility by introducing a
conditional `RUNNER` variable in the Makefile.

- **Add RUNNER variable** that conditionally uses:
  - `npx` on Windows (where `bun x` doesn't correctly pass arguments)
  - `bun x` on non-Windows systems for better performance

- **Update all 30+ commands** to use `$(RUNNER)` instead of hardcoded
`bun x` or `npx`

- **Add explanatory comments** for Windows-specific behavior

On Windows, `bun x` doesn't correctly pass arguments to commands,
causing build failures. This change ensures consistent build behavior
across all platforms by using the appropriate tool for each OS.

```makefile
ifeq ($(OS),Windows_NT)
RUNNER := npx
else
RUNNER := bun x
endif
```

All commands now use `$(RUNNER)` for cross-platform compatibility.

_Generated with `cmux`_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant