Compare commits

...

2 Commits

Author SHA1 Message Date
retropikzel 52e17ff06e Adding tests to Jenkins 2025-06-08 11:16:23 +03:00
retropikzel df23d7f230 Minor fixes 2025-06-08 10:30:29 +03:00
9 changed files with 132 additions and 249 deletions

View File

@ -3,9 +3,22 @@ FROM debian:bookworm AS build
RUN apt-get update && apt-get install -y build-essential wget make cmake libgc-dev zlib1g-dev libffi-dev libssl-dev
RUN wget https://bitbucket.org/ktakashi/sagittarius-scheme/downloads/sagittarius-0.9.12.tar.gz && tar -xf sagittarius-0.9.12.tar.gz
RUN cd sagittarius-0.9.12 && mkdir build && cd build && cmake -DCMAKE_INSTALL_PREFIX=/usr/local-other .. && make && make install
WORKDIR /workdir
COPY Makefile .
COPY compile-r7rs.scm .
COPY snow/ snow/
COPY libs/ libs/
RUN ls -1
RUN make && make install PREFIX=/usr/local-other
FROM schemers/${COMPILE_R7RS}
RUN apt-get update && apt-get install -y make libffi8 libgc1 libssl3 libuv1
RUN apt-get update && apt-get install -y \
build-essential \
make \
libffi8 \
libgc1 \
libssl3 \
libuv1
COPY --from=build /usr/local-other/ /usr/local-other/
ENV PATH=${PATH}:/usr/local-other/bin
ARG COMPILE_R7RS=chibi

View File

@ -1,2 +1,12 @@
FROM debian:bookworm
RUN apt-get update && apt-get install -y make docker
FROM schemers/sagittarius
RUN apt-get update && apt-get install -y \
build-essential wget make cmake libgc-dev zlib1g-dev libffi-dev \
libssl-dev docker.io
WORKDIR /builddir
COPY Makefile .
COPY compile-r7rs.scm .
COPY snow/ snow/
COPY libs/ libs/
RUN ls -1
RUN make && make install
WORKDIR /workdir

237
Jenkinsfile vendored
View File

@ -1,224 +1,37 @@
pipeline {
agent any
agent {
dockerfile {
filename 'Dockerfile.jenkins'
args '--user=root -v /var/run/docker.sock:/var/run/docker.sock'
}
}
options {
disableConcurrentBuilds()
buildDiscarder(logRotator(numToKeepStr: '10', artifactNumToKeepStr: '10'))
buildDiscarder(logRotator(numToKeepStr: '10', artifactNumToKeepStr: '10'))
}
stages {
stage("Build") {
agent { dockerfile { filename 'Dockerfile'; args '--user=root'; additionalBuildArgs '--build-arg COMPILE_R7RS=sagittarius' } }
stage("Get implementation lists") {
steps {
sh 'make'
sh 'make install'
sh 'make test-r6rs'
sh 'make test-r7rs'
}
}
stage("chez r6rs") {
agent { dockerfile { filename 'Dockerfile'; args '--user=root'; additionalBuildArgs '--build-arg COMPILE_R7RS=chezscheme' } }
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh 'make && make install'
sh 'make test-r6rs'
script {
r6rs_implementations = sh 'sash -L ./snow -L . compile-r7rs.scm --list-r6rs-schemes'
r7rs_implementations = sh 'sash -L ./snow -L . compile-r7rs.scm --list-r7rs-schemes'
}
}
}
stage("chibi r7rs") {
agent { dockerfile { filename 'Dockerfile'; args '--user=root'; additionalBuildArgs '--build-arg COMPILE_R7RS=chibi' } }
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh 'make && make install'
sh 'make test-r7rs'
}
}
}
stage("cyclone r7rs") {
agent { dockerfile { filename 'Dockerfile'; args '--user=root'; additionalBuildArgs '--build-arg COMPILE_R7RS=cyclone' } }
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh 'make && make install'
sh 'make test-r7rs'
}
}
}
stage("foment r7rs") {
agent { dockerfile { filename 'Dockerfile'; args '--user=root'; additionalBuildArgs '--build-arg COMPILE_R7RS=foment' } }
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh 'make && make install'
sh 'make test-r7rs'
}
}
}
stage("gauche r7rs") {
agent { dockerfile { filename 'Dockerfile'; args '--user=root'; additionalBuildArgs '--build-arg COMPILE_R7RS=gauche' } }
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh 'make && make install'
sh 'make test-r7rs'
}
}
}
stage("guile r6rs") {
agent { dockerfile { filename 'Dockerfile'; args '--user=root'; additionalBuildArgs '--build-arg COMPILE_R7RS=guile' } }
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh 'make && make install'
sh 'make test-r6rs'
}
}
}
stage("guile r7rs") {
agent { dockerfile { filename 'Dockerfile'; args '--user=root'; additionalBuildArgs '--build-arg COMPILE_R7RS=guile' } }
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh 'make && make install'
sh 'make test-r7rs'
}
}
}
stage("ikarus r6rs") {
agent { dockerfile { filename 'Dockerfile'; args '--user=root'; additionalBuildArgs '--build-arg COMPILE_R7RS=ikarus' } }
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh 'make && make install'
sh 'make test-r6rs'
}
}
}
stage("ironscheme r6rs") {
agent { dockerfile { filename 'Dockerfile'; args '--user=root'; additionalBuildArgs '--build-arg COMPILE_R7RS=ironscheme' } }
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh 'make && make install'
sh 'make test-r6rs'
}
}
}
stage("kawa r7rs") {
agent { dockerfile { filename 'Dockerfile'; args '--user=root'; additionalBuildArgs '--build-arg COMPILE_R7RS=kawa' } }
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh 'make && make install'
sh 'make test-r7rs'
}
}
}
stage("larceny r6rs") {
agent { dockerfile { filename 'Dockerfile'; args '--user=root'; additionalBuildArgs '--build-arg COMPILE_R7RS=larceny' } }
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh 'make && make install'
sh 'make test-r6rs'
}
}
}
stage("larceny r7rs") {
agent { dockerfile { filename 'Dockerfile'; args '--user=root'; additionalBuildArgs '--build-arg COMPILE_R7RS=larceny' } }
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh 'make && make install'
sh 'make test-r7rs'
}
}
}
stage("loko r6rs") {
agent { dockerfile { filename 'Dockerfile'; args '--user=root'; additionalBuildArgs '--build-arg COMPILE_R7RS=loko' } }
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh 'make && make install'
sh 'make test-r6rs'
}
}
}
stage("loko r7rs") {
agent { dockerfile { filename 'Dockerfile'; args '--user=root'; additionalBuildArgs '--build-arg COMPILE_R7RS=loko' } }
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh 'make && make install'
sh 'make test-r7rs'
}
}
}
stage("mit-scheme r7rs") {
agent { dockerfile { filename 'Dockerfile'; args '--user=root'; additionalBuildArgs '--build-arg COMPILE_R7RS=mit-scheme' } }
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh 'make && make install'
sh 'make test-r7rs'
}
}
}
stage("mosh r6rs") {
agent { dockerfile { filename 'Dockerfile'; args '--user=root'; additionalBuildArgs '--build-arg COMPILE_R7RS=mosh' } }
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh 'make && make install'
sh 'make test-r6rs'
}
}
}
stage("mosh r7rs") {
agent { dockerfile { filename 'Dockerfile'; args '--user=root'; additionalBuildArgs '--build-arg COMPILE_R7RS=mosh' } }
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh 'make && make install'
sh 'make test-r7rs'
}
}
}
stage("sagittarius r6rs") {
agent { dockerfile { filename 'Dockerfile'; args '--user=root'; additionalBuildArgs '--build-arg COMPILE_R7RS=sagittarius' } }
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh 'apt-get update && apt-get install -y make libuv1'
sh 'make && make install'
sh 'make test-r6rs'
}
}
}
stage("sagittarius r7rs") {
agent { dockerfile { filename 'Dockerfile'; args '--user=root'; additionalBuildArgs '--build-arg COMPILE_R7RS=sagittarius' } }
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh 'make && make install'
sh 'make test-r7rs'
}
}
}
stage("skint r7rs") {
agent { dockerfile { filename 'Dockerfile'; args '--user=root'; additionalBuildArgs '--build-arg COMPILE_R7RS=skint' } }
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh 'make && make install'
sh 'make test-r7rs'
}
}
}
stage("tr7 r7rs") {
agent { dockerfile { filename 'Dockerfile'; args '--user=root'; additionalBuildArgs '--build-arg COMPILE_R7RS=tr7' } }
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh 'make && make install'
sh 'make test-r7rs'
}
}
}
stage("ypsilon r6rs") {
agent { dockerfile { filename 'Dockerfile'; args '--user=root'; additionalBuildArgs '--build-arg COMPILE_R7RS=ypsilon' } }
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh 'make && make install'
sh 'make test-r6rs'
}
}
}
stage("ypsilon r7rs") {
agent { dockerfile { filename 'Dockerfile'; args '--user=root'; additionalBuildArgs '--build-arg COMPILE_R7RS=ypsilon' } }
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh 'make && make install'
sh 'make test-r7rs'
stages {
stage('Test R6RS implementations') {
steps {
script {
r6rs_implementations.each { implementation->
stage("${implementation} ${test}") {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh "make test-r6rs COMPILE_R7RS=${implementation}"
}
}
}
}
}
}
}

View File

@ -3,6 +3,20 @@ PREFIX=/usr/local
build:
printf "#!/bin/sh\nsash --disable-cache -r7 -L ${PREFIX}/lib/compile-r7rs/snow ${PREFIX}/lib/compile-r7rs/main.scm \"\$$@\"\n" > compile-r7rs
build-docker-images:
for implementation in $(shell sash -L ./snow -L . compile-r7rs.scm --list-schemes); \
do \
docker build . --build-arg COMPILE_R7RS=$${implementation} --tag=retropikzel1/compile-r7rs:$${implementation}; \
done
#for implementation in $(shell sash -L ./snow -L . compile-r7rs.scm --list-schemes);
push-docker-images:
for implementation in chibi chicken sagittarius; \
do \
docker push compile-r7rs:$${implementation}; \
done
snow:
mkdir -p snow
cp -r ../foreign-c/foreign snow/

View File

@ -232,7 +232,15 @@ The environment variable COMPILE\_R7RS must be set to the **name** of the
implementation as specified in the support list.
**This differs from the SRFI** as the SRFI excepts a path.
To get the list of supported implementations run:
To get the list of supported R6RS implementations run:
compile-r7rs --list-r6rs-schemes
To get the list of supported R7RS implementations run:
compile-r7rs --list-r7rs-schemes
To get the list of all supported implementations run:
compile-r7rs --list-schemes
@ -314,6 +322,10 @@ tried to compile them in wrong order you would run:
## Usage with Docker
<a name="#usage-with-docker"></a>
You can compile the docker images with:
make build-docker-images
Here is a sample Dockerfile to get you started.
ARG COMPILE_R7RS=chibi

View File

@ -9,39 +9,59 @@
(libs library-util)
(srfi 170))
(define r6rs-schemes '(chezscheme
guile
ikarus
ironscheme
larceny
loko
mosh
racket
sagittarius
ypsilon))
(define r7rs-schemes '(chibi
chicken
cyclone
gambit
foment
gauche
guile
kawa
larceny
loko
mit-scheme
mosh
racket
sagittarius
skint
stklos
tr7
ypsilon))
(define all-schemes (append r6rs-schemes r7rs-schemes))
(when (member "--list-r6rs-schemes" (command-line))
(for-each
(lambda (scheme)
(display scheme)
(newline))
r6rs-schemes)
(exit 0))
(when (member "--list-r7rs-schemes" (command-line))
(for-each
(lambda (scheme)
(display scheme)
(newline))
r7rs-schemes)
(exit 0))
(when (member "--list-schemes" (command-line))
(for-each
(lambda (scheme)
(display scheme)
(newline))
'(chezscheme
chibi
chicken
cyclone
gambit
foment
gauche
;gerbil
guile
;husk
ikarus
ironscheme
kawa
larceny
loko
;meevax
mit-scheme
mosh
racket
;picrin
;scheme-rs
;stak
sagittarius
skint
stklos
tr7
;vicare
ypsilon))
all-schemes)
(exit 0))
(define scheme (if (get-environment-variable "COMPILE_R7RS")

Binary file not shown.

View File

@ -3,7 +3,7 @@
(import (scheme base)
(scheme file)
(scheme process-context)
(retropikzel pffi))
(foreign c))
(export string-replace
string-ends-with?
string-starts-with?

View File

@ -4,7 +4,8 @@
(import (scheme base)
(scheme write)
(scheme file)
(retropikzel r7rs-pffi))
(foreign c)
(scheme process-context))
(export ;posix-error?
;posix-error-name
;posix-error-message
@ -35,7 +36,7 @@
file-info:atime
file-info:mtime
file-info:ctime
file-info-directory?
;file-info-directory?
;file-info-fifo?
;file-info-symlink?
;file-info-regular?
@ -47,7 +48,7 @@
;open-directory
;read-directory
;close-directory
;real-path
real-path
;file-space
;temp-file-prefix
;create-temp-file
@ -82,4 +83,4 @@
;delete-environment-variable!
;terminal?
)
(include "170.scm"))
(include "170.scm"))