Skip to content

Commit

Permalink
Merge tag 'dev/M4' into series/M4
Browse files Browse the repository at this point in the history
M4
  • Loading branch information
Arya Irani committed Jul 14, 2022
2 parents 2224cbc + f861c81 commit c3df31d
Show file tree
Hide file tree
Showing 375 changed files with 23,246 additions and 8,621 deletions.
49 changes: 41 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ jobs:
# temporarily disable non-windows builds to speed up iteration time
- ubuntu-20.04
- macOS-11.0
- macOS-10.15
- windows-2019
steps:
- uses: actions/checkout@v2
Expand All @@ -39,8 +38,9 @@ jobs:
# purge one manually.

# Cache ~/.stack, keyed by the contents of 'stack.yaml'.
- uses: actions/cache@v2
name: cache ~/.stack
- uses: actions/cache@v3
name: cache ~/.stack (unix)
if: runner.os != 'Windows'
with:
path: ~/.stack
# Main cache key: commit hash. This should always result in a cache miss...
Expand All @@ -55,8 +55,26 @@ jobs:
stack-0_${{matrix.os}}-${{hashFiles('stack.yaml')}}
stack-0_${{matrix.os}}
# Cache ~/.stack, keyed by the contents of 'stack.yaml'.
- uses: actions/cache@v3
name: cache ~/.stack (Windows)
if: runner.os == 'Windows'
with:
path: "C:\\Users\\runneradmin\\AppData\\Local\\Programs\\stack"
# Main cache key: commit hash. This should always result in a cache miss...
# So when loading a cache we'll always fall back to the restore-keys,
# which should load the most recent cache via a prefix search on the most
# recent branch cache.
# Then it will save a new cache at this commit sha, which should be used by
# the next build on this branch.
key: stack-0_${{matrix.os}}-${{hashFiles('stack.yaml')}}-${{github.sha}}
# Fall-back to use the most recent cache for the stack.yaml, or failing that the OS
restore-keys: |
stack-0_${{matrix.os}}-${{hashFiles('stack.yaml')}}
stack-0_${{matrix.os}}
# Cache each local package's ~/.stack-work for fast incremental builds in CI.
- uses: actions/cache@v2
- uses: actions/cache@v3
name: cache .stack-work
with:
path: |
Expand Down Expand Up @@ -100,15 +118,30 @@ jobs:
# Build deps, then build local code. Splitting it into two steps just allows us to see how much time each step
# takes.
- name: build dependencies
run: stack --no-terminal build --fast --only-dependencies
shell: bash
# Run up to 5 times in a row before giving up.
# It's very unlikely that our build-dependencies step will fail on most builds,
# so if it fails its almost certainly due to a race condition on the Windows
# file-system API that stack runs into. Since any successful packages are
# cached within a single build, it should get further along on each re-start
# and should hopefully finish!
run: |
tries=1
if [[ ${{matrix.os}} = "windows-"* ]]; then
tries=5
fi
for (( i = 0; i < $tries; i++ )); do
stack --no-terminal build --fast --only-dependencies && break;
done
- name: build
run: stack --no-terminal build --fast --no-run-tests --test

# Run each test suite (tests and transcripts)
- name: unison-cli tests
run: stack --no-terminal build --fast --test unison-cli
- name: unison-parser-typechecker tests
run: stack --no-terminal exec tests
run: stack --no-terminal build --fast --test unison-parser-typechecker
- name: unison-util-relation tests
run: stack --no-terminal build --fast --test unison-util-relation
- name: transcripts
Expand All @@ -120,5 +153,5 @@ jobs:
git diff --cached --ignore-cr-at-eol --exit-code
- name: prettyprint-round-trip
run: stack --no-terminal exec unison transcript unison-src/transcripts-round-trip/main.md
- name: integration-tests
run: stack --no-terminal exec integration-tests
- name: cli-integration-tests
run: stack --no-terminal exec cli-integration-tests
39 changes: 34 additions & 5 deletions .github/workflows/pre-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ jobs:
- name: build
run: stack --no-terminal build --flag unison-parser-typechecker:optimized

