Commit c71f2b04 authored by Zach Beane's avatar Zach Beane
Browse files

Merge branch 'master' into 'master'

Updated to track latest AllegroServe. Bumped purported ACL version to 10.1

See merge request !1
parents 1ed48f83 f00506bc
# Output
*.fasl
*.dx64fsl
*.wx64fsl
*.lx64fsl
...@@ -3,8 +3,11 @@ ...@@ -3,8 +3,11 @@
ZACL is for running ZACL is for running
[AllegroServe](https://github.com/franzinc/allegroserve/) on [AllegroServe](https://github.com/franzinc/allegroserve/) on
non-AllegroCL Lisps. The goal is to run AllegroServe sources with as non-AllegroCL Lisps. The goal is to run AllegroServe sources with as
few modifications as possible. That means *occasionally* resorting to few modifications as possible, so that such a modified version of
grody one-off hacks instead of elegant beautiful gracefulness. aserve will continue to be able to track future versions of [official
aserve](https://github.com/franzinc/allegroserve/). That means
*occasionally* resorting to grody one-off hacks instead of elegant
beautiful gracefulness.
Where possible, ACL functionality is mimicked with portability Where possible, ACL functionality is mimicked with portability
libraries like [UIOP](http://quickdocs.org/UIOP/), libraries like [UIOP](http://quickdocs.org/UIOP/),
...@@ -19,55 +22,75 @@ without changing the code, zacl installs a readtable that overrides ...@@ -19,55 +22,75 @@ without changing the code, zacl installs a readtable that overrides
the standard `#+` and `#-` readers to check for these expressions and the standard `#+` and `#-` readers to check for these expressions and
work around them. work around them.
Occasionally, a quirk in aserve's source is very difficult to work Occasionally, quirks in aserve's source may be very difficult to work
around. In those cases, I will send patches to Franz, like for around. In those cases, a patch or pull request can be [sent to Franz]
[double-colon syntax in packages.cl](https://github.com/franzinc/aserve/pull/6), (https://github.com/franzinc/aserve/). Ideally, the [official
[obsolete declarations not recognized in other Lisps](https://github.com/franzinc/aserve/pull/7), aserve](https://github.com/franzinc/aserve/) will eventualy get to
[non-standard assumptions in array initialization](https://github.com/franzinc/aserve/pull/8), where it will work with ZACL unmodified.
etc.
Until those patches are merged or rejected, the But as long as there are discrepancies between what works with zacl
[zacl-compatible aserve fork](https://github.com/xach/aserve/tree/zacl-compatible) and the [official Franz version of
on github has a lightly modified version of aserve that can be used aserve](https://github.com/franzinc/aserve/) (as is the case
with zacl to use modern aserve on non-Allegro Lisps. You can check it currently), a zacl-compatible fork will be available
out like so: [here](https://github.com/genworks/aserve/tree/zacl-compatible). You
can check it out like so:
git clone -b zacl-compatible https://github.com/xach/aserve.git git clone -b master https://github.com/genworks/aserve.git
## Usage ## Usage
ZACL defines the packages and functionality that the aserve code The `aserve` system definition name conflicts in Quicklisp with a
relies upon. But aserve's system definition does not include a legacy [attempt to port
dependency on ZACL. There are a few ways to make sure ZACL is loaded AllegroServe](https://sourceforge.net/p/portableaserve/git/ci/master/tree/)
before aserve.
First, you can manually load ZACL before loading aserve: Therefore, the [zacl-compatible
AllegroServe](https://github.com/genworks/aserve/tree/zacl-compatible)
has its system name as `zaserve`. This `zaserve` system definition
includes a dependency on ZACL, so you can load it simply by invoking
(ql:quickload "zacl") (ql:quickload :zaserve)
(ql:quickload "aserve")
Second, you can load the "zacl-aserve" shim system: Of course, if for some reason you only want the `zacl` system itself,
you can load that with
(ql:quickload :zacl)
(ql:quickload "zacl-aserve")
## Limitations ## Limitations
**Only works on Clozure CL and SBCL**. Support for other **Only works on Clozure CL and SBCL**. Support for other
implementations will be added if there is sufficient demand. I don't implementations may be added if there is sufficient
use other CL implementations with ZACL currently. demand. Contributions of ports to other implementations are of course
welcome
**Does not support CGI**. A victim of time constraints. I do not need **Does not support CGI**. A victim of time constraints. The author and
CGI. CGI functionality requires non-trivial support for managing maintainers do not currently need CGI. CGI functionality requires
subprocesses, and I am not sure if e.g. UIOP's subprocess management non-trivial support for managing subprocesses, and I am not sure if
API is sufficient. e.g. UIOP's subprocess management API is sufficient.
**Lightly tested**. My application seems to work. Yours might not. If **Lightly tested**. Our applications seem to work. Yours might not. If
you have trouble with ZACL and aserve, feel free to you have trouble with ZACL and zaserve, feel free to create an
[create an issue](https://gitlab.common-lisp.net/zbeane/zacl/issues) issue[here](https://gitlab.common-lisp.net/zbeane/zacl/issues) and/or
and I'll take a look. [here](https://github.com/genworks/aserve/tree/zacl-compatible) and
the maintainers will see them.
**Possibly slow**. Using generic functions and portability layers will **Possibly slow**. Using generic functions and portability layers will
be slower than running aserve natively on Allegro CL. There aren't be slower than running aserve natively on Allegro CL. There aren't
many ways around it. If you have a specific performance issue that many ways around it. If you do have a specific performance issue when
you'd like ZACL to address, [get in touch](mailto:xach@xach.com). running with ZACL that you would like to see ZACL try to address, then
please [open an
Issue](https://gitlab.common-lisp.net/zbeane/zacl/issues) or [get in
touch](mailto:xach@xach.com).
With that said, AllegroServe will always run best on its native
platform, which is [Allegro
CL](https://franz.com/products/allegro-common-lisp/). So if you want
to run AllegroServe for mission-critical or performance-critical
applications, and with a guarantee of a supported, trouble-free
experience, then you may want to consider investing [Allegro
CL](https://franz.com/products/allegro-common-lisp/) for your
AllegroServe needs. This option also comes with the benefit of
dedicated, world-class [support from Franz
Inc. engineers](https://franz.com).
...@@ -2,10 +2,11 @@ ...@@ -2,10 +2,11 @@
(in-package #:zacl) (in-package #:zacl)
;; This mimics what aserve.asd does. (defclass zacl-reader:cl-file (asdf:cl-source-file)
(defclass asdf::cl-file (asdf:cl-source-file)
((type :initform "cl"))) ((type :initform "cl")))
(defmethod asdf:perform :around ((operation asdf:compile-op) (defmethod asdf:perform :around ((operation asdf:compile-op)
(component asdf::cl-file)) (component zacl-reader:cl-file))
(with-zacl-build-environment (call-next-method))) (with-zacl-build-environment (call-next-method)))
...@@ -192,12 +192,6 @@ values otherwise." ...@@ -192,12 +192,6 @@ values otherwise."
(defun excl:fixnump (integer) (defun excl:fixnump (integer)
(typep integer 'fixnum)) (typep integer 'fixnum))
(defun excl:split-into-words (string)
(split "\\s+" string))
(defun excl:split-on-character (string character)
(split-sequence character string))
(defmacro excl::with-dynamic-extent-usb8-array ((var len) &body body) (defmacro excl::with-dynamic-extent-usb8-array ((var len) &body body)
`(let ((,var (make-array ,len :element-type '(unsigned-byte 8)))) `(let ((,var (make-array ,len :element-type '(unsigned-byte 8))))
,@body)) ,@body))
...@@ -543,3 +537,20 @@ values otherwise." ...@@ -543,3 +537,20 @@ values otherwise."
(defun excl:fasl-read (file) (defun excl:fasl-read (file)
(with-open-file (stream file :element-type '(unsigned-byte 8)) (with-open-file (stream file :element-type '(unsigned-byte 8))
(restore stream))) (restore stream)))
;;; BASE64
(defun excl:base64-string-to-string (string)
(cl-base64:base64-string-to-string string))
(defun excl:string-to-base64-string (str)
(cl-base64:string-to-base64-string str :columns 52))
;;; Microtime
(defconstant excl::base-for-internal-real-time -455615030)
(defun excl::acl-internal-real-time ()
(values (- (get-universal-time) 4165516800)
(/ (local-time:nsec-of (local-time:now)) 1000)))
...@@ -203,10 +203,17 @@ ...@@ -203,10 +203,17 @@
`(progn ,@body)) `(progn ,@body))
(defun socket:ipaddr-to-hostname (ipaddr) (defun socket:ipaddr-to-hostname (ipaddr)
(ipaddr-to-hostname ipaddr)) #+sbcl(declare (ignore ipaddr))
#+ccl (ipaddr-to-hostname ipaddr)
#+sbcl (error "socket:ipaddr-to-hostname not implemented in ~a" (lisp-implementation-type)))
(defun socket:lookup-hostname (name) (defun socket:lookup-hostname (name)
(lookup-hostname name)) #+ccl (lookup-hostname name)
;;
;; FLAG -- this assumes IPv4 - fix to work with IPv6 also.
;;
#+sbcl (format nil "~{~a~^.~}" (coerce (get-host-by-name name) 'list)))
(defun socket::make-ssl-client-stream (socket &key &allow-other-keys) (defun socket::make-ssl-client-stream (socket &key &allow-other-keys)
(let ((stream (make-ssl-client-stream (real-stream socket)))) (let ((stream (make-ssl-client-stream (real-stream socket))))
......
...@@ -3,3 +3,8 @@ ...@@ -3,3 +3,8 @@
(in-package #:zacl) (in-package #:zacl)
(defclass util.zip:inflate-stream () ()) (defclass util.zip:inflate-stream () ())
(defclass util.zip:deflate-stream () ())
(defun util.zip:deflate-target-stream (stream)
(error "util.zip:deflate-target-stream is not yet implemented.~%"))
...@@ -11,6 +11,10 @@ ...@@ -11,6 +11,10 @@
;; XXX Private package ;; XXX Private package
#:without-interrupts #:without-interrupts
#:fd-stream-fd) #:fd-stream-fd)
#+sbcl
(:import-from #:usocket
#:get-host-by-name)
(:import-from #:cl+ssl (:import-from #:cl+ssl
#:make-ssl-client-stream #:make-ssl-client-stream
#:make-ssl-server-stream) #:make-ssl-server-stream)
...@@ -124,7 +128,7 @@ ...@@ -124,7 +128,7 @@
(defpackage #:zacl-reader (defpackage #:zacl-reader
(:use #:cl) (:use #:cl)
(:export #:*allegro-rewriting-readtable*)) (:export #:*allegro-rewriting-readtable* #:cl-file))
(defpackage #:zacl-if-star (defpackage #:zacl-if-star
(:use #:cl) (:use #:cl)
...@@ -231,7 +235,10 @@ ...@@ -231,7 +235,10 @@
#:stream-error-identifier #:stream-error-identifier
#:stream-error-code) #:stream-error-code)
(:export #:sm (:export #:sm
#:errorset)) #:errorset)
(:export #:string-to-base64-string
#:base64-string-to-string))
(defpackage #:ff (defpackage #:ff
(:use) (:use)
...@@ -274,7 +281,39 @@ ...@@ -274,7 +281,39 @@
(defpackage #:util.zip (defpackage #:util.zip
(:use) (:use)
(:export #:inflate-stream)) (:export #:inflate-stream #:deflate-stream #:deflate-target-stream))
(eval-when (:compile-toplevel :load-toplevel :execute)
(let ((net.uri (find-package :net.uri))
(net.aserve (find-package :net.aserve)))
(if (and net.uri (not (and net.aserve (member net.uri (package-use-list net.aserve)))))
(let ((puri? (and (find-package :puri)
(string-equal (first (package-nicknames :puri)) "net.uri"))))
(if puri?
(progn
(warn "
Existing \"net.uri\" package was detected as a nickname of the \"puri\" package.
Removing the \"net.uri\" nickname from \"puri\" because ZACL needs to
define this package name.
")
(rename-package :puri :puri nil))
(progn
(warn "
-Existing \"net.uri\" package was detected.
Deleting the \"net.uri\" package, because ZACL needs to define this
package name.
")
(delete-package :net.uri)))))))
(defpackage #:net.uri (defpackage #:net.uri
(:use) (:use)
...@@ -350,3 +389,5 @@ ...@@ -350,3 +389,5 @@
(defpackage #:util.string (defpackage #:util.string
(:use) (:use)
(:export #:string+)) (:export #:string+))
(defpackage #:acl-socket (:use))
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
(defparameter *allegro-feature-symbols* (defparameter *allegro-feature-symbols*
'("VERSION>=" "VERSION=")) '("VERSION>=" "VERSION="))
(defparameter *allegro-version-feature* :zacl-allegro-10-0) (defparameter *allegro-version-feature* :zacl-allegro-10-1)
(defparameter *allegro-latest-feature* :zacl-latest-allegro) (defparameter *allegro-latest-feature* :zacl-latest-allegro)
(defun allegro-conditional-p (expression) (defun allegro-conditional-p (expression)
......
...@@ -19,7 +19,9 @@ ...@@ -19,7 +19,9 @@
#:cl-store #:cl-store
#:alexandria #:alexandria
#:md5 #:md5
#:cl+ssl) #:cl+ssl
#:local-time
#:cl-base64)
:serial t :serial t
:components ((:file "package") :components ((:file "package")
#+clozure #+clozure
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment