Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
fb001ba
feat: support arm constructors by requiring llvm arrays
ghaith Oct 30, 2025
2467306
Merge branch 'master' into fix_arm_constructors
ghaith Jan 21, 2026
05cd698
Merge remote-tracking branch 'origin/master' into fix_arm_constructors
ghaith Jan 27, 2026
c90403a
Merge branch 'master' into fix_arm_constructors
ghaith Feb 3, 2026
0bcdf29
Merge remote-tracking branch 'origin/master' into fix_arm_constructors
ghaith Feb 9, 2026
a0bf3ec
fix: the tests were broken after merge
ghaith Feb 9, 2026
7736644
fix snapshot after disabling some debug info
ghaith Feb 9, 2026
7563cc7
Merge branch 'master' into fix_arm_constructors
ghaith Feb 10, 2026
2c75e96
Merge branch 'master' into fix_arm_constructors
ghaith Feb 10, 2026
6826991
Merge branch 'master' into fix_arm_constructors
ghaith Feb 12, 2026
c6710e9
update insta snapshots after merge
ghaith Feb 12, 2026
43a9400
Merge remote-tracking branch 'origin/master' into fix_arm_constructors
ghaith Feb 13, 2026
7829d70
adjust the llvm wrapper as recommended by the review. Fixed spelling
ghaith Feb 16, 2026
9b18861
Add aarch64 Linux build and update manifest
ghaith Feb 16, 2026
d7209f7
delete old manifest if it exists
ghaith Feb 16, 2026
15bcc49
remove the --amend
ghaith Feb 16, 2026
bde5347
explicitly remove all manifests
ghaith Feb 16, 2026
392d257
trusting copilot with ci, what could go wrong
ghaith Feb 16, 2026
e69b8fe
change dockerfile path
ghaith Feb 16, 2026
112c52e
Merge branch 'master' into fix_arm_constructors
ghaith Feb 17, 2026
e4055b4
update the workflow for multibranch
ghaith Feb 17, 2026
0bc19dd
only build the lib on one platform, it's multiplatform anyway
ghaith Feb 19, 2026
3988506
install the aarch64 compiler
ghaith Feb 19, 2026
655ad07
Merge branch 'master' into fix_arm_constructors
ghaith Feb 19, 2026
3e82a40
fix persmissions for the job
ghaith Feb 20, 2026
784a1a5
Merge branch 'master' into fix_arm_constructors
ghaith Feb 23, 2026
f3cacd0
Merge branch 'master' into fix_arm_constructors
ghaith Feb 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
170 changes: 136 additions & 34 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ jobs:

test-linux:
name: Test Linux
runs-on: ubuntu-latest
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config:
- { os: "ubuntu-latest" }
- { os: "ubuntu-24.04-arm" }
steps:
- name: Free up disk space on runner
uses: jlumbroso/free-disk-space@main
Expand Down Expand Up @@ -54,13 +59,25 @@ jobs:
-c "df -h && ./scripts/build.sh --build --test"

package-linux:
name: Package Linux
runs-on: ubuntu-latest
name: Package Linux (${{ matrix.config.arch }})
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config:
- { os: "ubuntu-latest", arch: "x86_64" }
- { os: "ubuntu-24.04-arm", arch: "aarch64" }
container: ghcr.io/plc-lang/rust-llvm:latest
steps:
- uses: actions/checkout@v3

- name: Release Build
- name: Release Build (native ${{ matrix.config.arch }})
shell: bash
run: |
echo "Building native binary for ${{ matrix.config.arch }}"
./scripts/build.sh --build --release --package

- name: Build and package the std lib
if: matrix.config.arch == 'x86_64'
shell: bash
run: |
# required by aarch64 build
Expand All @@ -75,65 +92,150 @@ jobs:
--target x86_64-linux-gnu,aarch64-linux-gnu, \
x86_64-unknown-linux-gnu,aarch64-unknown-linux-gnu

- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v4
with:
name: plc
name: plc-${{ matrix.config.arch }}
path: target/release/plc
if-no-files-found: error

- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v4
if: matrix.config.arch == 'x86_64'
with:
name: schema
path: compiler/plc_project/schema
name: stdlib
path: output/

- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v4
if: matrix.config.arch == 'x86_64'
with:
name: stdlib
path: output
# Push image to GitHub Packages.
# See also https://docs.docker.com/docker-hub/builds/
build-image:
runs-on: ubuntu-latest
name: schema
path: compiler/plc_project/schema/

build-and-push-image:
name: Build Image (${{ matrix.config.arch }})
runs-on: ${{ matrix.config.os }}
needs: package-linux
strategy:
matrix:
config:
- { os: "ubuntu-latest", arch: "x86_64", docker_arch: "amd64" }
- { os: "ubuntu-24.04-arm", arch: "aarch64", docker_arch: "arm64" }
permissions:
actions: read
packages: write
contents: read

steps:
- uses: actions/checkout@v3

- name: Download plc artifacts
- name: Download binary artifact
uses: actions/download-artifact@v4
with:
path: artifacts/
name: plc-${{ matrix.config.arch }}
path: artifacts/plc/

- name: Build image
shell: bash
- name: Download stdlib
uses: actions/download-artifact@v4
with:
name: stdlib
path: artifacts/stdlib/