- name: fetch latest codebase-ui and package with ucm
- name: fetch latest Unison Local UI and package with ucm
run: |
mkdir -p /tmp/ucm/ui
UCM=$(stack path | awk '/local-install-root/{print $2}')/bin/unison
cp $UCM /tmp/ucm/ucm
wget -O/tmp/unisonLocal.zip https://github.com/unisonweb/codebase-ui/releases/download/latest/unisonLocal.zip
wget -O/tmp/unisonLocal.zip https://github.com/unisonweb/unison-local-ui/releases/download/latest/unisonLocal.zip
unzip -d /tmp/ucm/ui /tmp/unisonLocal.zip
tar -c -z -f ucm-linux.tar.gz -C /tmp/ucm .
Expand Down Expand Up @@ -67,12 +67,12 @@ jobs:
- name: build
run: stack --no-terminal build --flag unison-parser-typechecker:optimized

- name: fetch latest codebase-ui and package with ucm
- name: fetch latest Unison Local UI and package with ucm
run: |
mkdir -p /tmp/ucm/ui
UCM=$(stack path | awk '/local-install-root/{print $2}')/bin/unison
cp $UCM /tmp/ucm/ucm
wget -O/tmp/unisonLocal.zip https://github.com/unisonweb/codebase-ui/releases/download/latest/unisonLocal.zip
wget -O/tmp/unisonLocal.zip https://github.com/unisonweb/unison-local-ui/releases/download/latest/unisonLocal.zip
unzip -d /tmp/ucm/ui /tmp/unisonLocal.zip
tar -c -z -f ucm-macos.tar.gz -C /tmp/ucm .
Expand All @@ -83,13 +83,40 @@ jobs:
name: build-macos
path: ucm-macos.tar.gz

build_windows:
name: "build_windows"
runs-on: windows-2019

steps:
- uses: actions/checkout@v2
- name: build
run: stack --no-terminal build --flag unison-parser-typechecker:optimized

- name: fetch latest codebase-ui and package with ucm
# Powershell
run: |
mkdir -p tmp\ui
mkdir -p release\ui
$UCM = stack exec -- where unison
cp $UCM .\release\ucm.exe
Invoke-WebRequest -Uri https://github.com/unisonweb/codebase-ui/releases/download/latest/unisonLocal.zip -OutFile tmp\unisonLocal.zip
Expand-Archive -Path tmp\unisonLocal.zip -DestinationPath release\ui
Compress-Archive -Path .\release\* -DestinationPath ucm-windows.zip
- name: Upload windows artifact
uses: actions/upload-artifact@v2
with:
if-no-files-found: error
name: build-windows
path: ucm-windows.zip

release:
name: "create_release"
runs-on: "ubuntu-latest"
needs:
- build_linux
- build_macos
- build_windows

steps:
- name: make download dir
Expand All @@ -108,4 +135,6 @@ jobs:
automatic_release_tag: "latest"
prerelease: true
title: "Development Build"
files: /tmp/ucm/**/*.tar.gz
files: |
/tmp/ucm/**/*.tar.gz
/tmp/ucm/**/*.zip
35 changes: 17 additions & 18 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: /tmp/ucm/**/*.tar.gz
files: |
/tmp/ucm/**/*.tar.gz
/tmp/ucm/**/*.zip
build_linux:

Expand All @@ -52,12 +54,12 @@ jobs:
- name: build
run: stack --no-terminal build --flag unison-parser-typechecker:optimized

- name: fetch latest codebase-ui and package with ucm
- name: fetch latest Unison Local UI and package with ucm
run: |
mkdir -p /tmp/ucm/ui
UCM=$(stack path | awk '/local-install-root/{print $2}')/bin/unison
cp $UCM /tmp/ucm/ucm
wget -O/tmp/unisonLocal.zip https://github.com/unisonweb/codebase-ui/releases/download/latest/unisonLocal.zip
wget -O/tmp/unisonLocal.zip https://github.com/unisonweb/unison-local-ui/releases/download/latest/unisonLocal.zip
unzip -d /tmp/ucm/ui /tmp/unisonLocal.zip
tar -c -z -f ucm-linux.tar.gz -C /tmp/ucm .
Expand Down Expand Up @@ -85,12 +87,12 @@ jobs:
- name: build
run: stack --no-terminal build --flag unison-parser-typechecker:optimized

