From 1e9941edee3cd66dafff22ae4f1b11f35eef5343 Mon Sep 17 00:00:00 2001 From: Virgil Hou Date: Sun, 1 May 2016 10:49:35 +0800 Subject: [PATCH 1/2] - fixed incorrect handling of library-extension when searching wpo files compile.ss original commit: 4c0726f7174ca2cdb6d1c5862da88fad6d10c840 --- LOG | 3 +++ mats/7.ms | 30 ++++++++++++++++++++++++++++++ s/compile.ss | 2 +- 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/LOG b/LOG index b6989a271e..3157428f3d 100644 --- a/LOG +++ b/LOG @@ -59,3 +59,6 @@ object to a time-utc object. stats.c, date.ms +- fixed incorrect handling of library-extension when searching wpo files + compile.ss + 7.ms diff --git a/mats/7.ms b/mats/7.ms index af14b759ce..ca6d8d4903 100644 --- a/mats/7.ms +++ b/mats/7.ms @@ -1918,6 +1918,36 @@ evaluating module init (equal? (separate-eval '(load "testfile-wpo-ab7-all.so")) "invoking a\ninvoking c\ninvoking b\n#t\n#t\n#t\n") + + (begin + (with-output-to-file "testfile-wpo-extlib.chezscheme.sls" + (lambda () + (pretty-print + '(library (testfile-wpo-extlib) + (export magic) + (import (rnrs)) + (define magic 9)))) + 'replace) + (with-output-to-file "testfile-wpo-ext.ss" + (lambda () + (pretty-print '(import (chezscheme) (testfile-wpo-extlib))) + (pretty-print '(pretty-print magic))) + 'replace) + (separate-compile + '(lambda (x) + (parameterize ([compile-imported-libraries #t] + [generate-wpo-files #t]) + (compile-program x))) + 'wpo-ext) + #t) + + (equal? + (separate-compile + '(lambda (x) + (parameterize ([generate-wpo-files #t]) + (compile-whole-program (format "~a.wpo" x) (format "~a-all.so" x)))) + 'wpo-ext) + "()\n") ) (mat compile-whole-library diff --git a/s/compile.ss b/s/compile.ss index a14ddb0f10..7a55d5be81 100644 --- a/s/compile.ss +++ b/s/compile.ss @@ -792,7 +792,7 @@ (define read-library (lambda (path libs-visible?) (cond - [(find-library who path "wpo" (map (lambda (ext) (cons (car ext) ".wpo")) (library-extensions))) => + [(find-library who path "wpo" (map (lambda (ext) (cons (car ext) (string-append (path-root (cdr ext)) ".wpo"))) (library-extensions))) => (lambda (fn) (let-values ([(no-program node*) (process-ir*! (read-input-file who fn) fn #f libs-visible?)]) (values fn node*)))] From ba1c8113f41eb8e0bce0ed5b3b2c5aecca6ca97d Mon Sep 17 00:00:00 2001 From: Andy Keep Date: Sun, 1 May 2016 19:21:46 +0000 Subject: [PATCH 2/2] Slightly extended @hyln9 tests in 7.ms, rebuilt the boot files and added a comma to the log. 7.ms, boot/*/{petite,scheme}.boot, LOG original commit: 8343b7172532a00d2d19914206fcf83c93798c80 --- LOG | 2 +- mats/7.ms | 45 ++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/LOG b/LOG index 3157428f3d..abfc07d4ef 100644 --- a/LOG +++ b/LOG @@ -60,5 +60,5 @@ stats.c, date.ms - fixed incorrect handling of library-extension when searching wpo files - compile.ss + compile.ss, 7.ms diff --git a/mats/7.ms b/mats/7.ms index ca6d8d4903..4617c2e411 100644 --- a/mats/7.ms +++ b/mats/7.ms @@ -1926,7 +1926,7 @@ evaluating module init '(library (testfile-wpo-extlib) (export magic) (import (rnrs)) - (define magic 9)))) + (define magic (cons 9 5))))) 'replace) (with-output-to-file "testfile-wpo-ext.ss" (lambda () @@ -1948,6 +1948,10 @@ evaluating module init (compile-whole-program (format "~a.wpo" x) (format "~a-all.so" x)))) 'wpo-ext) "()\n") + + (equal? + (separate-eval '(load "testfile-wpo-ext-all.so")) + "(9 . 5)\n") ) (mat compile-whole-library @@ -3041,6 +3045,45 @@ evaluating module init (equal? (separate-eval '(load-program "testfile-cwl-c13.so")) "(51 85 119)\n") + + (begin + (with-output-to-file "testfile-wpo-extlib-1.chezscheme.sls" + (lambda () + (pretty-print + '(library (testfile-wpo-extlib-1) + (export magic) + (import (rnrs)) + (define magic (cons 9 5))))) + 'replace) + (with-output-to-file "testfile-wpo-extlib-2.ss" + (lambda () + (pretty-print + '(library (testfile-wpo-extlib-2) + (export p) + (import (chezscheme) (testfile-wpo-extlib)) + (define p + (lambda () + (pretty-print magic)))))) + 'replace) + (separate-compile + '(lambda (x) + (parameterize ([compile-imported-libraries #t] + [generate-wpo-files #t]) + (compile-library x))) + 'wpo-extlib-2) + #t) + + (equal? + (separate-compile + '(lambda (x) + (parameterize ([generate-wpo-files #t]) + (compile-whole-library (format "~a.wpo" x) (format "~a-all.so" x)))) + 'wpo-extlib-2) + "()\n") + + (equal? + (separate-eval '(let () (import (testfile-wpo-extlib-2)) (p))) + "(9 . 5)\n") )