- name: Prepare artifacts
run: |
chmod +x artifacts/plc/plc
echo "Binary architecture:"
file artifacts/plc/plc

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build Docker image
run: |
docker buildx build . \
--platform linux/amd64 \
--platform linux/${{ matrix.config.docker_arch }} \
--file Dockerfile \
--tag $IMAGE_NAME \
--tag ${{ env.IMAGE_NAME }}:local \
--load

- name: Log in to registry
if: ${{ github.event_name != 'pull_request' && github.ref_name == 'master' }}
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/master' }}
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Push image
if: ${{ github.event_name != 'pull_request' && github.ref_name == 'master' }}
shell: bash
- name: Push image with temp tag
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/master' }}
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
TEMP_TAG="build-${{ github.run_id }}-${{ matrix.config.arch }}"

docker tag ${{ env.IMAGE_NAME }}:local $IMAGE_ID:$TEMP_TAG
docker push $IMAGE_ID:$TEMP_TAG
echo "Pushed: $IMAGE_ID:$TEMP_TAG"

- name: Simulate push (PR only)
if: ${{ github.event_name == 'pull_request' }}
run: |
echo "=========================================="
echo "SIMULATION MODE (Pull Request)"
echo "Would push: ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:build-${{ github.run_id }}-${{ matrix.config.arch }}"
echo "Platform: linux/${{ matrix.config.docker_arch }}"
echo "=========================================="

push-multiplatform:
name: Push Multiplatform Manifest
needs: build-and-push-image
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/master' }}
permissions:
packages: write
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Create and push manifest
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')

echo "Creating multiplatform manifest..."
docker buildx imagetools create \
-t $IMAGE_ID:latest \
$IMAGE_ID:build-${{ github.run_id }}-x86_64 \
$IMAGE_ID:build-${{ github.run_id }}-aarch64

echo "Pushed: $IMAGE_ID:latest"

- name: Cleanup temp tags
if: always()
continue-on-error: true
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')

# Delete temp images by tag
for ARCH in x86_64 aarch64; do
TEMP_TAG="build-${{ github.run_id }}-$ARCH"
echo "Deleting $TEMP_TAG..."

# Get version ID for this tag
VERSION_ID=$(gh api \
-H "Accept: application/vnd.github+json" \
"/orgs/${{ github.repository_owner }}/packages/container/${{ env.IMAGE_NAME }}/versions" \
--jq ".[] | select(.metadata.container.tags[] == \"$TEMP_TAG\") | .id")

# Always pushing latest for now.
VERSION=latest
if [ -n "$VERSION_ID" ]; then
gh api --method DELETE \
-H "Accept: application/vnd.github+json" \
"/orgs/${{ github.repository_owner }}/packages/container/${{ env.IMAGE_NAME }}/versions/$VERSION_ID" || true
echo "Deleted version $VERSION_ID"
fi
done

echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
echo "Cleanup complete"

docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
style:
name: Check Style
runs-on: ubuntu-latest
Expand Down
18 changes: 14 additions & 4 deletions .github/workflows/lit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,20 @@ on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
pull_request:
branches: [ master ]
branches: [master]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
lit-linux-debug:
name: lit tests (Linux, debug build)
runs-on: ubuntu-latest
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config:
- { os: "ubuntu-latest" }
- { os: "ubuntu-24.04-arm" }
container: ghcr.io/plc-lang/rust-llvm:latest
steps:
- uses: actions/checkout@v3
Expand All @@ -24,12 +29,17 @@ jobs:

lit-linux-release:
name: lit tests (Linux, release build)
runs-on: ubuntu-latest
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config:
- { os: "ubuntu-latest" }
- { os: "ubuntu-24.04-arm" }
container: ghcr.io/plc-lang/rust-llvm:latest
steps:
- uses: actions/checkout@v3

- name: Run `build.sh --lit --release`
shell: bash
run: |
./scripts/build.sh --lit --release
./scripts/build.sh --lit --release
58 changes: 57 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,62 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [


{
"type": "lldb",
"request": "launch",
"name": "Debug codelldb empty project",
Comment thread
ghaith marked this conversation as resolved.
"cargo": {
"args": [
"build",
"--bin=plc",
"--package=plc_driver"
],
"filter": {
"name": "plc",
"kind": "bin"
}
},
"program": "target/debug/plc",
"args": [
"build",
"./tests/integration/data/empty_proj/conf/plc.json",
"--debug"
],
"cwd": "${workspaceFolder}",
"env": {
"RUST_LOG": "rusty"
},
"terminal": "integrated",
"initCommands":["settings set target.disable-aslr false"]
},
{
"type": "codelldb",
"request": "launch",
"name": "Debug codelldb empty project",
Comment thread
ghaith marked this conversation as resolved.
"cargo": {
"args": [
"build",
"--bin=plc",
"--package=plc_driver"
],
"filter": {
"name": "plc",
"kind": "bin"
}
},
"program": "target/debug/plc",
"args": [
"build",
"tests/integration/data/empty_proj/conf/plc.json"
],
"cwd": "${workspaceFolder}",
"env": {
"RUST_LOG": "rusty"
},
"terminal": "integrated"
},
{
"type": "codelldb",
"request": "launch",
Expand Down Expand Up @@ -116,4 +172,4 @@
"terminal": "integrated"
}
]
}
}
Loading
Loading