Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix nasdf #8

Merged
merged 4 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 9 additions & 57 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# SPDX-FileCopyrightText: Atlas Engineer LLC
# SPDX-License-Identifier: BSD-3-Clause
# Inspired by http://3bb.cc/blog/2020/09/11/github-ci/.

name: Tests

# We tell GitHub to not duplicate the checks in pull requests. See
# https://github.community/t/how-to-trigger-an-action-on-push-or-pull-request-but-not-both/16662/15
on:
push:
branches: [ master ]
Expand All @@ -17,68 +15,22 @@ jobs:
name: ${{ matrix.lisp }} on ${{ matrix.os }}
strategy:
matrix:
# Use ccl-bin/1.12.1 instead of 'ccl' because of
# https://github.com/roswell/roswell/issues/534.
# TODO: Revert when Roswell is functional again.
lisp: [sbcl-bin, ccl-bin/1.12.1, ecl/21.2.1]
rosargs: [dynamic-space-size=3072]
os: [ubuntu-latest, macos-latest] # try windows-latest when we understand commands to install Roswell on it

# run the job on every combination of "lisp" and "os" above
lisp: [sbcl-bin]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}

steps:
# Check out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Cache .roswell
id: cache-dot-roswell
uses: actions/cache@v1
- uses: actions/checkout@v4
with:
path: ~/.roswell
key: ${{ runner.os }}-dot-roswell-${{ matrix.lisp }}-${{ hashFiles('**/*.asd') }}
restore-keys: |
${{ runner.os }}-dot-roswell-${{ matrix.lisp }}-
${{ runner.os }}-dot-roswell-
show-progress: 'false'
# submodules: 'true'

- name: Install Roswell
shell: bash
# always run install, since it does some global installs and setup that isn't cached
env:
LISP: ${{ matrix.lisp }}
# TODO: Update Roswell to latest version (may need Ubuntu 20.* or above).
run: curl -L https://raw.githubusercontent.com/roswell/roswell/v20.06.14.107/scripts/install-for-ci.sh | sh -x

- name: Check Lisp
continue-on-error: true
shell: bash
run: |
ros ${{ matrix.rosargs }} -e '(format t "~a:~a on ~a~%...~%~%" (lisp-implementation-type) (lisp-implementation-version) (machine-type))'
ros ${{ matrix.rosargs }} -e '(format t " fixnum bits:~a~%" (integer-length most-positive-fixnum))'
ros ${{ matrix.rosargs }} -e "(ql:quickload 'trivial-features)" -e '(format t "features = ~s~%" *features*)'

- name: Update Quickdist if we have one cached
shell: bash
run: ros -e "(ql:update-all-dists :prompt nil)"

# TODO: This should rather include submodules and ASDF-loading,
# but we usually use no submodules for libraries. Maybe we should?
- name: Load the system
shell: bash
run: |
ros ${{ matrix.rosargs }} -e '(push (uiop:getcwd) ql:*local-project-directories*)' -e '(handler-case (ql:quickload :nsymbols) (error (a) (format t "caught error ~s~%~a~%" a a) (uiop:quit 17)))'
run: curl -L https://raw.githubusercontent.com/roswell/roswell/master/scripts/install-for-ci.sh | sh -x

- name: Run tests
shell: bash
run: |
ros ${{ matrix.rosargs }} -e '(setf *debugger-hook* nil)' -e '(push (uiop:getcwd) ql:*local-project-directories*)' -e '(handler-case (ql:quickload :nsymbols) (error (a) (format t "caught error ~s~%~a~%" a a) (uiop:quit 17)))' -e '(ql:quickload :lisp-unit2)' -e '(asdf:test-system :nsymbols)'

- name: Compilation warnings
shell: bash
run: |
ros ${{ matrix.rosargs }} -e '(push (uiop:getcwd) ql:*local-project-directories*)' -e '(load ".github/report-warnings.lisp")' -e '(compilation-conditions :nsymbols)'

- name: Unbound exports
shell: bash
run: |
ros ${{ matrix.rosargs }} -e '(push (uiop:getcwd) ql:*local-project-directories*)' -e '(ql:quickload :nsymbols)' -e '(load ".github/report-unbound-exports.lisp")' -e '(unbound-exports :nsymbols)'
ros -e '(handler-case (ql:quickload :nsymbols/tests) (error (c) (format t "Error: ~s~%~a~%" c c) (uiop:quit 1)))' \
-e '(let ((output (lisp-unit2:run-tests :package :nsymbols/tests))) (lisp-unit2:print-summary output) (when (or (lisp-unit2:failed output) (lisp-unit2:errors output)) (uiop:quit 1)))'
82 changes: 6 additions & 76 deletions guix.scm
Original file line number Diff line number Diff line change
Expand Up @@ -3,87 +3,17 @@

;;; Commentary:
;;
;; GNU Guix development package. To build and install, clone this repository,
;; switch directory to here and run:
;; GNU Guix development package. To start the REPL:
;;
;; guix package --install-from-file=guix.scm
;; guix shell -f path/to/guix.scm sbcl -- sbcl
;;
;; To use as the basis for a development environment, run:
;;
;; guix shell --container -D -f build-scripts/guix.scm
;;
;; Replace --container by --pure if you still want ASDF to see external
;; libraries in ~/common-lisp, etc.
;; To build a local executable and then run it:
;;; Code:

(use-modules (guix packages)
((guix licenses) #:prefix license:)
(guix gexp)
(guix git-download)
(guix build-system asdf)
(gnu packages)
(gnu packages lisp)
(gnu packages lisp-check)
(gnu packages lisp-xyz))

(define-public sbcl-nsymbols
(package
(name "sbcl-nsymbols")
(version "0.3.1")
(source
(local-file (dirname (current-filename)) #:recursive? #t)
;;;; Or this, in case of contributing to Guix.
;; (origin
;; (method git-fetch)
;; (uri (git-reference
;; (url "https://github.com/atlas-engineer/nsymbols")
;; (commit version)))
;; (file-name (git-file-name "cl-nsymbols" version))
;; (sha256
;; (base32
;; "SPECIFY-HASH")))
)
(build-system asdf-build-system/sbcl)
;; We use `cl-*' inputs and not `sbcl-*' ones so that CCL users can also use
;; this Guix manifests.
;;
;; Another reason is to not fail when an input dependency is found in
;; ~/common-lisp, which would trigger a rebuild of the SBCL input in the
;; store, which is read-only and would thus fail.
;;
;; The official Guix package should use `sbcl-*' inputs though.
(native-inputs (list cl-lisp-unit2 sbcl))
(inputs (list cl-closer-mop))
(arguments
'(#:asd-systems '("nsymbols" "nsymbols/star")))
(synopsis
"Functions to search, filter, and group symbols in chosen packages.")
(home-page "https://github.com/atlas-engineer/nsymbols")
(description "Nsymbols extends the regular package API of ANSI CL with more
operations, allowing one to list:

@itemize
@item @code{package-symbols}.
@item @code{package-variables}.
@item @code{package-functions}.
@item @code{package-generic-functions}.
@item @code{package-macros}.
@item @code{package-classes}.
@item @code{package-structures}.
@item And other symbol types, given code@{define-symbol-type} for those.
@end itemize

Nsymbols can also find symbols by their name/matching symbol with
@code{resolve-symbol}. All these operations are aware of symbol
visibility in the given packages, due to a @code{symbol-visibility}
function.")
(license license:bsd-3)))

(define-public cl-nsymbols
(sbcl-package->cl-source-package sbcl-nsymbols))

(define-public ecl-nsymbols
(sbcl-package->ecl-package sbcl-nsymbols))

cl-nsymbols
(package
(inherit cl-nsymbols)
(version "dev")
(source (local-file (dirname (current-filename)) #:recursive? #t)))
168 changes: 0 additions & 168 deletions nasdf/compilation-tests.lisp

This file was deleted.

Loading