- name: fetch latest codebase-ui and package with ucm
- name: fetch latest Unison Local UI and package with ucm
run: |
mkdir -p /tmp/ucm/ui
UCM=$(stack path | awk '/local-install-root/{print $2}')/bin/unison
cp $UCM /tmp/ucm/ucm
wget -O/tmp/unisonLocal.zip https://github.com/unisonweb/codebase-ui/releases/download/latest/unisonLocal.zip
wget -O/tmp/unisonLocal.zip https://github.com/unisonweb/unison-local-ui/releases/download/latest/unisonLocal.zip
unzip -d /tmp/ucm/ui /tmp/unisonLocal.zip
tar -c -z -f ucm-macos.tar.gz -C /tmp/ucm .
Expand All @@ -107,26 +109,23 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: install stack
run: |
curl -L https://github.com/commercialhaskell/stack/releases/download/v2.5.1/stack-2.5.1-osx-x86_64.tar.gz | tar -xz
echo "$HOME/stack-2.5.1-osx-x86_64/" >> $GITHUB_PATH
- name: build
run: stack --no-terminal build --flag unison-parser-typechecker:optimized

- name: fetch latest codebase-ui and package with ucm
- name: fetch latest Unison Local UI and package with ucm
# Powershell
run: |
mkdir -p /tmp/ucm/ui
UCM=$(stack path | awk '/local-install-root/{print $2}')/bin/unison
cp $UCM /tmp/ucm/ucm
wget -O/tmp/unisonLocal.zip https://github.com/unisonweb/codebase-ui/releases/download/latest/unisonLocal.zip
unzip -d /tmp/ucm/ui /tmp/unisonLocal.zip
tar -c -z -f ucm-windows.tar.gz -C /tmp/ucm .
mkdir -p tmp\ui
mkdir -p release\ui
$UCM = stack exec -- where unison
cp $UCM .\release\ucm.exe
Invoke-WebRequest -Uri https://github.com/unisonweb/unison-local-ui/releases/download/latest/unisonLocal.zip -OutFile tmp\unisonLocal.zip
Expand-Archive -Path tmp\unisonLocal.zip -DestinationPath release\ui
Compress-Archive -Path .\release\* -DestinationPath ucm-windows.zip
- name: Upload windows artifact
uses: actions/upload-artifact@v2
with:
if-no-files-found: error
name: build-windows
path: ucm-windows.tar.gz
path: ucm-windows.zip
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ scratch.u

# Stack
.stack-work
stack.yaml.lock

# Cabal
dist-newstyle
Expand Down
1 change: 0 additions & 1 deletion .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ pull_request_rules:
- status-success=ubuntu-20.04
# - status-success=ubuntu-18.04
- status-success=macOS-11.0
- status-success=macOS-10.15
- status-success=windows-2019
- label=ready-to-merge
- "#approved-reviews-by>=1"
Expand Down
17 changes: 10 additions & 7 deletions CONTRIBUTORS.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ All contributions to Unison are licensed in the same way: the MIT license. See t

### Contributors

The format for this list: name, GitHub handle, and then optional blurb about what areas of Unison you've worked on.
The format for this list: name, GitHub handle

* Paul Chiusano (@pchiusano) - I've worked on just about all aspects of Unison: overall design, typechecker, runtime, parser...
* Arya Irani (@aryairani) - Ditto
* Rúnar Bjarnason (@runarorama) - Typechecker, runtime, parser, code serialization
* Chris Gibbs (@atacratic) - Pretty-printer
* Paul Chiusano (@pchiusano)
* Arya Irani (@aryairani)
* Rúnar Bjarnason (@runarorama)
* Chris Gibbs (@atacratic)
* Noah Haasis (@noahhaasis)
* Francis De Brabandere (@francisdb)
* Matt Dziuban (@mrdziuban)
Expand Down Expand Up @@ -45,8 +45,8 @@ The format for this list: name, GitHub handle, and then optional blurb about wha
* Cody Allen (@ceedubs)
* Ludvig Sundström (@lsund)
* Mohamed Elsharnouby (@sharno)
* Jared Forsyth (@jaredly) - Documentation generation
* Hakim Cassimally (@osfameron) - vim support
* Jared Forsyth (@jaredly)
* Hakim Cassimally (@osfameron)
* Will Badart (@wbadart)
* Sam Roberts (@samgqroberts)
* Nigel Farrelly (@nini-faroux)
Expand All @@ -67,3 +67,6 @@ The format for this list: name, GitHub handle, and then optional blurb about wha
* Nicole Prindle (@nprindle)
* Harald Gliebe (@hagl)
* Phil de Joux (@philderbeast)
* Travis Staton (@tstat)
* Dan Freeman (@dfreeman)
* Emil Hotkowski (@emilhotkowski)
24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,28 @@ The Unison language

[![Build Status](https://travis-ci.org/unisonweb/unison.svg?branch=master)](https://travis-ci.org/unisonweb/unison)

[Unison](https://unisonweb.org) is a new programming language, currently under active development. It's a modern, statically-typed purely functional language, similar to Haskell, but with the ability to describe entire distributed systems with a single program. Here's an example of a distributed map-reduce implementation:
[Unison](https://unisonweb.org) is a modern, statically-typed purely functional language with the ability to describe entire distributed systems using a single program. Here's an example of a distributed map-reduce implementation:

```Haskell
-- comments start with `--`
mapReduce loc fn ifEmpty reduce data = match split data with
Empty -> ifEmpty
One a -> fn a
Two left right ->
fl = at loc '(mapReduce loc fn ifEmpty reduce !left)
fr = at loc '(mapReduce loc fn ifEmpty reduce !right)
reduce !fl !fr
fl = forkAt loc '(mapReduce loc fn ifEmpty reduce !left)
fr = forkAt loc '(mapReduce loc fn ifEmpty reduce !right)
reduce (await fl) (await fr)
```

This function can be either simulated locally (possibly with faults injected for testing purposes), or run atop a distributed pool of compute.
This function can be either simulated locally (possibly with faults injected for testing purposes), or run atop a distributed pool of compute. See [this article](https://www.unison-lang.org/articles/distributed-datasets/) for more in-depth coverage of how to build distributed computing libraries like this.

If you'd like to learn more about the project, [this Strange Loop talk is a good introduction](https://www.youtube.com/watch?v=gCWtkvDQ2ZI). You can also follow along with [project website](https://unisonweb.org) or you can also say hello or lurk [in the Slack chat](https://unisonweb.org/slack).
Other resources:

We are currently alpha testing Unison. If you'd like to participate in alpha testing, you can go to [the docs site](https://www.unisonweb.org/docs) to get started.
* [Learn about the big idea behind Unison](https://www.unison-lang.org/learn/the-big-idea/)
* Check out [the project website](https://unison-lang.org)
* Say hello or lurk [in the Slack chat](https://unison-lang.org/slack)
* Explore [the Unison ecosystem](https://share.unison-lang.org/)
* [Learn Unison](https://www.unison-lang.org/learn/)

Building using Stack
--------------------
Expand All @@ -33,18 +37,18 @@ The build uses [Stack](http://docs.haskellstack.org/). If you don't already have
$ git clone https://github.com/unisonweb/unison.git
$ cd unison
$ stack --version # we'll want to know this version if you run into trouble
$ stack build && stack exec tests && stack exec unison
$ stack build --fast --test && stack exec unison
```

To run a local codebase-ui while building from source, you can use the `/dev-ui-install.sh` script. It will download the latest release of the codebase-ui and put it in the expected location for the unison executable created by `stack build`. When you start unison, you'll see a url where the codebase-ui is running.
To run the Unison Local UI while building from source, you can use the `/dev-ui-install.sh` script. It will download the latest release of [unison-local-ui](https://github.com/unisonweb/unison-local-ui) and put it in the expected location for the unison executable created by `stack build`. When you start unison, you'll see a url where Unison Local UI is running.

See [`development.markdown`](development.markdown) for a list of build commands you'll likely use during development.

Codebase Server
---------------

When `ucm` starts it starts a Codebase web server that is used by the
[Codebase UI](https://github.com/unisonweb/codebase-ui). It selects a random
[Unison Local UI](https://github.com/unisonweb/unison-local-ui). It selects a random
port and a unique token that must be used when starting the UI to correctly
connect to the server.

Expand Down
Loading

0 comments on commit c3df31d

Please sign in to comment.