Skip to content

Commit

Permalink
Re-merge trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisPenner committed Aug 30, 2024
2 parents 62964ca + b6e12d0 commit c984091
Show file tree
Hide file tree
Showing 999 changed files with 33,563 additions and 24,353 deletions.
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Multi-editor style config: https://EditorConfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
insert_final_newline = true
max_line_length = 120
trim_trailing_whitespace = true

[*.u]
max_line_length = off
48 changes: 48 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe and demonstrate the bug**
Please attach a [ucm transcript](https://www.unison-lang.org/docs/tooling/transcripts/) if possible, calling out the unexpected behavior in the text. e.g.

Input:
````
```unison:hide
a = 1
```
Here I typo the next command and `ucm` silently does nothing. I would have expected an error message:
```ucm
.> add b
```
````

Output:
````
```unison
a = 1
```
Here I typo the next command and `ucm` silently does nothing, I would have expected an error message:
```ucm
.> add b
```
````

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Environment (please complete the following information):**
- `ucm --version` [e.g. "0.5.21", or "1cb2437 (built on 2024-06-03)"]
- OS/Architecture: [e.g. "macOS 14.5, Intel"]
- Browser, if applicable: [e.g. "chrome 125.0.6422.142"] (Version numbers are typically found the about menu option)

**Additional context**
Add any other context about the problem here.
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/error-message-suggestion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Error message suggestion
about: Suggest improved wording or design for an error message
title: ''
labels: error-message
assignees: ''

---

**What's the message you're seeing?**
Please paste from your terminal or paste a screenshot, e.g:
```
project/alice> merge /bob
On project/alice, bar and foo are not aliases, but they used
to be.
```

**What would a better version look like?**
```
Sorry, I wasn't able to perform the merge:
On the merge ancestor, bar and foo were aliases for the same definition; but on project/alice the names have different definitions currently. I'd need just a single new definition to use in their dependents when I merge.
Please fix up project/alice to resolve this. For example,
* update the definitions to be the same again, so that there's nothing for me to decide.
* rename or delete one of the definitions; I'll use the remaining name when propagating updates,
and you can change the name back after the merge.
```

Environment (please complete the following information):

* `ucm --version` [e.g. "0.5.21", or "1cb2437 (built on 2024-06-03)"]
* OS/Architecture: [e.g. "macOS 14.5, Intel"]
* Browser, if applicable: [e.g. "chrome 125.0.6422.142"] (Version numbers are typically found the about menu option)
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: feature request
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
4 changes: 4 additions & 0 deletions .github/workflows/bundle-ucm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ jobs:

- name: install stack
uses: unisonweb/actions/stack/install@main
with:
stack-version: 2.15.5

- name: build
run: |
Expand Down Expand Up @@ -234,6 +236,7 @@ jobs:
content: |
#!/bin/bash
unison_root="$(dirname "$(readlink -f "$0")")"
export UCM_WEB_UI="${unison_root}/ui"
"${unison_root}/unison/unison" --runtime-path "${unison_root}/runtime/bin/unison-runtime" "$@"
- name: create startup script (Windows)
if: runner.os == 'Windows'
Expand All @@ -243,6 +246,7 @@ jobs:
file: ucm.cmd
content: |
@echo off
SET UCM_WEB_UI=%~dp0ui
"%~dp0unison\unison.exe" --runtime-path "%~dp0runtime\unison-runtime.exe" %*
- name: package everything together
run: |
Expand Down
17 changes: 1 addition & 16 deletions .github/workflows/ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,8 @@ At a high level, the CI process is:
3. On all platforms, build the `unison-runtime` Racket program save the resulting binaries as build artifacts.

### `env` vars at the top of `CI.yaml`:
Some version numbers that are used during CI:
- `ormolu_version: "0.5.0.1"`
- `racket_version: "8.7"`
- `jit_version: "@unison/internal/releases/0.0.17"`

Some cached directories:
- `ucm_local_bin` a temp path for caching a built `ucm`
- `jit_src_scheme` a temp path for caching generated jit sources
- `unison-jit-dist`
- `base-codebase` a codebase path for caching a codebase generated by `unison-src/builtin-tests/base.md`
- `unison_src_test_results` a temp path for caching the result of passing tests that depend on `unison-src/`, which includes:
- `round-trip-tests`
- `transcripts`
- `unison-src/builtin-tests/interpreter-tests.md`

`jit_generator_os: ubuntu-20.04`
- afaik, the jit sources are generated in a platform-independent way, so we just choose one platform to generate them on.
These variables pin some dependency versions, set up some directories to cache, etc. Please see the `env` section in [ci.yaml](./ci.yaml) for specifics.

### Cached directories:

Expand Down
43 changes: 27 additions & 16 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,41 @@ defaults:
shell: bash

on:
# Build on every pull request (and new PR commit)
# Run on the post-merge result of every PR commit
pull_request:
# Build on new pushes to trunk (E.g. Merge commits)
# Without the branch filter, each commit on a branch with a PR is triggered twice.
# See: https://github.community/t/how-to-trigger-an-action-on-push-or-pull-request-but-not-both/16662
# Build on the pre-merge result of every branch commit
push:
branches:
- trunk
tags:
- release/*
workflow_dispatch:

env:
ormolu_version: 0.5.2.0
## Some version numbers that are used during CI
ormolu_version: 0.7.2.0
jit_version: "@unison/internal/releases/0.0.18"
runtime_tests_version: "@unison/runtime-tests/main"

## Some cached directories
# a temp path for caching a built `ucm`
ucm_local_bin: ucm-local-bin
jit_version: "@unison/internal/releases/0.0.17"
# a temp path for caching generated jit sources
jit_src_scheme: unison-jit-src/scheme-libs/racket
jit_dist: unison-jit-dist
jit_generator_os: ubuntu-20.04
runtime_tests_version: "@unison/runtime-tests/main"
# a codebase path for caching a codebase generated by `unison-src/builtin-tests/interpreter-tests.md`
runtime_tests_codebase: "~/.cache/unisonlanguage/runtime-tests.unison"

# locations of some files that will indicate whether we need to re-run certain steps
transcript_test_results: transcript-test-results
interpreter_test_results: interpreter-test-results

## afaik, the jit sources are generated in a platform-independent way, so we choose one platform to generate them on.
jit_generator_os: ubuntu-20.04

jobs:
ormolu:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v41
uses: tj-actions/changed-files@v44
with:
# globs copied from default settings for run-ormolu
files: |
Expand Down Expand Up @@ -108,6 +109,8 @@ jobs:
- name: install stack
if: steps.cache-ucm-binaries.outputs.cache-hit != 'true'
uses: unisonweb/actions/stack/install@main
with:
stack-version: 2.15.5

# Build deps, then build local code. Splitting it into two steps just allows us to see how much time each step
# takes.
Expand Down Expand Up @@ -270,6 +273,14 @@ jobs:
${{env.transcripts}}
# Fail if any transcripts cause git diffs.
git diff --ignore-cr-at-eol --exit-code unison-src/transcripts
- name: docs.to-html
if: steps.cache-transcript-test-results.outputs.cache-hit != 'true'
run: |
${{env.ucm}} transcript unison-src/transcripts-manual/docs.to-html.md
# Fail if the output or generated docs differ.
git diff --ignore-cr-at-eol --exit-code \
unison-src/transcripts-manual/docs.to-html.output.md \
unison-src/transcripts-manual/docs.to-html
- name: mark transcripts as passing
if: steps.cache-transcript-test-results.outputs.cache-hit != 'true'
run: |
Expand Down Expand Up @@ -377,7 +388,7 @@ jobs:
write-mode: overwrite
contents: |
```ucm
.> project.create-empty jit-setup
scratch/main> project.create-empty jit-setup
jit-setup/main> lib.install ${{ env.jit_version }}
```
```unison
Expand Down Expand Up @@ -417,7 +428,7 @@ jobs:
build-jit-binary:
name: build jit binary
needs: generate-jit-source
uses: ./.github/workflows/ci-build-jit-binary.yaml
uses: ./.github/workflows/ci-build-jit-binary.yaml

test-jit:
name: test jit
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/haddocks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:

- name: install stack
uses: unisonweb/actions/stack/install@main
with:
stack-version: 2.15.5

- name: build with haddocks
working-directory: unison
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/nix-dev-cache.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,28 @@ jobs:
os:
- ubuntu-20.04
- macOS-12
- macOS-14
steps:
- uses: actions/checkout@v4
- name: mount Nix store on larger partition
# on the Linux runner `/` doesn't have enough space, but there's a `/mnt` which does.
if: runner.os == 'Linux'
run: |
sudo mkdir /nix /mnt/nix
sudo mount --bind /mnt/nix /nix
- uses: cachix/install-nix-action@v27
if: runner.os == 'Linux'
with:
extra_nix_config: |
extra-trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
extra-substituters = https://cache.iog.io
- uses: cachix/install-nix-action@v27
if: runner.os != 'Linux'
- uses: cachix/cachix-action@v15
with:
name: unison
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: build all packages and development shells
run: nix -L build --accept-flake-config --no-link --keep-going '.#build-tools'
run: nix -L build --accept-flake-config --no-link --keep-going '.#all'
- name: print disk free status
run: df -h
4 changes: 2 additions & 2 deletions .github/workflows/ormolu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: create pull request with formatting changes
uses: peter-evans/create-pull-request@v6
with:
commit_message: automatically run ormolu
commit-message: automatically run ormolu
branch: autoformat/${{github.ref_name}}
# branch_suffix: random
branch-suffix: short-commit-hash
title: format `${{github.ref_name}}` with ormolu ${{env.ormolu_version}}
5 changes: 5 additions & 0 deletions .github/workflows/update-transcripts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:

- name: install stack
uses: unisonweb/actions/stack/install@main
with:
stack-version: 2.15.5

# One of the transcripts fails if the user's git name hasn't been set.
- name: set git user info
Expand All @@ -36,6 +38,9 @@ jobs:
stack exec unison transcript unison-src/transcripts-manual/rewrites.md
- name: transcripts
run: stack exec transcripts
- name: docs.to-html
run: |
stack exec unison transcript unison-src/transcripts-manual/docs.to-html.md
- name: save transcript changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
Expand Down
14 changes: 11 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
# Unison
.unison*
test-output
transcript-*
scratch.u
unisonLocal.zip
*.uc
# Ignore all scratch files...
*.u
# Except those in unison-src
!unison-src/**/*.u
# And integration tests
!unison-cli-integration/integration-tests/IntegrationTests/**/*.u

# Auto-generated
jit-tests.md
Expand All @@ -19,10 +24,13 @@ dist-newstyle
# GHC
*.hie
*.prof
*.prof.html
/.direnv/
/.envrc

# Mac developers
**/.DS_Store

/libb2.dylib

# Nix
result
10 changes: 7 additions & 3 deletions .mergify.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
pull_request_rules:
- name: automatic merge on CI success and review
conditions:
- check-success=check-contributor
- check-success=build ucm (ubuntu-20.04)
- check-success=build ucm (macOS-12)
- check-success=build ucm (windows-2019)
Expand All @@ -11,9 +12,12 @@ pull_request_rules:
- check-success=run interpreter tests (macOS-12)
# - check-success=run interpreter tests (windows-2019)
- check-success=generate jit source
- check-success=build jit binary (ubuntu-20.04)
- check-success=build jit binary (macOS-12)
- check-success=build jit binary (windows-2019)
- check-success=build jit binary / build jit binary (ubuntu-20.04)
- check-success=build jit binary / build jit binary (macOS-12)
- check-success=build jit binary / build jit binary (windows-2019)
- check-success=test jit / test jit (ubuntu-20.04)
- check-success=test jit / test jit (macOS-12)
# - check-success=test jit / test jit (windows-2019)
- label=ready-to-merge
- "#approved-reviews-by>=1"
actions:
Expand Down
Loading

0 comments on commit c984091

Please sign in to comment.