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 @@
ZACL is for running
[AllegroServe](https://github.com/franzinc/allegroserve/) on
non-AllegroCL Lisps. The goal is to run AllegroServe sources with as
few modifications as possible. That means *occasionally* resorting to
grody one-off hacks instead of elegant beautiful gracefulness.
few modifications as possible, so that such a modified version of
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
libraries like [UIOP](http://quickdocs.org/UIOP/),
......@@ -19,55 +22,75 @@ without changing the code, zacl installs a readtable that overrides
the standard `#+` and `#-` readers to check for these expressions and
work around them.
Occasionally, a quirk in aserve's source is very difficult to work
around. In those cases, I will send patches to Franz, like for
[double-colon syntax in packages.cl](https://github.com/franzinc/aserve/pull/6),
[obsolete declarations not recognized in other Lisps](https://github.com/franzinc/aserve/pull/7),
[non-standard assumptions in array initialization](https://github.com/franzinc/aserve/pull/8),
etc.
Occasionally, quirks in aserve's source may be very difficult to work
around. In those cases, a patch or pull request can be [sent to Franz]
(https://github.com/franzinc/aserve/). Ideally, the [official
aserve](https://github.com/franzinc/aserve/) will eventualy get to
where it will work with ZACL unmodified.
Until those patches are merged or rejected, the
[zacl-compatible aserve fork](https://github.com/xach/aserve/tree/zacl-compatible)
on github has a lightly modified version of aserve that can be used
with zacl to use modern aserve on non-Allegro Lisps. You can check it
out like so:
But as long as there are discrepancies between what works with zacl
and the [official Franz version of
aserve](https://github.com/franzinc/aserve/) (as is the case
currently), a zacl-compatible fork will be available
[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
ZACL defines the packages and functionality that the aserve code
relies upon. But aserve's system definition does not include a
dependency on ZACL. There are a few ways to make sure ZACL is loaded
before aserve.
The `aserve` system definition name conflicts in Quicklisp with a
legacy [attempt to port
AllegroServe](https://sourceforge.net/p/portableaserve/git/ci/master/tree/)
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 "aserve")
(ql:quickload :zaserve)
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
**Only works on Clozure CL and SBCL**. Support for other
implementations will be added if there is sufficient demand. I don't
use other CL implementations with ZACL currently.
implementations may be added if there is sufficient
demand. Contributions of ports to other implementations are of course
welcome
**Does not support CGI**. A victim of time constraints. I do not need
CGI. CGI functionality requires non-trivial support for managing
subprocesses, and I am not sure if e.g. UIOP's subprocess management
API is sufficient.
**Does not support CGI**. A victim of time constraints. The author and
maintainers do not currently need CGI. CGI functionality requires
non-trivial support for managing subprocesses, and I am not sure if
e.g. UIOP's subprocess management API is sufficient.
**Lightly tested**. My application seems to work. Yours might not. If
you have trouble with ZACL and aserve, feel free to
[create an issue](https://gitlab.common-lisp.net/zbeane/zacl/issues)
and I'll take a look.
**Lightly tested**. Our applications seem to work. Yours might not. If
you have trouble with ZACL and zaserve, feel free to create an
issue[here](https://gitlab.common-lisp.net/zbeane/zacl/issues) and/or
[here](https://github.com/genworks/aserve/tree/zacl-compatible) and
the maintainers will see them.
**Possibly slow**. Using generic functions and portability layers will
be slower than running aserve natively on Allegro CL. There aren't
many ways around it. If you have a specific performance issue that
you'd like ZACL to address, [get in touch](mailto:xach@xach.com).
many ways around it. If you do have a specific performance issue when
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 @@
(in-package #:zacl)
;; This mimics what aserve.asd does.
(defclass asdf::cl-file (asdf:cl-source-file)
(defclass zacl-reader:cl-file (asdf:cl-source-file)
((type :initform "cl")))
(defmethod asdf:perform :around ((operation asdf:compile-op)
(component asdf::cl-file))
(component zacl-reader:cl-file))
(with-zacl-build-environment (call-next-method)))
......@@ -192,12 +192,6 @@ values otherwise."
(defun excl:fixnump (integer)
(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)
`(let ((,var (make-array ,len :element-type '(unsigned-byte 8))))
,@body))
......@@ -543,3 +537,20 @@ values otherwise."
(defun excl:fasl-read (file)
(with-open-file (stream file :element-type '(unsigned-byte 8))
(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 @@
`(progn ,@body))
(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)
(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)
(let ((stream (make-ssl-client-stream (real-stream socket))))
......
......@@ -3,3 +3,8 @@
(in-package #:zacl)
(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 @@
;; XXX Private package
#:without-interrupts
#:fd-stream-fd)
#+sbcl
(:import-from #:usocket
#:get-host-by-name)
(:import-from #:cl+ssl
#:make-ssl-client-stream
#:make-ssl-server-stream)
......@@ -124,7 +128,7 @@
(defpackage #:zacl-reader
(:use #:cl)
(:export #:*allegro-rewriting-readtable*))
(:export #:*allegro-rewriting-readtable* #:cl-file))
(defpackage #:zacl-if-star
(:use #:cl)
......@@ -231,7 +235,10 @@
#:stream-error-identifier
#:stream-error-code)
(:export #:sm
#:errorset))
#:errorset)
(:export #:string-to-base64-string
#:base64-string-to-string))
(defpackage #:ff
(:use)
......@@ -274,7 +281,39 @@
(defpackage #:util.zip
(: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
(:use)
......@@ -350,3 +389,5 @@
(defpackage #:util.string
(:use)
(:export #:string+))
(defpackage #:acl-socket (:use))
......@@ -5,7 +5,7 @@
(defparameter *allegro-feature-symbols*
'("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)
(defun allegro-conditional-p (expression)
......
......@@ -19,7 +19,9 @@
#:cl-store
#:alexandria
#:md5
#:cl+ssl)
#:cl+ssl
#:local-time
#:cl-base64)
:serial t
:components ((:file "package")
#+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