Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
121fa33
Normalize main signatures in auto-aux tests, add missing includes, an…
Francesco146 Nov 5, 2025
3aa3e5a
Use rlwrap for interactive REPL (when stdin is a terminal)
Francesco146 Nov 5, 2025
7f48035
Use pkg-config to locate GMP headers and libs; add common fallbacks
Francesco146 Nov 5, 2025
bf1999e
CI: simplify workflow triggers, reformat job YAML, and upgrade action…
Francesco146 Nov 5, 2025
099e5ef
intinf/Makefile: add more GMP fallback paths and guard -I/-L flags
Francesco146 Nov 5, 2025
9cd47f3
CI: expand build matrix and add macOS arm64 + Windows builds; stage i…
Francesco146 Nov 5, 2025
22320ed
CI: adjust install and staging in buildAndTest workflow; run actual i…
Francesco146 Nov 5, 2025
f50d7d6
CI: remove Windows build job and stop installing gmp on macOS
Francesco146 Nov 5, 2025
1eb94fe
src/Makefile.inc: use i686-w64-mingw32-gcc for Cross_W32 cross-compiler
Francesco146 Nov 7, 2025
8d0dc46
CI: add mingw-w64 and Windows cross-build/upload to buildAndTest work…
Francesco146 Nov 7, 2025
f56f03c
fix: improve rlwrap availability check and warning messages
Francesco146 Nov 7, 2025
7137318
chore: update .gitignore to include comprehensive file patterns for b…
Francesco146 Nov 7, 2025
da7d012
feat: add Dockerfile and docker-compose configuration for building an…
Francesco146 Nov 7, 2025
aaf1e54
feat: add GitHub Actions workflow for Docker build and push
Francesco146 Nov 7, 2025
ca07940
fix: in docker rlwrap didn't work
Francesco146 Nov 7, 2025
560a209
fix: streamline clean commands in Makefile for better readability
Francesco146 Nov 7, 2025
400b4db
feat: update history file location in mosml.tpl to respect XDG Base D…
Francesco146 Nov 7, 2025
1650950
fix: add docker shared volumes to .gitignore
Francesco146 Nov 7, 2025
5e775ed
fix: add clean step before building Moscow ML in Dockerfile
Francesco146 Nov 7, 2025
0d06412
feat: add Windows build support and update rlwrap integration documen…
Francesco146 Nov 7, 2025
4ca2e18
fix(Makefile): ignore missing dirs in clean
Francesco146 Nov 7, 2025
f3dd0b5
fix: add clean step for cross compilation and support for Windows ins…
Francesco146 Nov 8, 2025
d4ec206
fix: update installation instructions for MOSML to set correct mosmll…
Francesco146 Nov 8, 2025
95cf012
revert: update Windows cross-compilation compiler to use i586-mingw32…
Francesco146 Nov 9, 2025
42692ce
fix: remove unnecessary clean step in cross compilation for Windows
Francesco146 Nov 9, 2025
6281577
fix: improve quoting in build script for Windows cross-compilation
Francesco146 Nov 13, 2025
73125f3
fix: update GMP library directory check to use 'ls' for better compat…
Francesco146 Nov 13, 2025
6221287
fix: correct typos in README for building Windows installer
Francesco146 Nov 13, 2025
7f8456a
fix: update Inno Setup script for Moscow ML version 2.10.5 and add It…
Francesco146 Nov 13, 2025
335d786
feat: add Dockerfile and build script for cross-compilation of Window…
Francesco146 Nov 14, 2025
ba59427
fix: enhance Windows build process with Docker and Inno Setup integra…
Francesco146 Nov 14, 2025
4fb8675
fix: update version number to 2.10.5 in Makefile.inc
Francesco146 Nov 14, 2025
90c68cb
fix: correct path for copying Windows binaries in build process
Francesco146 Nov 14, 2025
8f43e0a
fix: update build workflow to use a windows runner
Francesco146 Nov 14, 2025
12ea1dc
Merge remote-tracking branch 'fork/devel' into gnu-tty-stds-and-fixes
Francesco146 Nov 14, 2025
15d25ff
fix: avoid 64-bit literal to restore builds on 32-bit runners
Francesco146 Nov 14, 2025
1634277
fix: remove duplicated binaries from .dockerignore
Francesco146 Nov 14, 2025
70039b1
fix: remove duplicate file in gitignore
Francesco146 Nov 14, 2025
3c61ef2
fix: validate JOBS input as a positive integer in build-win.sh, simpl…
Francesco146 Nov 14, 2025
3e63dc4
fix: restrict branches for push and pull_request events, update rlwra…
Francesco146 Nov 14, 2025
fc67e1a
fix: correct formatting of Danish uninstall program message in instal…
Francesco146 Nov 14, 2025
84b1250
fix(word64): use proper sign-extending primitives and add runtime sup…
Francesco146 Nov 14, 2025
804b4cd
fix(runtime): correct unbalanced parentheses in int64 multiply overfl…
Francesco146 Nov 14, 2025
aac0f0c
fix: portable string comparison operator in rlwrap disable check
Francesco146 Nov 14, 2025
36f4401
fix: update source label URL in Dockerfile
Francesco146 Nov 14, 2025
82e40e3
fix(word64): make shift functions safe for large shift counts
Francesco146 Nov 14, 2025
9f3f279
fix(install): enhance Windows installation script with error checks a…
Francesco146 Nov 14, 2025
c1445f2
fix(launch): change shebang to bash and improve rlwrap handling
Francesco146 Nov 14, 2025
e60f64e
fix(docker): enhance Dockerfiles with improved dependency installatio…
Francesco146 Nov 14, 2025
7da4a43
fix(build): update shebang in build script and enhance zip creation c…
Francesco146 Nov 14, 2025
6f06551
fix: change main function signature to void for consistency
Francesco146 Nov 14, 2025
ced2db5
fix(build): remove mingw-w64 from Linux dependency installation
Francesco146 Nov 14, 2025
4cc486c
fix(workflow): include gnu-tty-stds-and-fixes branch in push triggers
Francesco146 Dec 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Build artifacts
*.o
*.a
*.so
*.dylib
*.uo
*.ui
camlrunm
mosmlcmp
mosmllnk
mosmllex
mosmlyac

# Binaries (top-level names only)
mosmldep
cutdeps

# Generated files
src/compiler/Parser.sig
src/compiler/Parser.sml
src/compiler/Lexer.sml
src/compiler/Opcodes.sml
src/compiler/Predef.sml
src/compiler/Prim_c.sml
src/runtime/primitives
src/config/m.h
src/config/s.h

# Build directories
bin/
lib/
include/

# OS files
.DS_Store
.git
.github
*.swp
*~

# Documentation and examples (not needed for build)
doc/
examples/

# Staging and install directories
staging/
win-root/
297 changes: 247 additions & 50 deletions .github/workflows/buildAndTest.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,254 @@
name: Build & Test

on:
pull_request:
push:
branches: ["main", "develop", "gnu-tty-stds-and-fixes"] # delete this branch name when merged
tags: ["v*.*.*"]
pull_request:
branches: ["main", "develop"]
release:
types: [created]
workflow_dispatch:

push:
branches:
- master
- devel
jobs:
build-test:
name: Build & Test (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
platform: linux
arch: x86_64
- os: macos-latest
platform: macos
arch: x86_64
- os: macos-14
platform: macos
arch: arm64

runs-on: ${{ matrix.os }}

jobs:
steps:
- name: Checkout
uses: actions/checkout@v5

- name: Install dependencies (Ubuntu)
if: matrix.platform == 'linux'
run: |
sudo apt-get update -qq
sudo apt-get install -y binutils build-essential perl libgmp-dev rlwrap

- name: Install dependencies (macOS)
if: matrix.platform == 'macos'
run: |
brew update
brew install rlwrap

- name: Build
run: |
cd src && make world

- name: Install
run: |
cd src
sudo make install

- name: Test compiler and runtime system
run: |
cd src/test
make current cleaned
diff cleaned-result cleaned-result.ok

- name: Test mosmllib
run: |
cd src/mosmllib/test
make current cleaned
diff cleaned-result cleaned-result.ok

- name: Create staging directory for artifact
run: |
cd src
make DESTDIR=${{ github.workspace }}/staging PREFIX=/usr/local install

- name: Create artifact archive
run: |
cd staging
tar -czf ../mosml-${{ matrix.platform }}-${{ matrix.arch }}.tar.gz usr/local

- name: Set up Docker Buildx (on Linux)
if: matrix.platform == 'linux'
uses: docker/setup-buildx-action@v3

- name: Build Windows binaries using Docker (on Linux)
if: matrix.platform == 'linux'
run: |
mkdir -p out
docker build --platform=linux/386 -t mosml-win-builder -f Dockerfile.w32 .
docker run --rm -v "$(pwd)/out:/out" mosml-win-builder

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: mosml-${{ matrix.platform }}-${{ matrix.arch }}
path: mosml-${{ matrix.platform }}-${{ matrix.arch }}.tar.gz
retention-days: 30

- name: Upload Windows build artifact
if: matrix.platform == 'linux'
uses: actions/upload-artifact@v4
with:
name: mosml-windows-x86_64-zip
path: out/mosml-windows-x86_64.zip
retention-days: 30

build-windows-installer:
name: Build Windows Installer
needs: [build-test]
runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v5

- name: Download Windows zip artifact
uses: actions/download-artifact@v4
with:
name: mosml-windows-x86_64-zip
path: .

- name: Extract Windows binaries
run: |
Expand-Archive -Path mosml-windows-x86_64.zip -DestinationPath . -Force
shell: pwsh

- name: Prepare Inno Setup directory
run: |
New-Item -ItemType Directory -Path inno-setup-build -Force
Copy-Item -Path mosml -Destination inno-setup-build/ -Recurse
Copy-Item -Path src/tools/installer/mosml.iss -Destination inno-setup-build/
shell: pwsh

- name: Build Windows Installer with Inno Setup
uses: Minionguyjpro/Inno-Setup-Action@v1.2.7
with:
path: inno-setup-build/mosml.iss
options: /O+

- name: Rename installer
run: |
$installerPath = Get-ChildItem -Path inno-setup-build/Output -Filter "mosml-setup-*.exe" | Select-Object -First 1
if ($installerPath) {
Move-Item -Path $installerPath.FullName -Destination mosml-setup-windows-x86_64.exe
Write-Host "Installer created: mosml-setup-windows-x86_64.exe"
} else {
Write-Host "No installer found in Output directory"
Get-ChildItem -Path inno-setup-build/Output -Recurse
}
shell: pwsh

- name: Upload Windows Installer artifact
uses: actions/upload-artifact@v4
with:
name: mosml-windows-installer
path: mosml-setup-windows-x86_64.exe
retention-days: 30

create-release:
name: Create Release
needs: [build-test, build-windows-installer]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout
uses: actions/checkout@v5

- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts

- name: Display structure of downloaded files
run: ls -R artifacts

- name: Extract version from tag
id: version
run: echo "version=${GITHUB_REF#refs/tags/v}" >> "$GITHUB_OUTPUT"

- name: Create release notes
run: |
cat > release_notes.md << 'EOF'
# Moscow ML ${{ steps.version.outputs.version }}

This release includes builds for multiple platforms and architectures:

## Platform Support
- **Linux (x86_64)**: Full support with rlwrap integration
- **macOS (x86_64)**: Intel-based Macs with rlwrap integration
- **macOS (arm64)**: Apple Silicon (M1/M2/M3) with rlwrap integration
- **Windows (x86_64)**: Native Windows build

## Features
- Standard ML (SML'97) implementation
- Bytecode compiler and runtime
- Separate compilation support
- Dynamic linking (on supported platforms)
- Interactive REPL with **rlwrap** support for command history and line editing
- Full Standard ML Basis Library

## Installation

### Windows
Download and run the installer: `mosml-setup-windows-x86_64.exe`

The installer will:
- Install Moscow ML to `C:\Program Files\mosml` (or custom location)
- Add Moscow ML to your system PATH
- Create Start Menu shortcuts
- Optionally create desktop shortcuts

Alternatively, extract the portable ZIP archive: `mosml-windows-x86_64.zip`

### Linux / macOS
```bash
# Extract the archive
tar -xzf mosml-<platform>-<arch>.tar.gz

# Copy to system (requires root)
sudo cp -r usr/local/* /usr/local/

# Or install to custom location
tar -xzf mosml-<platform>-<arch>.tar.gz -C $HOME/.local --strip-components=2
export PATH="$HOME/.local/bin:$PATH"
```

## rlwrap Integration
The `mosml` interactive REPL now automatically uses `rlwrap` when available, providing:
- Command history (saved to $XDG_DATA_HOME/mosml/history or $HOME/.local/share/mosml/history, if XDG_DATA_HOME is not set)
- Line editing with arrow keys
- Tab completion support

To disable rlwrap, set the `DISABLE_RLWRAP=1` environment variable before running mosml.

## Documentation
See the [project repository](https://github.com/${{ github.repository }}) for full documentation.
EOF

build-test:

strategy:
matrix:
os: [ubuntu-latest, macos-latest]

runs-on: ${{ matrix.os }}

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install dependencies (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update -qq
sudo apt-get install -y binutils build-essential perl libgmp-dev

- name: Install dependencies (macOS)
if: matrix.os == 'macos-latest'
run: |
brew update
brew install gmp

- name: Build
run: |
cd src && make world

- name: Install
run: |
cd src
sudo make install

- name: Test compiler and runtime system
run: |
cd src/test
make current cleaned
diff cleaned-result cleaned-result.ok

- name: Test mosmllib
run: |
cd src/mosmllib/test
make current cleaned
diff cleaned-result cleaned-result.ok
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
name: Moscow ML ${{ steps.version.outputs.version }}
body_path: release_notes.md
draft: false
prerelease: false
files: |
artifacts/mosml-linux-x86_64/mosml-linux-x86_64.tar.gz
artifacts/mosml-macos-x86_64/mosml-macos-x86_64.tar.gz
artifacts/mosml-macos-arm64/mosml-macos-arm64.tar.gz
artifacts/mosml-windows-installer/mosml-setup-windows-x86_64.exe
artifacts/mosml-windows-x86_64-zip/mosml-windows-x86_64.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading