From 93c0f4e5271f798fa9df34358b898c35846b6263 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Mon, 6 Apr 2020 09:25:09 -0700 Subject: [PATCH] Revert "use fasl & post-installer" This reverts commit b5599de0e0847753865bc4481e7f62c99e31c090. --- hyphenate/hyphenate/info.rkt | 1 - hyphenate/hyphenate/post-installer.rkt | 8 ------- hyphenate/hyphenate/private/bootstrap.rkt | 26 ++++++++++------------- 3 files changed, 11 insertions(+), 24 deletions(-) delete mode 100644 hyphenate/hyphenate/post-installer.rkt diff --git a/hyphenate/hyphenate/info.rkt b/hyphenate/hyphenate/info.rkt index f67642ca..36b9b109 100644 --- a/hyphenate/hyphenate/info.rkt +++ b/hyphenate/hyphenate/info.rkt @@ -1,4 +1,3 @@ #lang info (define scribblings '(("scribblings/hyphenate.scrbl" ()))) (define compile-omit-paths '("tests.rkt")) -(define post-install-collection "post-installer.rkt") \ No newline at end of file diff --git a/hyphenate/hyphenate/post-installer.rkt b/hyphenate/hyphenate/post-installer.rkt deleted file mode 100644 index 90fafc35..00000000 --- a/hyphenate/hyphenate/post-installer.rkt +++ /dev/null @@ -1,8 +0,0 @@ -#lang racket/base -(provide (all-defined-out)) - -(define (post-installer home-dir) - (for ([mod '(hyphenate/us hyphenate/fr)]) - (displayln (format "running post-installer in ~a" mod)) - (define proc (dynamic-require mod 'post-installer)) - (proc home-dir))) \ No newline at end of file diff --git a/hyphenate/hyphenate/private/bootstrap.rkt b/hyphenate/hyphenate/private/bootstrap.rkt index 7ac68e61..0e658f27 100644 --- a/hyphenate/hyphenate/private/bootstrap.rkt +++ b/hyphenate/hyphenate/private/bootstrap.rkt @@ -4,7 +4,6 @@ sugar/define racket/contract racket/file - racket/fasl (only-in xml xexpr/c) (prefix-in core: hyphenate/private/core)) @@ -52,8 +51,8 @@ (unless (and (file-exists? cache-path) (> (file-or-directory-modify-seconds cache-path) (file-or-directory-modify-seconds module-path))) - (s-exp->fasl (dynamic-require module-path id-sym) (open-output-file cache-path #:exists 'replace))) - (fasl->s-exp (open-input-file cache-path))) + (write-to-file (dynamic-require module-path id-sym) cache-path #:exists 'replace)) + (file->value cache-path)) (define-syntax (mb stx) (syntax-case stx () @@ -68,15 +67,12 @@ [PATTERNS-ID 'patterns] [EXCEPTIONS-ID 'exceptions]) #'(#%module-begin - (define PATTERNS-ID (load-from-cache-if-possible PATTERNS-PATH PATTERN-CACHE-PATH 'PATTERNS-ID)) - ;; a file-cached hash is immutable, so convert it - (define EXCEPTIONS-ID (make-hash (hash->list (load-from-cache-if-possible EXCEPTIONS-PATH EXCEPTIONS-CACHE-PATH 'EXCEPTIONS-ID)))) - (define+provide (post-installer home-dir) - (load-from-cache-if-possible PATTERNS-PATH PATTERN-CACHE-PATH 'PATTERNS-ID) - (load-from-cache-if-possible EXCEPTIONS-PATH EXCEPTIONS-CACHE-PATH 'EXCEPTIONS-ID)) - (define+provide+safe hyphenate - hyphenate/c - (make-hyphenate-function PATTERNS-ID EXCEPTIONS-ID)) - (define+provide+safe unhyphenate - unhyphenate/c - (make-unhyphenate-function)))))])) \ No newline at end of file + (define PATTERNS-ID (load-from-cache-if-possible PATTERNS-PATH PATTERN-CACHE-PATH 'PATTERNS-ID)) + ;; a file-cached hash is immutable, so convert it + (define EXCEPTIONS-ID (make-hash (hash->list (load-from-cache-if-possible EXCEPTIONS-PATH EXCEPTIONS-CACHE-PATH 'EXCEPTIONS-ID)))) + (define+provide+safe hyphenate + hyphenate/c + (make-hyphenate-function PATTERNS-ID EXCEPTIONS-ID)) + (define+provide+safe unhyphenate + unhyphenate/c + (make-unhyphenate-function)))))])) \ No newline at end of file