Skip to content

Commit b58c184

Browse files
author
playXE
committed
Merge pull request 'Fix CI' (#17) from fix-ci into main
Reviewed-on: https://codeberg.org/playXE/capy/pulls/17
2 parents c7f72a5 + 363fe61 commit b58c184

File tree

16 files changed

+7398
-7313
lines changed

16 files changed

+7398
-7313
lines changed

.forgejo/workflows/nightly.yml

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
workflow_dispatch:
66
jobs:
77
check-and-run:
8-
runs-on: self
8+
runs-on: fedora-latest
99
outputs:
1010
recent_commits: ${{ steps.check_commits.outputs.recent_commits }}
1111
date: ${{ steps.check_commits.outputs.date }}
@@ -35,22 +35,32 @@ jobs:
3535
matrix:
3636
arch: [x86_64]
3737

38-
runs-on: self
38+
runs-on: fedora-latest
3939
env:
40-
VERSION: nightly-${{ needs.check-and-run.outputs.date }}-${{ needs.check-and-run.outputs.short_sha }}
41-
MMTK_GC_TRIGGER: DynamicHeapSize:1G,4G
40+
VERSION: nightly-${{ needs.check-and-run.outputs.date }}
41+
MMTK_GC_TRIGGER: DynamicHeapSize:1G,8G
4242
steps:
4343
- name: Checkout
4444
uses: actions/checkout@v4
4545
- name: Install Rust toolchain
4646
uses: https://codeberg.org/wackbyte/rust-toolchain@trunk
4747
with:
4848
toolchain: nightly
49+
- name: Cache Rust dependencies
50+
uses: https://github.com/Swatinem/rust-cache@v2
51+
52+
- name: Cache apt dependencies
53+
uses: actions/cache@v4
54+
with:
55+
path: /var/cache/apt/archives
56+
key: ${{ runner.os }}-apt-v1
57+
restore-keys: |
58+
${{ runner.os }}-apt-
4959
- name: Install system deps
5060
shell: bash
5161
run: |
52-
apt-get update
53-
apt-get install -y clang lld rsync make
62+
apt update -y
63+
apt install -y gcc rsync make
5464
5565
- name: Build Capy
5666
shell: bash
@@ -60,4 +70,17 @@ jobs:
6070
shell: bash
6171
run: |
6272
make dist-portable
63-
73+
- name: Publish/Update Codeberg Release "nightly"
74+
uses: actions/forgejo-release@v2.7.3
75+
with:
76+
direction: upload
77+
url: https://codeberg.org
78+
repo: playxe/capy
79+
token: ${{ secrets.CODEBERG_TOKEN }}
80+
release-dir: dist
81+
override: true
82+
tag: nightly
83+
release-notes: |
84+
Nightly build of CapyScheme
85+
- Date: ${{ needs.check-and-run.outputs.date }}
86+
- Commit: ${{ needs.check-and-run.outputs.short_sha }}

.forgejo/workflows/release.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
on:
2+
push:
3+
tags:
4+
- 'v1.*'
5+
workflow_dispatch:
6+
workflow_call:
7+
8+
jobs:
9+
release:
10+
runs-on: fedora-latest
11+
env:
12+
VERSION: ${{ github.ref_name }}
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
- name: Install Rust toolchain
17+
uses: https://codeberg.org/wackbyte/rust-toolchain@trunk
18+
with:
19+
toolchain: nightly
20+
- name: Install system deps
21+
shell: bash
22+
run: |
23+
apt update -y
24+
apt install -y clang lld rsync make
25+
- name: Build Capy
26+
shell: bash
27+
run: |
28+
make build
29+
- name: Create portable tarball
30+
shell: bash
31+
run: |
32+
make dist-portable
33+
- name: Create deb package
34+
shell: bash
35+
run: |
36+
make dist-deb
37+
- name: Create rpm package
38+
shell: bash
39+
run: |
40+
make dist-rpm
41+
- name: Publish release
42+
uses: actions/forgejo-release@v2.7.3
43+
with:
44+
direction: upload
45+
url: https://codeberg.org
46+
repo: playxe/capy
47+
token: ${{ secrets.CODEBERG_TOKEN }}
48+
release-dir: dist
49+
override: true
50+
tag: ${{ env.VERSION }}
51+
release-notes: |
52+
"Release of CapyScheme ${{ env.VERSION }}"

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ capy-derive = { path = "capy-derive" }
5252
[profile.release]
5353
incremental = true
5454
rpath = true
55-
debug = false
55+
debug = true
5656
debug-assertions = false
5757
lto = false
5858
panic = "abort"
59-
opt-level = 3
59+
opt-level = 2
6060

6161
[profile.dev]
6262
incremental = true

Makefile

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -81,23 +81,24 @@ CAPY_ENV = \
8181
LD_LIBRARY_PATH="$(TARGET_PATH)" \
8282
DYLD_FALLBACK_LIBRARY_PATH="$(TARGET_PATH)"
8383

84-
# -------------------------
85-
# Source lists ("arrays")
86-
# -------------------------
8784

8885
BOOT_SRCS := \
8986
lib/boot/prim.scm \
9087
lib/boot/control.scm \
9188
lib/boot/modules.scm \
9289
lib/boot/records.scm \
9390
lib/boot/conditions.scm \
91+
lib/boot/violations.scm \
92+
lib/boot/raise.scm \
9493
lib/boot/exceptions.scm \
9594
lib/boot/expand.scm \
9695
lib/boot/interpreter.scm \
9796
lib/boot/enums.scm \
9897
lib/boot/sys.scm \
9998
lib/boot/osdep.scm \
10099
lib/boot/iosys.scm \
100+
lib/boot/iosys2.scm \
101+
lib/boot/iosys3.scm \
101102
lib/boot/portio.scm \
102103
lib/boot/bytevectorio.scm \
103104
lib/boot/fileio.scm \
@@ -316,14 +317,14 @@ stage-0: build-runtime-bootstrap
316317
$(CC) bin/capyc.c -L$(TARGET_PATH) -o stage-0/capyc -lcapy -Wl,-rpath,$(RPATH_PORTABLE)
317318
cp $(TARGET_PATH)/libcapy.* stage-0/
318319

319-
XDG_CACHE_HOME="stage-0/cache" CAPY_LOAD_PATH=./lib LD_LIBRARY_PATH=stage-0/ DYLD_FALLBACK_LIBRARY_PATH=$(TARGET_PATH) stage-0/capy -L lib --fresh-auto-compile -c 42
320-
XDG_CACHE_HOME="stage-0/cache" CAPY_LOAD_PATH=./lib LD_LIBRARY_PATH=stage-0/ DYLD_FALLBACK_LIBRARY_PATH=$(TARGET_PATH) stage-0/capy -L lib --fresh-auto-compile -c '(import (rnrs))'
321-
XDG_CACHE_HOME="stage-0/cache" CAPY_LOAD_PATH=./lib LD_LIBRARY_PATH=stage-0/ DYLD_FALLBACK_LIBRARY_PATH=$(TARGET_PATH) stage-0/capy -L lib --fresh-auto-compile -c '(import (scheme base))'
322-
XDG_CACHE_HOME="stage-0/cache" CAPY_LOAD_PATH=./lib LD_LIBRARY_PATH=stage-0/ DYLD_FALLBACK_LIBRARY_PATH=$(TARGET_PATH) stage-0/capy -L lib --fresh-auto-compile -c '(import (srfi 1))'
323-
XDG_CACHE_HOME="stage-0/cache" CAPY_LOAD_PATH=./lib LD_LIBRARY_PATH=stage-0/ DYLD_FALLBACK_LIBRARY_PATH=$(TARGET_PATH) stage-0/capy -L lib --fresh-auto-compile -c '(import (srfi 13))'
320+
RUST_MIN_STACK=134217728 MMTK_PLAN=StickyImmix MMTK_GC_TRIGGER=DynamicHeapSize:2G,8G XDG_CACHE_HOME="stage-0/cache" CAPY_LOAD_PATH=./lib LD_LIBRARY_PATH=stage-0/ DYLD_FALLBACK_LIBRARY_PATH=$(TARGET_PATH) stage-0/capy -L lib --fresh-auto-compile -c 42
321+
RUST_MIN_STACK=134217728 MMTK_PLAN=StickyImmix MMTK_GC_TRIGGER=DynamicHeapSize:2G,8G XDG_CACHE_HOME="stage-0/cache" CAPY_LOAD_PATH=./lib LD_LIBRARY_PATH=stage-0/ DYLD_FALLBACK_LIBRARY_PATH=$(TARGET_PATH) stage-0/capy -L lib --fresh-auto-compile -c '(import (rnrs))'
322+
RUST_MIN_STACK=134217728 MMTK_PLAN=StickyImmix MMTK_GC_TRIGGER=DynamicHeapSize:2G,8G XDG_CACHE_HOME="stage-0/cache" CAPY_LOAD_PATH=./lib LD_LIBRARY_PATH=stage-0/ DYLD_FALLBACK_LIBRARY_PATH=$(TARGET_PATH) stage-0/capy -L lib --fresh-auto-compile -c '(import (scheme base))'
323+
RUST_MIN_STACK=134217728 MMTK_PLAN=StickyImmix MMTK_GC_TRIGGER=DynamicHeapSize:2G,8G XDG_CACHE_HOME="stage-0/cache" CAPY_LOAD_PATH=./lib LD_LIBRARY_PATH=stage-0/ DYLD_FALLBACK_LIBRARY_PATH=$(TARGET_PATH) stage-0/capy -L lib --fresh-auto-compile -c '(import (srfi 1))'
324+
RUST_MIN_STACK=134217728 MMTK_PLAN=StickyImmix MMTK_GC_TRIGGER=DynamicHeapSize:2G,8G XDG_CACHE_HOME="stage-0/cache" CAPY_LOAD_PATH=./lib LD_LIBRARY_PATH=stage-0/ DYLD_FALLBACK_LIBRARY_PATH=$(TARGET_PATH) stage-0/capy -L lib --fresh-auto-compile -c '(import (srfi 13))'
324325
ifeq ($(COMPILE_PSYNTAX),1)
325-
XDG_CACHE_HOME="stage-0/cache" CAPY_LOAD_PATH=./lib LD_LIBRARY_PATH=stage-0/ DYLD_FALLBACK_LIBRARY_PATH=$(TARGET_PATH) stage-0/capy -L lib -s lib/boot/compile-psyntax.scm lib/boot/psyntax.scm lib/boot/psyntax-exp.scm
326-
XDG_CACHE_HOME="stage-0/cache" CAPY_LOAD_PATH=./lib LD_LIBRARY_PATH=stage-0/ DYLD_FALLBACK_LIBRARY_PATH=$(TARGET_PATH) stage-0/capy -L lib --fresh-auto-compile -c '(import (scheme base) (rnrs))'
326+
MMTK_PLAN=StickyImmix MMTK_GC_TRIGGER=DynamicHeapSize:2G,8G XDG_CACHE_HOME="stage-0/cache" CAPY_LOAD_PATH=./lib LD_LIBRARY_PATH=stage-0/ DYLD_FALLBACK_LIBRARY_PATH=$(TARGET_PATH) stage-0/capy -L lib -s lib/boot/compile-psyntax.scm lib/boot/psyntax.scm lib/boot/psyntax-exp.scm
327+
RUST_MIN_STACK=134217728 MMTK_PLAN=StickyImmix MMTK_GC_TRIGGER=DynamicHeapSize:2G,8G XDG_CACHE_HOME="stage-0/cache" CAPY_LOAD_PATH=./lib LD_LIBRARY_PATH=stage-0/ DYLD_FALLBACK_LIBRARY_PATH=$(TARGET_PATH) stage-0/capy -L lib --fresh-auto-compile -c '(import (scheme base) (rnrs))'
327328
endif
328329

329330

@@ -332,7 +333,7 @@ endif
332333
compile-all: compile-boot compile-core compile-rnrs compile-srfi compile-r7rs compile-cli compile-capy
333334

334335
stage-1:
335-
$(MAKE) compile-all COMPILER=stage-0/capyc OUT=stage-1/compiled -j
336+
$(MAKE) compile-all COMPILER=stage-0/capyc OUT=stage-1/compiled
336337
@echo "Creating stage-1 CapyScheme"
337338
mkdir -p stage-1
338339
cp stage-0/capy stage-1/capy
@@ -341,7 +342,7 @@ stage-1:
341342
stage-2:
342343
@echo "Creating stage-2 CapyScheme"
343344
mkdir -p stage-2
344-
$(MAKE) compile-all COMPILER=stage-1/capyc OUT=stage-2/compiled -j
345+
$(MAKE) compile-all COMPILER=stage-1/capyc OUT=stage-2/compiled
345346
cp stage-1/capy stage-2/capy
346347
cp stage-1/capyc stage-2/capyc
347348

@@ -466,8 +467,8 @@ install-portable: build build-runtime-portable
466467
@echo "Installing CapyScheme to $(PREFIX)/capy/$(VERSION)"
467468
mkdir -p $(PREFIX)/capy/$(VERSION)/extensions
468469
rsync --checksum -r lib $(PREFIX)/capy/$(VERSION)
469-
cp stage-2/capy-full $(PREFIX)/capy/$(VERSION)/
470-
cp stage-2/capyc-full $(PREFIX)/capy/$(VERSION)/
470+
cp bin/capy-full $(PREFIX)/capy/$(VERSION)/capy
471+
cp bin/capyc-full $(PREFIX)/capy/$(VERSION)/capyc
471472
ln -sf $(PREFIX)/capy/$(VERSION)/capy $(PREFIX)/capy/$(VERSION)/capy-$(VERSION)
472473
cp $(TARGET_PATH)/libcapy.* $(PREFIX)/capy/$(VERSION)/
473474
cp -r stage-2/compiled $(PREFIX)/capy/$(VERSION)/
@@ -482,16 +483,16 @@ dist-portable: build build-runtime-portable
482483
stagedir=$${STAGEDIR:-stage-dist}; \
483484
outname=$${OUTNAME:-}; \
484485
mkdir -p "$$outdir"; \
485-
archive_name=$${outname:-capyscheme-$(VERSION)-$(TARGET)-$(ARCH)-$(PROFILE).tar.gz}; \
486+
archive_name=$${outname:-capyscheme-$(VERSION)-$(TARGET).tar.gz}; \
486487
stage_root="$$stagedir"; \
487488
stage_prefix="$$stage_root"; \
488489
stage_install_dir="$$stage_prefix/capy/$(VERSION)"; \
489490
echo "Staging portable install into $$stage_install_dir"; \
490491
rm -rf "$$stage_root"; \
491492
mkdir -p "$$stage_install_dir/extensions"; \
492493
rsync --checksum -r lib "$$stage_install_dir"; \
493-
cp stage-2/capy-full "$$stage_install_dir/"; \
494-
cp stage-2/capyc-full "$$stage_install_dir/"; \
494+
cp bin/capy-full "$$stage_install_dir/capy"; \
495+
cp bin/capyc-full "$$stage_install_dir/capyc"; \
495496
cp $(TARGET_PATH)/libcapy.* "$$stage_install_dir/"; \
496497
cp -r stage-2/compiled "$$stage_install_dir/"; \
497498
echo "Creating $$outdir/$$archive_name"; \

capy/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "capy"
3-
version = "0.1.0"
3+
version = "1.0.0"
44
edition = "2024"
55

66
[dependencies]

capy/src/cps/contify.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ type ContPair<'gc> = (LVarRef<'gc>, LVarRef<'gc>);
5454
/// Entry point: repeatedly applies `rec` until no further contifiable
5555
/// opportunities remain (idempotent fixed point).
5656
pub fn contify<'gc>(ctx: Context<'gc>, t: TermRef<'gc>) -> TermRef<'gc> {
57-
fixedpoint(t, Some(1))(|&t| rec(ctx, t))
57+
fixedpoint(t, Some(2))(|&t| rec(ctx, t))
5858
}
5959

6060
/// Recursive traversal that performs contification *inside* each `Fix`

capy/src/cps/optimizer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -630,11 +630,11 @@ pub fn shrink<'gc>(ctx: Context<'gc>, term: TermRef<'gc>) -> TermRef<'gc> {
630630
}
631631

632632
pub fn rewrite<'gc>(ctx: Context<'gc>, term: TermRef<'gc>) -> TermRef<'gc> {
633-
let simplified_tree = fixedpoint(term, Some(2))(|term| shrink(ctx, *term));
633+
let simplified_tree = fixedpoint(term, Some(3))(|term| shrink(ctx, *term));
634634

635635
let max_size = size(simplified_tree) * 3 / 2;
636636

637-
fixedpoint(simplified_tree, Some(1))(|term| inline(ctx, *term, max_size))
637+
fixedpoint(simplified_tree, Some(2))(|term| inline(ctx, *term, max_size))
638638
}
639639

640640
pub fn rewrite_func<'gc>(ctx: Context<'gc>, func: FuncRef<'gc>) -> FuncRef<'gc> {

lib/boot.scm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,17 @@
2626
($primitive-load "boot/modules.scm")
2727
($primitive-load "boot/records.scm")
2828
($primitive-load "boot/conditions.scm")
29+
($primitive-load "boot/violations.scm")
30+
($primitive-load "boot/raise.scm")
2931
($primitive-load "boot/exceptions.scm")
3032
($primitive-load "boot/expand.scm")
3133
($primitive-load "boot/interpreter.scm")
3234
($primitive-load "boot/enums.scm")
3335
($primitive-load "boot/sys.scm")
3436
($primitive-load "boot/osdep.scm")
3537
($primitive-load "boot/iosys.scm")
38+
($primitive-load "boot/iosys2.scm")
39+
($primitive-load "boot/iosys3.scm")
3640
($primitive-load "boot/portio.scm")
3741
($primitive-load "boot/bytevectorio.scm")
3842
($primitive-load "boot/fileio.scm")

0 commit comments

Comments
 (0)