Skip to content

Commit

Permalink
release: swish 2.0.0
Browse files Browse the repository at this point in the history
- bump Swish version to 2.0.0 to avoid confusion with internal 1.x
- set Swish version based on value in swish.h
- commonize refresh of compile-time includes in Mf-base
- use simpler form of include-line since Chez Scheme 9.5.4
  provides the revision information we need
- remove occurrences of "Swish Version" from documentation
- add change log
- add contributing guidelines
- add github issue / pull-request templates
  • Loading branch information
owaddell-beckman committed Oct 1, 2020
1 parent fab43d1 commit 406094e
Show file tree
Hide file tree
Showing 15 changed files with 188 additions and 34 deletions.
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of the bug.

**How to reproduce the bug**
Steps to reproduce the behavior:

1.
2.
3.

**Expected behavior**
A clear and concise description of what you expected to happen.

**Software environment**
Include the output of `swish-build --info`

```
here
```
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**What problem are you trying to solve?**
A clear and concise description of the problem.

**Proposed solution**
A clear and concise description of the solution.

10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: Question
about: Swish question?
title: ''
labels: ''
assignees: ''

---

What is your question about Swish?
1 change: 1 addition & 0 deletions .github/config.hml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
12 changes: 12 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
**Fixes**

Reference an issue # or feature request # here.

**Proposed changes**

Summarize changes here. Note any breaking changes.

*
*
*

72 changes: 72 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Contributing to Swish

