Skip to content

Commit ca0ff84

Browse files
authored
ASDF improvements for bytecode (#1456)
2 parents b83cb75 + eade5f5 commit ca0ff84

File tree

8 files changed

+46
-3
lines changed

8 files changed

+46
-3
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ jobs:
7777
if: ${{ matrix.build == 'clasp' }}
7878
run: |
7979
ninja -C build ansi-test
80+
- name: Run ASDF tests
81+
if: ${{ matrix.build == 'clasp' }}
82+
run: |
83+
ninja -C build asdf-test
8084
- name: Run Cando regression tests
8185
if: ${{ matrix.build == 'cando' }}
8286
run: |

repos.sexp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@
198198
(:name :asdf
199199
:repository "https://gitlab.common-lisp.net/yitzchak/asdf.git"
200200
:directory "src/lisp/modules/asdf/"
201-
:branch "clasp-bytecode")
201+
:branch "clasp-bytecode-2")
202202
(:name :mps
203203
:repository "https://github.com/Ravenbrook/mps.git"
204204
:directory "src/mps/"

src/core/lisp.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,9 @@ void Lisp::startupLispEnvironment() {
666666
#endif
667667
#ifdef CLASP_EXTENSIONS
668668
features = Cons_O::create(_lisp->internKeyword("EXTENSIONS"),features);
669+
#endif
670+
#if CLASP_BUILD_MODE == 6
671+
features = Cons_O::create(_lisp->internKeyword("BYTECODE"), features);
669672
#endif
670673
cl::_sym_STARfeaturesSTAR->setf_symbolValue(features);
671674

src/koga/configure.lisp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,8 @@ is not compatible with snapshots.")
649649
(list (make-source #P"jupyter-kernel.lisp" :variant))
650650
:ansi-test
651651
(list (make-source #P"ansi-test.lisp" :build))
652+
:asdf-test
653+
(list (make-source #P"asdf-test.bash" :build))
652654
:bench
653655
(list (make-source #P"bench.lisp" :build))
654656
:ninja

src/koga/ninja.lisp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,10 @@
152152
:command "$clasp --norc --base --feature ignore-extensions --load ansi-test.lisp"
153153
:description "Running ANSI tests"
154154
:pool "console")
155+
(ninja:write-rule output-stream :asdf-test
156+
:command "bash asdf-test.bash $clasp $target"
157+
:description "Running ASDF tests"
158+
:pool "console")
155159
(ninja:write-rule output-stream :test-random-integer
156160
:command "$clasp --norc --base --feature ignore-extensions --load \"../dependencies/ansi-test/run-random-type-tests.lisp\""
157161
:description "Running pfdietz test-random-integer-forms"
@@ -754,6 +758,16 @@
754758
:clasp (make-source "iclasp" :variant)
755759
:inputs (list (build-name "cclasp"))
756760
:outputs (list (build-name "ansi-test")))
761+
(ninja:write-build output-stream :asdf-test
762+
:clasp (make-source "iclasp" :variant)
763+
:target "t"
764+
:inputs (list (build-name "cclasp"))
765+
:outputs (list (build-name "asdf-test")))
766+
(ninja:write-build output-stream :asdf-test
767+
:clasp (make-source "iclasp" :variant)
768+
:target "u"
769+
:inputs (list (build-name "cclasp"))
770+
:outputs (list (build-name "asdf-test-upgrade")))
757771
(ninja:write-build output-stream :test-random-integer
758772
:clasp (make-source "iclasp" :variant)
759773
:inputs (list (build-name "cclasp"))
@@ -776,6 +790,12 @@
776790
(ninja:write-build output-stream :phony
777791
:inputs (list (build-name "ansi-test-subset"))
778792
:outputs (list "ansi-test-subset"))
793+
(ninja:write-build output-stream :phony
794+
:inputs (list (build-name "asdf-test"))
795+
:outputs (list "asdf-test"))
796+
(ninja:write-build output-stream :phony
797+
:inputs (list (build-name "asdf-test-upgrade"))
798+
:outputs (list "asdf-test-upgrade"))
779799
(ninja:write-build output-stream :phony
780800
:inputs (list (build-name "test-random-integer"))
781801
:outputs (list "test-random-integer"))

src/koga/scripts.lisp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,3 +297,17 @@ exec $(dirname \"$0\")/iclasp -f ignore-extensions --base \"$@\""))
297297
(t
298298
(load #P\"../dependencies/ansi-test/init.lsp\"))))
299299
(rt:do-tests :exit t :expected-failures \"../tools-for-build/ansi-test-expected-failures.sexp\")"))
300+
301+
(defmethod print-prologue (configuration (name (eql :asdf-test)) output-stream)
302+
(format output-stream "~
303+
CLASP=$(pwd)/$1
304+
WORK_DIR=`mktemp -d`
305+
306+
if [[ ! \"$WORK_DIR\" || ! -d \"$WORK_DIR\" ]]; then
307+
echo \"Could not create temp dir\"
308+
exit 1
309+
fi
310+
311+
cp -r ../src/lisp/modules/asdf \"$WORK_DIR\"
312+
cd \"$WORK_DIR\"/asdf
313+
make $2 l=clasp CLASP=$CLASP"))

src/lisp/kernel/cmp/compile-file-parallel.lisp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ Compile a lisp source file into an LLVM module."
409409
;; Don't enforce .bc extension for additional-bitcode-pathnames
410410
;; This is where I used to link the additional-bitcode-pathnames
411411
(loop for part-llvm-ir in parts
412-
for module = (llvm-sys:parse-irstring part-llvm-ir (thread-local-llvm-context))
412+
for module = (llvm-sys:parse-irstring part-llvm-ir (thread-local-llvm-context) "")
413413
do (multiple-value-bind (failure error-msg)
414414
(llvm-sys:link-modules link-module module)
415415
(when failure

src/lisp/kernel/lsp/loadltv.lisp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ Tried to define constant #~d, but it was already defined"
602602

603603
(defmethod %load-instruction ((mnemonic (eql 'init-object-array)) stream)
604604
(check-initialization *initflags*)
605-
(let ((nobjs (read-ub64)))
605+
(let ((nobjs (read-ub64 stream)))
606606
(dbgprint " (init-object-array ~d)" nobjs)
607607
(setf *index-bytes* (max 1 (ash 1 (1- (ceiling (integer-length nobjs) 8))))
608608
*constants* (make-array nobjs)

0 commit comments

Comments
 (0)