diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 6fdc553..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: CI - -on: - push: - #pull_request: - #schedule: - # - cron: '0 */2 * * *' - -jobs: - build-windows: - runs-on: windows-latest - timeout-minutes: 90 - strategy: - fail-fast: false - matrix: - arch: [x86_64, i686] - include: - - arch: x86_64 - arch2: amd64 - bit: 64 - - arch: i686 - arch2: i686 - bit: 32 - env: - RESULT_NAME: windows-${{ matrix.arch2 }} - RESULT_PATH: windows-${{ matrix.arch2 }} - RESULT_PATH_SUB: roswell - steps: - - run: git config --global core.autocrlf false - - uses: actions/checkout@v2 - - uses: msys2/setup-msys2@v2 - with: - msystem: MINGW${{ matrix.bit }} - path-type: inherit - release: true - update: true - install: 'base-devel mingw-w64-${{ matrix.arch }}-toolchain' - - name: Run MSYS2 once - shell: msys2 {0} - run: | - pwd - echo $MSYSTEM - echo $MSYS2_PATH_TYPE - echo $PATH - - name: Build - shell: msys2 {0} - run: | - gcc -v - ./bootstrap - ./configure - make - make install - make winrelease - - name: Copy result - if: always() - shell: msys2 {0} - run: | - mkdir -p $RESULT_PATH - cp *.zip $RESULT_PATH/tmp.zip - cd $RESULT_PATH - 7z x tmp.zip - rm tmp.zip - - name: Upload Result - if: always() - uses: actions/upload-artifact@v1 - with: - name: ${{ env.RESULT_NAME }} - path: ${{ env.RESULT_PATH }} - diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index b3cc2c9..77ab588 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -1,4 +1,4 @@ -name: linux +name: Linux on: push: @@ -6,51 +6,58 @@ on: jobs: build: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest strategy: fail-fast: false matrix: + image: [musl64] + variant: ['', '-musl', '-glibc2.31'] + target: ['x86-64', 'arm64', 'riscv64'] include: - - lisp: sbcl-bin/2.0.0 - target: x86-64 - image: musl64 - makeopts: musl - - lisp: sbcl-bin/2.0.0 - target: x86-64 - image: musl64 - makeopts: musl - variant: -musl - - lisp: sbcl-bin/2.0.0 - target: x86-64 - image: deb - makeopts: deb - - lisp: sbcl-bin/2.0.0 - target: x86-64 - image: pandoc - makeopts: docs + # set default docker platform and image suffix. + - {docker-platform: linux/amd64 ,docker-image-suffix: '', makeopts: musl } + - {target: arm64 ,docker-platform: linux/arm64 ,docker-image-suffix: 'aarch64' } + - {target: riscv64 ,docker-platform: linux/riscv64 ,docker-image-suffix: 'riscv64' } + - {image: deb, makeopts: deb, target: x86-64 ,docker-platform: linux/amd64} + - {image: pandoc, makeopts: docs, target: x86-64 ,docker-platform: linux/amd64} + environment: SET_VERSION steps: - - uses: actions/checkout@v2 - + - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + image: tonistiigi/binfmt:qemu-v8.1.5 - name: setenv run: | echo "$HOME/.roswell/bin" >> $GITHUB_PATH echo "ROSWELL_BRANCH=release" >> $GITHUB_ENV - name: checkenv run: | - uname -s - uname -m + uname -s -m - name: Install Roswell env: - LISP: ${{ matrix.lisp }} + LISP: sbcl-bin/2.4.0 GITHUB_OAUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} IMAGE: ${{ matrix.image }} run: | sh scripts/install-for-ci.sh ros install snmsts/sn.github + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: docker.pkg.github.com + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: pull or build&push docker image + env: + DOCKER_PLATFORM: ${{ matrix.docker-platform }} + DOCKER_BUILD_OPTIONS: ${{ matrix.docker-build-options }} + DOCKER_IMAGE_SUFFIX: ${{ matrix.docker-image-suffix }} + IMAGE: ${{ matrix.image }} + run: | if [ -n "$IMAGE" ]; then - docker login docker.pkg.github.com -u snmsts -p $GITHUB_OAUTH_TOKEN; make -f scripts/Makefile pull-docker || make -f scripts/Makefile build-docker push-docker fi - name: build @@ -60,6 +67,9 @@ jobs: DOCKER: ${{ matrix.docker }} SUFFIX: ${{ matrix.suffix }} LINKFLAGS: ${{ matrix.linkflags }} + DOCKER_PLATFORM: ${{ matrix.docker-platform }} + DOCKER_BUILD_OPTIONS: ${{ matrix.docker-build-options }} + DOCKER_IMAGE_SUFFIX: ${{ matrix.docker-image-suffix }} IMAGE: ${{ matrix.image }} MAKEOPTS: ${{ matrix.makeopts }} VARIANT: ${{ matrix.variant }} diff --git a/.github/workflows/osx.yml b/.github/workflows/osx.yml index d162f3d..5951496 100644 --- a/.github/workflows/osx.yml +++ b/.github/workflows/osx.yml @@ -6,25 +6,34 @@ on: jobs: build: - runs-on: macos-10.15 + runs-on: ${{ matrix.target == 'arm64' && 'macos-14' || 'macOS-12' }} strategy: + fail-fast: false matrix: - lisp: [sbcl-bin/2.0.0] - target: [x86-64] + lisp: [sbcl-bin/2.3.8] + target: [arm64, x86-64] environment: SET_VERSION steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 + - name: setenv + run: | + echo "$HOME/.roswell/bin" >> $GITHUB_PATH + echo "ROSWELL_INSTALL_DIR=$HOME/.roswell" >> $GITHUB_ENV - name: checkenv run: | - uname -s - uname -m + uname -s -m brew install autoconf automake - name: Build + env: + CFLAGS: -mmacosx-version-min=10.9 + CXXFLAGS: -mmacosx-version-min=10.9 + LDFLAGS: -mmacosx-version-min=10.9 + ARCH: ${{ matrix.target }} run: | gcc -v ./bootstrap - ./configure + ./configure --prefix=$ROSWELL_INSTALL_DIR make make install make pack diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8068b3f..4cfdf1b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,7 +1,8 @@ name: test on: - push: + schedule: + - cron: '0 1 * * *' workflow_dispatch: jobs: @@ -12,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-10.15, ubuntu-18.04] + os: [macos-latest, ubuntu-latest] lisp: - alisp - cmu-bin/2019-06 @@ -25,22 +26,22 @@ jobs: experimental: [false] include: - lisp: mkcl - os: macos-10.15 + os: macos-latest experimental: true - lisp: mkcl - os: ubuntu-18.04 + os: ubuntu-latest experimental: true - lisp: sbcl/git - os: macos-10.15 + os: macos-latest experimental: true - lisp: sbcl/git - os: ubuntu-18.04 + os: ubuntu-latest experimental: true - lisp: abcl - os: macos-10.15 + os: macos-latest experimental: true - lisp: abcl - os: ubuntu-18.04 + os: ubuntu-latest experimental: true env: diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 5b49160..4d3e03c 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -35,7 +35,12 @@ jobs: path-type: inherit release: true update: true - install: 'base-devel mingw-w64-${{ matrix.arch }}-toolchain p7zip' + install: >- + base-devel + p7zip + autotools + mingw-w64-${{ matrix.arch }}-toolchain + mingw-w64-${{ matrix.arch }}-autotools - name: Run MSYS2 once shell: msys2 {0} run: | diff --git a/ChangeLog b/ChangeLog index ecdc04f..29f1527 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,22 @@ +roswell (24.10.115-1) unstable; urgency=low + + * New: tested on darwin/ppc environment. + * New: tested on netbsd/aarch64 environment. + * Fix: absolute path error on Windows (by Ashton Fagg) + * Fix: build error on non Windows environment with windres (reported by Richard DW Redcroft) + * Fix: error message in build (by Rongsong Shen) + + -- snmsts Wed, 16 Oct 2024 15:06:42 +0900 + +roswell (23.10.14.114-1) unstable; urgency=low + + * New: use patchelf to support for distributions like guix/nix. + * Fix: 'ros.installing' feature not work. (reported by Fukamachi) + * Fix: fix windows build script (by Jeongsoo, Park) + * Fix: ros fmt (by Daniel Jay Haskin) + + -- SANO Masatoshi Tue, 03 Oct 2023 12:57:11 +0000 + roswell (22.12.14.113-1) unstable; urgency=low * Fix: release CI for debian package. diff --git a/Makefile.am b/Makefile.am index a72fbba..db7e060 100644 --- a/Makefile.am +++ b/Makefile.am @@ -107,7 +107,7 @@ dist_roslisppatch_DATA = patch/sbcl-1.3.11.patch patch/sbcl-posix-tests.patch release-prepare: ros scripts/release.ros prepare release-commit: - ros scripts/release.ros release + ros scripts/release.ros release-commit release-push: ros scripts/release.ros release-push release-changelog: @@ -131,7 +131,7 @@ brewpr: git pull if [ `uname` = 'Darwin' ];then brew bump-formula-pr -v --url=https://github.com/roswell/roswell/archive/`git describe --abbrev=0 --tags`.tar.gz roswell; fi -PACK = $(PACKAGE)-$(VERSION)-$(shell uname -s | tr '[A-Z]' '[a-z]' | sed -E 's/([^-]*).*/\1/')-$(shell uname -m)$(SBCL_BIN_VARIANT) +PACK = $(PACKAGE)-$(VERSION)-$(shell uname -s | tr '[A-Z]' '[a-z]' | sed -E 's/([^-]*).*/\1/')-$(ARCH)$(SBCL_BIN_VARIANT) roswell/Makefile: rm -rf roswell @@ -144,7 +144,7 @@ roswell/Makefile: echo " mkdir -p $$""(prefix)/etc/roswell/patch" >> $@ echo " mkdir -p $$""(mandir)" >> $@ echo " install -c ros$(EXEEXT) $$""(prefix)/bin" >> $@ - echo " install -c -m 644 $(LISPS:%=lisp/%) $$""(prefix)/etc/roswell" >> $@ + echo " install -c -m 644 $(ROSS:%=lisp/%) $(LISPS:%=lisp/%) $$""(prefix)/etc/roswell" >> $@ echo " install -c -m 644 $(dist_roslisppatch_DATA) $$""(prefix)/etc/roswell/patch" >> $@ if [ 'x$(MDS)' != 'x' ]; then \ echo " install -c $(MDS:%.md=man/%.1) $$""(mandir)" >> $@; \ @@ -161,6 +161,7 @@ $(PACK).tar.bz2: roswell/Makefile cp src/ros$(EXEEXT) roswell $(MKDIR_P) roswell/lisp cp $(LISPS:%=lisp/%) roswell/lisp + cp $(ROSS:%=lisp/%) roswell/lisp cp $(dist_roslisppatch_DATA) roswell/patch if [ 'x$(MDS)' != x ]; then \ $(MKDIR_P) roswell/man; \ diff --git a/configure.ac b/configure.ac index be74090..ea7120a 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.59]) -AC_INIT([roswell],[22.12.14.113],snmsts@gmail.com) +AC_INIT([roswell],[24.10.115],snmsts@gmail.com) CFLAGS=${CFLAGS=""} CXXFLAGS=${CXXFLAGS=""} @@ -58,7 +58,7 @@ AC_CHECK_HEADERS(gnu/libc-version.h) AC_CHECK_HEADERS(windows.h,[with_windows=true]) AM_CONDITIONAL([WITH_WINDOWS], [test "$with_windows" != ""]) AC_CHECK_TOOL([WINDRES], [windres], []) -AM_CONDITIONAL([WITH_WIN_ICON], [test "$WINDRES" != ""]) +AM_CONDITIONAL([WITH_WIN_ICON], [test "$WINDRES" != "" -a "$with_windows" != ""]) AC_CHECK_MEMBERS([struct dirent.d_type],,,[#include ]) @@ -108,6 +108,12 @@ AC_ARG_WITH([sbcl_bin_variant], AC_SUBST([SBCL_BIN_VARIANT], ["${SBCL_BIN_VARIANT}"]) AC_DEFINE_UNQUOTED([SBCL_BIN_VARIANT],["${SBCL_BIN_VARIANT}"],[variant for sbcl-bin]) +AC_ARG_WITH([fixed_arch], + [AS_HELP_STRING([--with-fixed-arch=string],[set arch instead of on the fly detecting [default=''] possible choices are 'armhf', 'arm64'.])], + [FIXED_ARCH=$withval],[FIXED_ARCH=""]) +AC_SUBST([FIXED_ARCH], ["${FIXED_ARCH}"]) +AC_DEFINE_UNQUOTED([FIXED_ARCH],["${FIXED_ARCH}"],[arch to decide binary]) + # man file (ros.1) generation switch AC_ARG_ENABLE([manual_generation], [AS_HELP_STRING([--enable-manual-generation],[generate manual if enabled])], diff --git a/lisp/extend-quicklisp.lisp b/lisp/extend-quicklisp.lisp index a26dfb8..a57d00d 100644 --- a/lisp/extend-quicklisp.lisp +++ b/lisp/extend-quicklisp.lisp @@ -33,33 +33,44 @@ (defun roswell-installed-system-name (system-name) ;; should return repo part of system-name. - ;; "user//repo" "user//repo/branch" "git://bra/bra/bra/repo.git" "github://user/repo" - (when (find "" (split-sequence #\/ system-name) :test 'equal) ;; found "//" - (if (find #\: system-name) - (values nil "not implemented yet") ;; TBD - (second (remove "" (split-sequence #\/ system-name) :test 'equal))))) + ;; "user:repo[:branch or tag][/subsystem/name]" "git://bra/bra/bra/repo.git" "github://user/repo" + (let ((split (split-sequence #\: system-name))) + (when (rest split) ;; found ":" + (if (ignore-errors (and (eql (aref (second split) 0) #\/) + (eql (aref (second split) 1) #\/))) + (values nil "not implemented yet") ;; TBD + (let* ((str (first (last split))) + (pos (position #\/ str)) + (subsystem (if pos + (prog1 + (subseq str pos) + (setf (first (last split)) (subseq str 0 pos))) + ""))) + (values (and (second split) + (not (zerop (length (second split)))) + (format nil "~A~A" (second split) subsystem)) + (lambda (system-name) + (roswell:roswell `("install" ,(format nil "~{~A~^/~}" split) + ))))))))) (defun roswell-installable-searcher (system-name) - (let ((name (roswell-installed-system-name system-name)) - pname) + (multiple-value-bind (name func) + (roswell-installed-system-name system-name) (and name - (not (when (setf pname (read-call "asdf/find-system::primary-system-name" system-name)) - (asdf:find-system pname nil))) - (prog1 - (or (quicklisp-client:local-projects-searcher name) - (unless (find system-name (loop for ar = (ros:getenv "ROSINSTALL") then (subseq ar (1+ p)) - for p = (position #\, ar) - for arg = (if p (subseq ar 0 p) ar) - collect arg - while p) - :test 'equal) - (roswell:roswell `("install" ,system-name)) - (quicklisp-client:register-local-projects) - (quicklisp-client:local-projects-searcher name)) - (return-from roswell-installable-searcher)) ;;can't find. - (eval `(asdf:defsystem ,system-name :depends-on (,name)))) - (asdf:find-system system-name)))) + (not (equal name system-name)) + (let ((result + (or (ignore-errors (asdf:find-system name)) + (progn + (funcall func system-name) + (local-project-build-hash :rebuild t) + (asdf:find-system name)) + (return-from roswell-installable-searcher)))) ;;can't find. + (when result + (let ((*load-pathname* nil)) + (eval `(asdf:defsystem ,system-name + :depends-on (,name))))) + result)))) (defun local-project-enum (path) (let ((sub (remove-if (lambda (x) diff --git a/lisp/fmt.ros b/lisp/fmt.ros index 808e5f3..648a906 100644 --- a/lisp/fmt.ros +++ b/lisp/fmt.ros @@ -58,7 +58,7 @@ exec ros -Q -N roswell -- $0 "$@" lem-lisp-syntax:*syntax-table*) (setf (lem-base:variable-value 'lem-base:calc-indent-function :buffer buffer) 'lem-lisp-syntax:calc-indent) - (lem-base:indent-region (lem-base:buffer-start-point buffer) + (lem-base:indent-points (lem-base:buffer-start-point buffer) (lem-base:buffer-end-point buffer)) (loop with regexp = "[ ]+$" ;; remove trailing spaces. for start = (lem-base:search-forward-regexp (lem-base:copy-point (lem-base:buffer-start-point buffer)) regexp) diff --git a/lisp/help-install.lisp b/lisp/help-install.lisp index 2a7abb2..6830255 100644 --- a/lisp/help-install.lisp +++ b/lisp/help-install.lisp @@ -17,7 +17,7 @@ (mapcar #'usage '("Usage:" "" - "To install a new Lisp implementaion:" + "To install a new Lisp implementation:" " ~A install impl [options]" "or a system from the GitHub:" " ~A install fukamachi/prove/v2.0.0 [repository... ]" @@ -30,6 +30,7 @@ "" "For more details on impl specific options, type:" " ~A help install impl" + "e.g.: ~A help install sbcl" "" "" "Candidates impls for installation are:"))) diff --git a/lisp/install+msys2.lisp b/lisp/install+msys2.lisp index fb85e67..6f813c2 100644 --- a/lisp/install+msys2.lisp +++ b/lisp/install+msys2.lisp @@ -9,8 +9,21 @@ (defvar *msys2-arch*) (defvar *msys2-bits*) +(defun msys2-get-release (version) + " + In the new GitHub releases, the release name is a date with dashes + and the version is a date without. + " + (if (equal (length version) 8) + (format nil "~A-~A-~A" + (subseq version 0 4) + (subseq version 4 6) + (subseq version 6 8)) + version)) + (defun msys2-get-version () - '("20180531")) + '("20230127")) + ;;sha1 "309f604a165179d50fbe4131cf87bd160769f974" ;;(ironclad:byte-array-to-hex-string (ironclad:digest-file :sha1 path)) @@ -33,9 +46,12 @@ (when (or (not (probe-file path)) (opt "download.force")) (download - (format nil "~Amsys2/Base/~A/msys2-base-~A-~A.tar.xz" + (format nil "~A~A/msys2-base-~A-~A.tar.xz" (msys2-uri) - *msys2-arch* *msys2-arch* (getf argv :version)) + (msys2-get-release + (getf argv :version)) + *msys2-arch* + (getf argv :version)) path)) (format t " done.~%") (expand path @@ -67,11 +83,10 @@ "make zlib-devel")) :output t :error-output t)) - (uiop/run-program:run-program - `(,(uiop:native-namestring (merge-pathnames "autorebase.bat" msys))) - :output t - :error-output t) + `(,(uiop:native-namestring (merge-pathnames "autorebase.bat" msys))) + :output t + :error-output t) (setf (config "msys2.version") (getf argv :version))))) (cons t argv)) diff --git a/lisp/install-allegro.lisp b/lisp/install-allegro.lisp index 7943cf1..2d42942 100644 --- a/lisp/install-allegro.lisp +++ b/lisp/install-allegro.lisp @@ -8,27 +8,50 @@ (mapcar #'car *allegro-agreement-uri*)) (defun make-allegro-uri (argv &key - (uname (uname)) - (uname-m (uname-m)) - (version (getf argv :version))) + (uname (uname)) + (uname-m (uname-m)) + (version (getf argv :version))) (let ((os (intern uname :keyword)) (machine (intern uname-m :keyword))) - (cond ((find version '("10.1express" "100express") :test 'equal) + (cond ((find version '("11.0bexpress" + "10.1express") + :test 'equal) (format nil "~@{~A~}" - (allegro-uri) "pub/acl" version "/" - (case os (:|darwin| "macosx") (t os)) - (if (eql os :|windows|) "" - (case machine (:|x86| 86) (:|x86-64| 86))) + (allegro-uri) "ftp/pub/acl" version "/" + (ecase os + (:|linux| (ecase machine + (:|x86-64| "linuxamd64.64") + (:|arm64| "linuxarm64") + (:|x86| "linux86"))) + (:|darwin| (case machine + (:|arm64| "macarm64.64") + (:|x86-64| "macosx86-64.64"))) + (:|windows| os) ;; 32bit only + (:|freebsd| os)) ;; 32bit only "/acl" version - (case os (:|linux| "-linux") (:|darwin| "-macosx") (:|windows| "") (t os)) - "-" (if (eql os :|darwin|) "x64" - (case machine (:|x86-64| "x86") (t machine))) - (case os - (:|linux| (cond ((equal "10.1express" version) ".tbz2") - ((equal "100express" version) ".bz2"))) - (:|darwin| ".dmg") - (:|windows| ".exe")))) - ((equal "101b" version))))) + (ecase os + (:|linux| (format nil "~@{~A~}" + "-linux-" + (ecase machine + (:|x86-64| "x64") + (:|arm64| "aarch64") + (:|x86| "x86")) + (cond + ((equal "100express" version) ".bz2") + (t ".tbz2")))) + (:|darwin| (format nil "~@{~A~}" + (if (equal version "10.1express") + "-macosx-" + "-macos-") + (ecase machine + (:|x86-64| "x64.dmg") + (:|arm64| "arm64.dmg")))) + (:|windows| "-x86.exe") + (:|freebsd| (format nil "~@{~A~}" + "-freebsd-" + (ecase machine + (:|x86-64| "x86.tbz2") + (:|x86| "x86.tbz2")))))))))) (defun allegro-argv-parse (argv) (format *error-output* "~&Installing allegro/~A...~%" (getf argv :version)) @@ -65,7 +88,9 @@ (uiop/filesystem:delete-directory-tree path :validate t)) (ql-impl-util:rename-directory - (merge-pathnames (format nil "acl~A/" (getf argv :version)) impls) + (first (loop for file in (directory (merge-pathnames (format nil "acl~A*/" (getf argv :version)) impls)) + when (probe-file file) + collect it)) (merge-pathnames (format nil "~A/" (opt "as")) impls)))) (cons t argv))) diff --git a/lisp/install-asdf.lisp b/lisp/install-asdf.lisp index ef2ac61..fc683e4 100644 --- a/lisp/install-asdf.lisp +++ b/lisp/install-asdf.lisp @@ -32,7 +32,7 @@ (let* ((src (merge-pathnames (format nil "asdf-~A/" version) src)) (cmd (list (sh) "-lc" (format nil "cd ~S;~A" (#+win32 mingw-namestring #-win32 princ-to-string src) - (or #+freebsd "gmake" "make"))))) + (make))))) (uiop/os:chdir src) (format t "~&chdir ~A~%" src) (uiop/run-program:run-program cmd :output t :ignore-error-status nil) diff --git a/lisp/install-ecl.lisp b/lisp/install-ecl.lisp index 4c41104..3eb08a7 100644 --- a/lisp/install-ecl.lisp +++ b/lisp/install-ecl.lisp @@ -90,7 +90,7 @@ (homedir))) :direction :output :if-exists :append :if-does-not-exist :create) (format out "~&--~&~A~%" (date)) - (let* ((cmd (format nil "make")) + (let* ((cmd (make)) (*standard-output* (make-broadcast-stream out #+sbcl(make-instance 'count-line-stream)))) (ecl-chdir argv) (uiop/run-program:run-program cmd :output t :ignore-error-status t))) @@ -108,7 +108,7 @@ (format out "~&--~&~A~%" (date)) (let ((*standard-output* (make-broadcast-stream out #+sbcl(make-instance 'count-line-stream)))) - (uiop/run-program:run-program "make install" :output t))) + (uiop/run-program:run-program (format nil "~A install" (make)) :output t))) (format *error-output* "done.~%")) (cons t argv)) @@ -119,7 +119,7 @@ (*standard-output* (make-broadcast-stream out #+sbcl(make-instance 'count-line-stream)))) (uiop/run-program:run-program - (list (sh) "-lc" (format nil "cd ~S;make clean" (namestring (uiop:getcwd)))) + (list (sh) "-lc" (format nil "cd ~S;~A clean" (namestring (uiop:getcwd)) (make))) :output t)) (format t "done.~%") (cons t argv)) diff --git a/lisp/locations.lisp b/lisp/locations.lisp index cb2f61b..8e5167b 100644 --- a/lisp/locations.lisp +++ b/lisp/locations.lisp @@ -17,7 +17,7 @@ (defuri clisp-version-uri "http://ftp.gnu.org/pub/gnu/clisp/release/") (defuri clisp-head-version-uri "https://github.com/roswell/clisp_head/releases/download/files/clisp_head.tsv") (defuri 7za-uri "http://sourceforge.net/projects/sevenzip/files/7-Zip/9.20/7za920.zip/download#") -(defuri allegro-uri "ftp://ftp.franz.com/") +(defuri allegro-uri "https://franz.com/") (defuri abcl-bin-uri "https://common-lisp.net/project/armedbear/releases/") (defuri ccl-bin-uri "https://github.com/roswell/ccl_bin/releases/download/") (defuri clasp-bin-uri "https://github.com/roswell/clasp_bin/releases/download/") @@ -28,7 +28,7 @@ (defuri ffcall-uri "https://github.com/roswell/libffcall/archive/") (defuri sigsegv-uri "http://ftpmirror.gnu.org/libsigsegv/") -(defuri msys2-uri "http://kent.dl.sourceforge.net/project/") +(defuri msys2-uri "https://github.com/msys2/msys2-installer/releases/download/") (defuri clisp-patch1-uri "https://raw.githubusercontent.com/Homebrew/homebrew/2fb8cb1a2279f80dc89900b3ebaca9e5afc90494/Library/Formula/clisp.rb") @@ -54,6 +54,7 @@ (export (defvar *allegro-agreement-uri* - '(("10.1express" . #1="http://franz.com/ftp/pub/legal/ACL-Express-20150812.pdf") + '(#+darwin ("11.0bexpress" . "https://franz.com/ftp/pub/legal/ACL-Express-20170301.pdf") + ("10.1express" . #1="https://franz.com/ftp/pub/legal/ACL-Express-20170301.pdf") ("100express" . #1#) ("101b" . "http://franz.com/products/licensing/FSLA10.1.beta.pdf")))) diff --git a/lisp/util-install-quicklisp.lisp b/lisp/util-install-quicklisp.lisp index 9750367..1aaed61 100644 --- a/lisp/util-install-quicklisp.lisp +++ b/lisp/util-install-quicklisp.lisp @@ -174,7 +174,8 @@ *error-output* (make-broadcast-stream) *trace-output*(make-broadcast-stream))) (if (ql:where-is-system system) - (progn (ql:quickload system) + (progn (asdf:load-asd (asdf:system-source-file system)) + (ql:quickload system) (ignore-errors(asdf:oos 'asdf:load-op system :force t))) (ql:quickload system))) (format *error-output* "~&[~a/3] Processing build-hook.." (incf step)) diff --git a/lisp/util.lisp b/lisp/util.lisp index 526bfff..491baef 100644 --- a/lisp/util.lisp +++ b/lisp/util.lisp @@ -4,7 +4,7 @@ (:import-from :ros :opt :ensure-asdf :*local-project-directories*) (:export :uname :uname-m :homedir :config :impl :which :config-env :checkoutdir - :parse-version-spec :head :download :expand :sh :chdir :system :module + :parse-version-spec :head :download :expand :sh :make :chdir :system :module :core-extention :clone-github :opt :read-call :set-opt :copy-dir :roswell-installable-searcher :setenv :unsetenv :ensure-asdf :split-sequence :local-project-build-hash)) @@ -196,6 +196,9 @@ Example: (which "bash") "sh")) +(defun make () + (or #+freebsd "gmake" "make")) + (defvar *version* `(:roswell ,(or (ignore-errors (roswell:version)) (progn diff --git a/roswell.asd b/roswell.asd index 3b2cf23..60a910b 100644 --- a/roswell.asd +++ b/roswell.asd @@ -1,5 +1,5 @@ (defsystem "roswell" - :version "22.12.14.113" + :version "24.10.115" :author "SANO Masatoshi" :license "MIT" :depends-on ("simple-date-time" "split-sequence" "plump" "zip") diff --git a/scripts/Docker/musl64/Dockerfile b/scripts/Docker/musl64/Dockerfile index ab96cc8..e6c8461 100644 --- a/scripts/Docker/musl64/Dockerfile +++ b/scripts/Docker/musl64/Dockerfile @@ -1,7 +1,5 @@ -FROM alpine:3.13 +FROM alpine:3.20 run apk add --no-cache \ alpine-sdk automake autoconf curl-dev bash linux-headers \ - curl-static nghttp2-static openssl-libs-static brotli-static zlib-static; \ - cd /tmp/roswell;./bootstrap;./configure --with-sbcl-bin-variant='-musl';make; make install; \ - ros install sbcl-bin/2.0.5; \ - rm -rf /tmp/roswell + curl-static nghttp2-static openssl-libs-static brotli-static zlib-static zstd-static c-ares-static \ + libidn2-static libunistring-static libpsl-static; diff --git a/scripts/Docker/musl64/Name b/scripts/Docker/musl64/Name index 898e2b7..5c1f4a7 100644 --- a/scripts/Docker/musl64/Name +++ b/scripts/Docker/musl64/Name @@ -1 +1 @@ -roswell-musl:64 +roswell-musl:24.10 diff --git a/scripts/Makefile b/scripts/Makefile index 85396af..f622f20 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -1,6 +1,12 @@ -include .env export $(shell sed 's/=.*//' .env) +DOCKER_REPO ?= docker.pkg.github.com/roswell/roswell +DOCKER_PLATFORM ?= linux/amd64 +DOCKER_BUILD_OPTIONS ?= +DOCKER_IMAGE_SUFFIX ?= +IMAGE ?= + all: echo all @@ -16,20 +22,27 @@ show: @echo VERSION=$(VERSION) VARIANT=$(VARIANT) build-docker: - docker build -t docker.pkg.github.com/roswell/roswell/$$(cat ./scripts/Docker/$(IMAGE)/Name) ./scripts/Docker/$(IMAGE) + docker build \ + --platform $(DOCKER_PLATFORM) \ + -t $(DOCKER_REPO)/$$(cat ./scripts/Docker/$(IMAGE)/Name)$(DOCKER_IMAGE_SUFFIX) \ + $(DOCKER_BUILD_OPTIONS) \ + ./scripts/Docker/$(IMAGE) push-docker: - docker push docker.pkg.github.com/roswell/roswell/$$(cat ./scripts/Docker/$(IMAGE)/Name); + docker push $(DOCKER_REPO)/$$(cat ./scripts/Docker/$(IMAGE)/Name)$(DOCKER_IMAGE_SUFFIX); pull-docker: - docker pull docker.pkg.github.com/roswell/roswell/$$(cat ./scripts/Docker/$(IMAGE)/Name); + docker pull $(DOCKER_REPO)/$$(cat ./scripts/Docker/$(IMAGE)/Name)$(DOCKER_IMAGE_SUFFIX); docker: docker run \ + --rm \ + --platform $(DOCKER_PLATFORM) \ -v `pwd`:/tmp2 \ -e ARCH=$(ARCH) \ -e VERSION=$(VERSION) \ + -e SUFFIX=$(SUFFIX) \ -e CFLAGS=$(CFLAGS) \ -e LINKFLAGS=$(LINKFLAGS) \ -e VARIANT=$(VARIANT) \ - docker.pkg.github.com/roswell/roswell/$$(cat ./scripts/Docker/$(IMAGE)/Name) \ + $(DOCKER_REPO)/$$(cat ./scripts/Docker/$(IMAGE)/Name)$(DOCKER_IMAGE_SUFFIX) \ bash \ -c "cd /tmp2;make -f scripts/Makefile $(MAKEOPTS)" upload: @@ -41,7 +54,7 @@ musl: ./bootstrap ./configure --enable-maintainer-mode --with-sbcl-bin-variant=$(VARIANT) \ LDFLAGS="--static -static-libgcc -static-libstdc++ -static" \ - LIBS="-lcurl -lbrotlidec-static -lbrotlicommon-static -lnghttp2 -lssl -lcrypto -lz" + LIBS="-lcurl -lbrotlidec -lbrotlicommon -lnghttp2 -lssl -lcrypto -lz -lzstd -lcares -lidn2 -lunistring -lpsl" make make pack diff --git a/scripts/install-for-ci.sh b/scripts/install-for-ci.sh index 4bf7f2b..f675830 100644 --- a/scripts/install-for-ci.sh +++ b/scripts/install-for-ci.sh @@ -1,7 +1,7 @@ #!/bin/sh set -e -ROSWELL_RELEASE_VERSION=21.10.14.111 +ROSWELL_RELEASE_VERSION=24.10.115 ROSWELL_TARBALL_PATH=$HOME/roswell.tar.gz ROSWELL_DIR=$HOME/.roswell ROSWELL_REPO=${ROSWELL_REPO:-https://github.com/roswell/roswell} diff --git a/scripts/release.ros b/scripts/release.ros index 67ae26b..9fc53b3 100755 --- a/scripts/release.ros +++ b/scripts/release.ros @@ -119,7 +119,7 @@ exec ros -Q -L sbcl-bin -- $0 "$@" `("To release" "1. Review changes and complete ChangeLog" "2. Type" - "make release"))) + "make release-commit"))) (defun prepare (argv) (declare (ignore argv)) @@ -139,7 +139,7 @@ exec ros -Q -L sbcl-bin -- $0 "$@" (edit-roswell-asd) (show-how-to-release)) -(defun release (argv) +(defun release-commit (argv) (declare (ignore argv)) (!"git checkout master") (!"git add ChangeLog configure.ac roswell.asd") diff --git a/src/cmd-run.c b/src/cmd-run.c index 9bce2d5..dd71067 100644 --- a/src/cmd-run.c +++ b/src/cmd-run.c @@ -193,6 +193,10 @@ char** determin_args(int argc,char **argv) { int i=position_char("/",_); cmd.name=subseq(_,0,i); cmd.short_name=subseq(_,i+1,0); + if(cmd.short_name==NULL) { + cond_printf(0,"%s does not exist.stop.\n", _); + exit(EXIT_FAILURE); + } for(i=0;iexpand_path; + char* roswell_path=which(argv_orig[0]); /* which ros */ + int patchelf_available; + int ret; + char* impl=param->impl; + char* version=param->version; + char* impl_path= cat(home,impldir(param->arch,param->os,impl,version),NULL); + char* patchelf_cmd=which("patchelf"); + char* result; + char* ros; + patchelf_available=strlen(patchelf_cmd)?1:0; + s(patchelf_cmd); + if(!patchelf_available) { + fprintf(stderr,"'patchelf' not detected.no patching for sbcl\n"); + return 1; + } + patchelf_cmd=cat("patchelf --print-interpreter ",roswell_path,NULL); + result=system_(patchelf_cmd); + ros=remove_char("\r\n",result); + s(patchelf_cmd),s(result),s(roswell_path); + cond_printf(1,"roswell's interpreter is '%s'...\n",ros); + patchelf_cmd=cat("patchelf --set-interpreter ",ros," ",impl_path,"/bin/sbcl ",NULL); + ret=System(patchelf_cmd); + s(patchelf_cmd),s(impl_path),s(home),s(ros); + if(ret!=0) { + fprintf(stderr,"'patchelf' for sbcl failed.\n"); + } + cond_printf(0,"patchelf sbcl Done."); + return 1; +} +#endif + install_cmds install_sbcl_bin_full[]={ sbcl_version_bin, start, sbcl_bin_download, sbcl_bin_expand, sbcl_bin_install, +#ifdef __linux__ + sbcl_bin_patchelf, +#endif NULL }; diff --git a/src/util-dir.c b/src/util-dir.c index b17deb6..6cd55d5 100644 --- a/src/util-dir.c +++ b/src/util-dir.c @@ -10,8 +10,12 @@ char* homedir(void) { } char* truename(const char* path) { - char* ret=realpath(path,NULL); - return ret?ret:which((char*)path); + char* buf=alloc(PATH_MAX); + char* ret=realpath(path,buf); + if(ret) + return buf; + s(buf); + return which((char*)path); } int ensure_directories_exist(char* path) { @@ -71,9 +75,15 @@ char* currentdir(void) { return append_trail_slash(q_(getcwd(buf,2048))); } +int is_valid_path(const char *path) { + return path[0] == '/'; +} + #else + char* homedir(void); char* currentdir(void); +int is_valid_path(const char *); #endif char* configdir(void) { @@ -82,9 +92,10 @@ char* configdir(void) { if (env) /* note: env can be a NULL */ { - if (env[0] != DIRSEP[0]) /* note: DIRSEP == \\ on windows, / on unix */ + if (!is_valid_path(env)) { cond_printf(0,"Error: %s must be absolute. Got: %s \n",c,env); + abort(); } s(c); /* note : this frees c. */ return append_trail_slash(q(env)); @@ -143,3 +154,4 @@ char* basedir(void) { s(cd_); return configdir(); } + diff --git a/src/util-dir_windows.c b/src/util-dir_windows.c index 822fc98..0ee7166 100644 --- a/src/util-dir_windows.c +++ b/src/util-dir_windows.c @@ -64,4 +64,21 @@ char* currentdir(void) { char buf[2048]; return append_trail_slash(q_(_getcwd(buf,2048))); } + +int is_valid_path(const char *path) { + // + // On Windows, an absolute path can technically + // start with a drive letter (i.e. c:\roswell), + // but could also be a UNC path (i.e. \\OTHERMACHINE\roswell). + // + // But, if invoked inside an msys2 shell we could get a UNIX-style path. + // + // It appears however that the latter two scenarios are not supported + // by other parts of the codebase, so we shall enforce here that only + // regular Windows-style paths are allowed. + // + + return (isalpha(path[0]) && path[1] == ':' && (path[2] == '\\' || path[2] == '/')); +} + #endif diff --git a/src/util.c b/src/util.c index 3added9..de82e96 100644 --- a/src/util.c +++ b/src/util.c @@ -9,14 +9,42 @@ char* uname_s(void) { s(p2); return q("solaris"); } + if(strcmp(p2,"Linux")==0 && + strcmp(UNAME_M,"aarch64") ==0) { + char* result=system_("uname -o"); + char* result2=remove_char("\r\n",result); + s(result); + if(strcmp(result2,"Android")==0) { + s(result2),s(p2); + /* termux? */ + return q("android"); + } + } + if(strcmp(p2,"DragonFly")==0) { + s(p2); + return q("DFlyBSD"); + } return downcase(p2); } char* uname_m(void) { char *p2=q(UNAME_M); - if(strcmp(p2,"i86pc")==0) { + if(strlen(FIXED_ARCH) !=0) { s(p2); - return q("x86-64"); + return q(FIXED_ARCH); + } + if(strcmp(p2,"i86pc")==0) { + /* solaris */ + s(p2); + char* result=system_("isainfo -k"); + char* result2=remove_char("\r\n",result); + s(result); + if(strcmp(result2,"amd64")==0) { + s(result2); + return q("x86-64"); + } + s(result2); + return q("x86"); } if(strcmp(p2,"i686")==0) { s(p2); @@ -30,12 +58,19 @@ char* uname_m(void) { s(p2); return q("x86-64"); } + if(strcmp(p2,"evbarm")==0 ) { + /*netbsd arm*/ + char* result=system_("uname -p"); + s(p2); + p2=remove_char("\r\n",result); + } if(strcmp(p2,"aarch64")==0) { s(p2); return q("arm64"); } if(strcmp(p2,"armv6l")==0 || - strcmp(p2,"armv7l")==0) { + strcmp(p2,"armv7l")==0 || + strcmp(p2,"armv8l")==0) { char* result=system_("readelf -A /proc/self/exe |grep Tag_ABI_VFP_args|wc -l"); char* result2=remove_char("\r\n",result); s(result); @@ -51,6 +86,10 @@ char* uname_m(void) { s(p2); return q("armel"); } + if(strcmp(p2,"Power Macintosh")==0) { + s(p2); + return q("ppc"); + } return substitute_char('-','_',p2); } diff --git a/src/util.h b/src/util.h index a2e3585..e7d4509 100644 --- a/src/util.h +++ b/src/util.h @@ -13,6 +13,7 @@ #include #include #ifndef HAVE_WINDOWS_H +#include #include #include #include @@ -142,6 +143,7 @@ int directory_exist_p (char* path); int change_directory(const char* path); int delete_directory(char* pathspec,int recursive); char* impldir(char* arch,char* os,char* impl,char* version); +int is_valid_path(const char *path); /*util_file.c */ int delete_file(char* pathspec); int rename_file(char* file,char* new_name);