
Raymond Toy pushed to branch issue-390-autogen-errno-package at cmucl / cmucl Commits: 90dbaa53 by Raymond Toy at 2025-03-03T17:15:00-08:00 Modify how exports-errno.lisp is created. To make it a little easier to read, we use `{...} > src/code/exports-errno.lisp`. Then we can more easily see the header and the footer of the file and also the commands used to generate all the exported symbols. Update some comments in the generated file as well. - - - - - 59b9f69e by Raymond Toy at 2025-03-04T06:21:52-08:00 ERRNO uses LISP package In the generated file containing the defpackage form for ERRNO, we need to make sure ERRNO uses the LISP package so that this file can be compiled. This is what happens with the UNIX package in exports.lisp, so we need to do the same for ERRNO. - - - - - eb59cc93 by Raymond Toy at 2025-03-04T06:23:31-08:00 Remove line saying ERRNO uses LISP package This was moved to the generated exports-errno.lisp file. - - - - - 6acf4a72 by Raymond Toy at 2025-03-04T06:24:14-08:00 Load and/or compile exports-errno.lisp Actually load or compile this file appropriately just before we do the same to exports.lisp. - - - - - 5 changed files: - bin/build-world.sh - bin/create-errno.sh - src/code/exports.lisp - src/tools/worldcom.lisp - src/tools/worldload.lisp Changes: ===================================== bin/build-world.sh ===================================== @@ -53,6 +53,7 @@ $LISP "$@" -noinit -nositeinit <<EOF (pushnew :no-clm *features*) (pushnew :no-hemlock *features*) +(load "target:code/exports-errno") (load "target:code/exports") (load "target:tools/setup" :if-source-newer :load-source) (comf "target:tools/setup" :load t) ===================================== bin/create-errno.sh ===================================== @@ -82,7 +82,8 @@ if [ -n "$SHOW" ]; then fi # Now generate the defpackage form for the ERRNO package. -cat > src/code/exports-errno.lisp <<EOF +{ + cat <<EOF ;;; -*- Log: C.Log -*- ;;; ;;; ********************************************************************** @@ -94,7 +95,11 @@ cat > src/code/exports-errno.lisp <<EOF ;;; ;;; ********************************************************************** ;;; -;;; All the stuff necessary to export various symbols from various packages. +;;; Defines the ERRNO package and all the exported symbols. +;;; +;;; This file is auto-generated via bin/create-errno.sh. +;;; +;;; DO NOT EDIT! ;;; (in-package "LISP") @@ -105,11 +110,20 @@ cat > src/code/exports-errno.lisp <<EOF (rename-package "ERRNO" "ERRNO" 'nil) (make-package "ERRNO" :nicknames 'nil :use nil)) +(use-package '("LISP") "ERRNO") + (defpackage "ERRNO" (:export -$(grep '(def-unix-error ' $ERRNO_FILE | - cut -d ' ' -f2 | - sed 's/\(.*\)/ "\1"/' | - sort) +EOF + # Get the def-unix-error forms from the ERRNO_FILE, extract out + # the name, put double-quotes around them and then sort the result + # to get all the exported symbols for the ERRNO package. + grep '(def-unix-error ' $ERRNO_FILE | + cut -d ' ' -f2 | + sed 's/\(.*\)/ "\1"/' | + sort + # Close the defpackage form + cat <<EOF )) EOF +} > src/code/exports-errno.lisp ===================================== src/code/exports.lisp ===================================== @@ -136,7 +136,6 @@ (use-package '("SYSTEM" "ALIEN-INTERNALS" "ALIEN" "LISP") "C-CALL") (use-package '("KERNEL" "EXTENSIONS" "LISP") "INSPECT") (use-package '("LISP" "KERNEL") "BIGNUM") -(use-package '("LISP") "ERRNO") (use-package '("LISP") "UNIX") (use-package '("KERNEL" "LISP" "EXTENSIONS") "FORMAT") (use-package '("EXTENSIONS" "SYSTEM" "DEBUG" "KERNEL" "BIGNUM") "LISP") ===================================== src/tools/worldcom.lisp ===================================== @@ -315,6 +315,7 @@ (comf "target:code/multi-proc")) (comf "target:code/setf-funs") +(comf "target:code/exports-errno" :proceed t) (comf "target:code/exports" :proceed t) ;;; Compile basic macros that we assume are already in the compilation ===================================== src/tools/worldload.lisp ===================================== @@ -78,6 +78,7 @@ ;;; Make sure the package structure is correct. ;;; +(maybe-byte-load "code:exports-errno") (maybe-byte-load "code:exports") ;;; Load random code sources. View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/7120588272b74c392c0d3e5... -- View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/7120588272b74c392c0d3e5... You're receiving this email because of your account on gitlab.common-lisp.net.