Swish is a work in progress. We invite contributions from anyone who is
interested in putting forth the necessary effort. Before investing significant
effort preparing a contribution, consider running the idea by one of the
maintainers for additional guidance and advice. One or more of the maintainers
will review pull requests for compatibility with the principles and guidance
given below (adapted from [Chez Scheme](https://github.com/cisco/ChezScheme/blob/master/CONTRIBUTING.md)).

Our core principles are simple: we try to make Swish reliable and efficient.

Reliability means behaving as designed and documented. A Swish program may crash
due to bugs in the program, but it should not crash due to bugs in Swish.

Efficiency means performing at a high level, without excessive use of CPU time
and memory. Performance should scale well as problem size grows and should be
balanced across features, not good in one area and bad in another.

We attempt to achieve the core principles through careful control over growth,
testing, and documentation.

* When asked to add a new feature, we first look for a way to achieve the same
effect with existing functionality or smaller extensions that are more generally
applicable.

* Swish includes a suite of manual tests and automated tests that are run on each
pull request and each push to the dev branch. When a contribution changes code,
be sure to add or update the automated tests.

* A feature is incomplete until documented. Writing documentation often
exposes unnecessary complexity in the design and bugs in the implementation,
particularly in corner cases. New features should be documented in the Swish
[design document](https://becls.github.io/swish/swish.pdf).


Consistent with these principles, we naturally want Swish to
evolve in various useful ways to, among other things:

* increase reliability and efficiency
* increase utility
* improve user friendliness
* run on new platforms

Please keep in mind the following guidance when preparing contributions:

* Include appropriate tests and documentation with all code changes.

* Follow the coding structure (including indentation) of the existing
code base. This implies that contributors should study the existing code
before contributing.

* Spend the time required to make the code as clean, clear, and
efficient as possible. All other things equal, shorter code is
preferable to longer code.

* Describe changes in the [ChangeLog](ChangeLog.md) and in the git commit
messages and GitHub pull request logs. The revision-control
system might change over time, but the ChangeLog should endure.

* Some contributions may be more appropriately published as projects
of their own. If you are contributing a significant extension built
using Swish, consider whether your contribution is such an
independent project.

* Intellectual Property Policy
* All contributions to this project shall be made under the
[MIT License](LICENSE).
* By submitting a contribution, a Contributor certifies that
the Contributor is the sole creator of the contribution and/or
has the right under all applicable intellectual property laws
to provide the contribution to the Project under the terms of
the MIT License.
6 changes: 6 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Change Log

## 2020-10-01 Version 2.0.0 (Stable)

Release numbering skipped 1.x to avoid confusion with internal project.

5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ I/O.
Although Swish can be run in threaded Chez Scheme for convenience, it
is not thread safe and should be used from the main thread only.

# Versioning

Swish follows the [semantic versioning](http://semver.org/)
scheme, starting with 2.0.0 to avoid confusion with internal projects.

# Notes

1. install the prerequisites (see Build System Requirements)
Expand Down
4 changes: 4 additions & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@ swish :=\
swish/event-mgr-events.pdf\
swish/http-tree.pdf\
swish/intro-sup-tree.pdf\
../src/swish/swish-version.include\

swish.pdf: $(swish)

../src/swish/swish-version.include: ../src/swish/swish.h
make -C ../src/swish swish-version.include

.PHONY: clean
clean:
rm -f $(pdf) *.aux *.bbl *.blg *.lof *.log *.lot *.out *.idx *.ind *.ilg *.toc *.thm swish/*.aux font.conf
Expand Down
3 changes: 2 additions & 1 deletion doc/swish.tex
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
\makeindex[intoc,options=-q]

\begin{document}
\begin{sagianbook}{The Swish Concurrency Engine}{Bob Burger,
\begin{sagianbook}{The Swish Concurrency Engine\\
Version \input{../src/swish/swish-version.include}}{Bob Burger,
editor}{\copyright\ 2018-20 Beckman Coulter, Inc.
Licensed under the \href{https://opensource.org/licenses/MIT}{MIT License}.}

Expand Down
25 changes: 13 additions & 12 deletions doc/swish/app.tex
Original file line number Diff line number Diff line change
Expand Up @@ -82,21 +82,24 @@
To provide arguments to the Swish executable before the script filename, add
the \sopt{S} option to \code{env} and add the desired arguments after
\code{swish}.
Here the \lopt{} option tells Swish to start a REPL after loading the script.
\codebegin
Here the \code{-q} option suppresses the startup message and sets the prompt to
the empty string, and the \lopt{} option tells Swish to start a REPL after
loading the script.
\codebegin\fixtilde
$ cat howdy
#!/usr/bin/env -S swish \lopt{}
#!/usr/bin/env -S swish -q \lopt{}
(printf "Howdy, Folks!{\textbackslash}n")
(pretty-print (command-line-arguments))
(printf "prompt: ~s{\textbackslash}n" (waiter-prompt-string))
(printf "command-line: ~s{\textbackslash}n" (command-line-arguments))
$ chmod +x howdy
$ ./howdy
Swish Version 0.0.0
Howdy, Folks!
("--" "./howdy")
> (+ 2 3)
prompt: ""
command-line: ("-q" "--" "./howdy")
(waiter-prompt-string "yes?")
yes? (+ 2 3)
5
> (exit)
yes? (exit)
\codeend
% to show boot search while loading script:
Expand Down Expand Up @@ -596,10 +599,9 @@ \subsection{Foreign Interface}
by the fact that Chez Scheme invokes a library lazily as soon as
one of its exports may be referenced.
To see how these procedures are decoupled, consider the following REPL
To see how these procedures are decoupled, consider the following Swish REPL
transcript on a 64-bit Linux machine:
\codebegin
Swish Version 0.0.0
> (provide-shared-object 'libc "/lib64/libc.so.6")
> (foreign-entry? "fork")
#f
Expand All @@ -617,7 +619,6 @@ \subsection{Foreign Interface}
because we explicitly wrote the value of \code{app:config} to the location
specified by \code{app:config-filename} before exiting the original REPL.
\codebegin
Swish Version 0.0.0
> (foreign-entry? "fork")
#f
> (require-shared-object "libc")
Expand Down
5 changes: 3 additions & 2 deletions src/swish/.gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/Makefile
/Mf-config
/chezscheme.revision
/git.revision
/chezscheme-revision.include
/io-constants
/io-constants.exe
/io-constants.ilk
Expand Down Expand Up @@ -30,6 +29,8 @@
/sqlite.obj
/sqlite3.o
/sqlite3.obj
/swish-revision.include
/swish-version.include
/swish_kernel.o
/test-request.dll
/test-request.dylib
Expand Down
17 changes: 11 additions & 6 deletions src/swish/Mf-base
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.PHONY: all build-dirs clean platform-clean ready reminders submodules

SETUP := Makefile submodules build-dirs git.revision chezscheme.revision
SETUP := Makefile submodules build-dirs \
chezscheme-revision.include swish-revision.include swish-version.include
CORE := ../../${BUILD}/bin/swish${EXESUFFIX} ../../${BUILD}/bin/swish.boot ../../${BUILD}/bin/swish.library
AUXLIB := ../../${BUILD}/lib/swish/mat.so ../../${BUILD}/lib/swish/profile.so ../../${BUILD}/lib/swish/testing.so ../../${BUILD}/lib/swish/internal-testing.so

Expand All @@ -22,17 +23,20 @@ build-dirs:

all: ready ${CORE} ${AUXLIB} ${REMINDERS}

%.revision: %.tmp-revision
%.include: %.tmp-include
@if cmp --quiet "$@" "$<"; then \
rm "$<"; \
else \
mv "$<" "$@"; touch software-info.ss; echo "$@ changed"; \
fi

git.tmp-revision:
swish-revision.tmp-include:
@git describe --always --match none --abbrev=40 --dirty > "$@"

chezscheme.tmp-revision:
swish-version.tmp-include: swish.h
@sed -n 's/^#define SWISH_VERSION "\([0-9a-z."]*\)"/\1/p' swish.h > "$@"

chezscheme-revision.tmp-include:
@if [ ! -f "${SCHEME_REVISION_PATH}/revision" ]; then \
echo '<unknown>' > "$@"; \
else \
Expand Down Expand Up @@ -81,8 +85,9 @@ clean: platform-clean
rm -f ../../${BUILD}/lib/swish/*.wpo
rm -f ${SwishLibs}
rm -f ${SHLIBTEST}
rm -f chezscheme.revision
rm -f git.revision
rm -f chezscheme-revision.include
rm -f swish-revision.include
rm -f swish-version.include
rm -f io-constants.ss io-constants${EXESUFFIX}
rm -f ../*.ss.html ../mat-report.html ../server-profile.html
rm -f *.mo *.ms.html *.ss.html
Expand Down
17 changes: 5 additions & 12 deletions src/swish/software-info.ss
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,8 @@
#'(not-found filename))))))]))

(software-product-name 'swish "Swish")
(software-version 'swish "0.0.0")
(software-revision 'swish
(include-line "swish/git.revision"
(lambda (fn)
(warningf 'software-info.ss "file ~s not found at compile time" fn)
#f)))
(software-version 'swish (include-line "swish/swish-version.include"))
(software-revision 'swish (include-line "swish/swish-revision.include"))

(software-product-name 'chezscheme "Chez Scheme")
(software-version 'chezscheme
Expand All @@ -66,10 +62,7 @@
(format "~{~a~^.~}" (call-with-values scheme-version-number list)))])
scheme-version))
(software-revision 'chezscheme
(include-line "swish/chezscheme.revision"
(lambda (fn)
(warningf 'software-info.ss "file ~s not found at compile time" fn)
#f)))
(include-line "swish/chezscheme-revision.include"))
(json:set! info '(chezscheme machine-type) (symbol->string (machine-type)))
)

Expand All @@ -78,8 +71,8 @@
(import (swish mat) (swish software-info))

(mat software-revision ()
(define swish-hash (include-line "swish/git.revision"))
(define chezscheme-hash (include-line "swish/chezscheme.revision"))
(define swish-hash (include-line "swish/swish-revision.include"))
(define chezscheme-hash (include-line "swish/chezscheme-revision.include"))
(define (symbol<? a b) (string<? (symbol->string a) (symbol->string b)))
(match-let*
([#f (software-revision 'xyz)]
Expand Down
2 changes: 1 addition & 1 deletion src/swish/swish.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

#define SWISH_VERSION "0.0.0"
#define SWISH_VERSION "2.0.0"

#ifdef _WIN32
#define WINVER 0x0601 // Windows 7
Expand Down

0 comments on commit 406094e

Please sign in to comment.