Skip to content

Cross-platform: Linux + macOS support, remove Nepeta (closes #19) - #25

Merged
melogtm merged 2 commits into
mainfrom
feature/cross-platform
Nov 12, 2026
Merged

melogtm merged 2 commits into
mainfrom
feature/cross-platform

Conversation

@melogtm

@melogtm melogtm commented Nov 12, 2026

Copy link
Copy Markdown
Owner

Summary

Portability analysis and fixes for #19. Supported targets are now Linux and macOS. Windows is documented as WSL/MSYS2/Cygwin only. Nepeta mode (#24) is removed as requested.

Analysis

src/ already uses only POSIX APIs (fork, execvp, waitpid, pipe, dup2, open, glob, getline, strndup, setenv, getcwd), and all of them exist on macOS. The Linux-only parts were in the tests and in CI/release:

# Problem on macOS Fix
1 test_cd_to_tmp expects getcwd() == /tmp, but on macOS /tmp → /private/tmp Compare against realpath("/tmp", NULL)
2 /bin/true does not exist on macOS (only /usr/bin/true). cd /tmp | /bin/true exits 127 Use true via PATH. test_execute_external_command now also asserts status 0 (it used to pass even when exec failed)
3 CI ran only on ubuntu-latest build-and-test matrix: ubuntu-latest + macos-latest. sanitize/lint stay Linux-only (no LeakSanitizer on macOS)
4 The release uploaded a bare shell, so a second platform's asset would collide Matrix build → trigger-linux-x86_64, trigger-macos-arm64, published by a single job (no race creating the release)

Native Windows is out of scope: process launch, pipes, redirection and globbing would all need a Win32 rewrite.

Changes

Testing

  • Linux: all 5 suites pass locally (input 342, builtins 32, execute 7, pipeline 76, glob 38)
  • macOS: verified by this PR's build-and-test (macos-latest) job
  • release.yml only runs on a v*.*.* tag, so it is untested until the next release

🤖 Generated with Claude Code

melogtm and others added 2 commits November 12, 2026 19:58
Reverts the PR #24 merge (1144730), restoring the pre-Nepeta builtins,
main loop, CMake targets and tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Tests: resolve /tmp with realpath (it is /private/tmp on macOS) and
  call 'true' via PATH instead of /bin/true (absent on macOS)
- CI: run build-and-test on ubuntu-latest and macos-latest
- Release: build per-platform binaries (trigger-linux-x86_64,
  trigger-macos-arm64) and publish them from a single job
- Docs: README platforms section, CLAUDE.md CI/portability notes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@melogtm
melogtm merged commit 53f1595 into main Nov 12, 2026
4 checks passed
@melogtm
melogtm deleted the feature/cross-platform branch November 12, 2026 23:00
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