Skip to content
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
43 changes: 42 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,42 @@
*.wave linguist-language=Wave
# Repository text is LF regardless of each contributor's core.autocrlf.
* text=auto eol=lf
*.rs text eol=lf
*.py text eol=lf
meson.build text eol=lf
meson.options text eol=lf
*.sh text eol=lf
*.ps1 text eol=lf
*.toml text eol=lf
*.json text eol=lf
*.yaml text eol=lf
*.yml text eol=lf
*.md text eol=lf
*.txt text eol=lf
*.ws text eol=lf
*.lock text eol=lf
*.wave text eol=lf linguist-language=Wave
*.cmd text eol=crlf
*.bat text eol=crlf
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.webp binary
*.ico binary
*.pdf binary
*.zip binary
*.gz binary
*.xz binary
*.bz2 binary
*.tar binary
*.7z binary
*.exe binary
*.dll binary
*.so binary
*.a binary
*.o binary
*.lib binary
*.wasm binary
*.woff binary
*.woff2 binary
*.bin binary
50 changes: 39 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# SPDX-License-Identifier: MPL-2.0
name: CI

on:
Expand All @@ -22,19 +26,27 @@ jobs:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- name: Verify DCO on contribution commits
if: github.event_name == 'pull_request'
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
GITHUB_TOKEN: ${{ github.token }}
run: python3 tools/check_dco.py --base "$BASE_SHA" --head "$HEAD_SHA"
- name: Install Rust toolchain
run: |
rustup toolchain install 1.96.0 --profile minimal --component rustfmt,clippy
rustup default 1.96.0
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with:
python-version: '3.11'
- run: python tools/repository_checks.py
- run: python tools/check_links.py --external
- run: python tools/dependency_audit.py
- run: cargo run --locked --example parser_fuzz -- 20261005 2000
- run: cargo fmt --check
- run: cargo clippy --workspace --locked --all-targets -- -D warnings
- name: Install build automation
run: python -m pip install -r tools/requirements-build.txt ninja==1.13.0
- run: meson setup build
- run: meson compile -C build quality
platform:
name: Platform / ${{ matrix.id }}
timeout-minutes: 180
Expand Down Expand Up @@ -94,34 +106,50 @@ jobs:
extension: tar.gz
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- name: Install Rust toolchain
if: matrix.executor == 'native'
run: |
rustup set default-host ${{ matrix.target }}
rustup toolchain install 1.96.0 --profile minimal --component rustfmt,clippy
rustup default 1.96.0
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
if: matrix.executor == 'native'
if: matrix.executor != 'vm'
with:
python-version: '3.11'
- name: Install build automation
if: matrix.executor == 'native'
run: python -m pip install -r tools/requirements-build.txt ninja==1.13.0
- name: Complete native acceptance
if: matrix.executor == 'native'
env:
GH_TOKEN: ${{ github.token }}
run: python tools/ci_platform.py ${{ matrix.id }}
run: |
meson setup build -Drelease_targets=${{ matrix.target }} -Dacceptance_platform=${{ matrix.id }}
meson compile -C build acceptance
- name: Register target execution
if: matrix.executor == 'qemu'
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130
with:
image: tonistiigi/binfmt@sha256:465d3fdd28d0f2b871ba4b4ec98bd183292e96167f00d9fd40bd249f8632d705
platforms: riscv64,loong64
- name: Install amd64 cross-build toolchain
if: matrix.executor == 'qemu'
run: |
rustup set default-host x86_64-unknown-linux-gnu
rustup toolchain install 1.96.0 --profile minimal
rustup default 1.96.0
rustup target add ${{ matrix.target }}
- name: Complete emulated acceptance
if: matrix.executor == 'qemu'
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
docker run --rm --platform '${{ matrix.oci_platform }}' \
-v "$PWD:/work" -w /work '${{ matrix.image }}' \
sh tools/ci_guest.sh '${{ matrix.id }}'
python3 -m pip install -r tools/requirements-build.txt ninja==1.13.0
meson setup build -Drelease_targets=${{ matrix.target }} -Dacceptance_platform=${{ matrix.id }}
meson compile -C build acceptance
- name: Complete FreeBSD acceptance
if: matrix.executor == 'vm'
uses: vmactions/freebsd-vm@c46abacb49f09938ca4e1702d15d836285d694cc # v1
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/dependency-audit.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# SPDX-License-Identifier: MPL-2.0
name: Dependency audit
on:
schedule:
Expand Down
52 changes: 35 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# SPDX-License-Identifier: MPL-2.0
name: Release

on:
Expand Down Expand Up @@ -78,7 +82,7 @@ jobs:

python tools/release_version.py "$RELEASE_VERSION"

cargo_version="$(python x.py --version | awk '{print $2}')"
cargo_version="$(python tools/build_config.py version)"
if [[ "$cargo_version" != "$RELEASE_VERSION" ]]; then
echo "error: Cargo.toml version is $cargo_version, input is $RELEASE_VERSION" >&2
exit 1
Expand All @@ -96,8 +100,12 @@ jobs:
- name: Audit locked release dependencies
run: python tools/dependency_audit.py

- name: Install build automation
run: python -m pip install -r tools/requirements-build.txt ninja==1.13.0
- name: Run release validation
run: python x.py check
run: |
meson setup build
meson compile -C build check

build:
name: Package / ${{ matrix.id }}
Expand Down Expand Up @@ -166,34 +174,49 @@ jobs:
with:
ref: ${{ needs.validate.outputs.commit }}
fetch-depth: 0
persist-credentials: false
- name: Install Rust toolchain
if: matrix.executor == 'native'
run: |
rustup set default-host ${{ matrix.target }}
rustup toolchain install 1.96.0 --profile minimal --component rustfmt,clippy
rustup default 1.96.0
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
if: matrix.executor == 'native'
if: matrix.executor != 'vm'
with:
python-version: '3.11'
- name: Install build automation
if: matrix.executor == 'native'
run: python -m pip install -r tools/requirements-build.txt ninja==1.13.0
- name: Complete native acceptance
if: matrix.executor == 'native'
env:
GH_TOKEN: ${{ github.token }}
run: python tools/ci_platform.py ${{ matrix.id }}
run: |
meson setup build -Drelease_targets=${{ matrix.target }} -Dacceptance_platform=${{ matrix.id }}
meson compile -C build acceptance
- name: Register target execution
if: matrix.executor == 'qemu'
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130
with:
image: tonistiigi/binfmt@sha256:465d3fdd28d0f2b871ba4b4ec98bd183292e96167f00d9fd40bd249f8632d705
platforms: riscv64,loong64
- name: Install amd64 cross-build toolchain
if: matrix.executor == 'qemu'
run: |
rustup set default-host x86_64-unknown-linux-gnu
rustup toolchain install 1.96.0 --profile minimal
rustup default 1.96.0
rustup target add ${{ matrix.target }}
- name: Complete emulated acceptance
if: matrix.executor == 'qemu'
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
docker run --rm --platform '${{ matrix.oci_platform }}' \
-v "$PWD:/work" -w /work '${{ matrix.image }}' \
sh tools/ci_guest.sh '${{ matrix.id }}'
python3 -m pip install -r tools/requirements-build.txt ninja==1.13.0
meson setup build -Drelease_targets=${{ matrix.target }} -Dacceptance_platform=${{ matrix.id }}
meson compile -C build acceptance
- name: Complete FreeBSD acceptance
if: matrix.executor == 'vm'
uses: vmactions/freebsd-vm@c46abacb49f09938ca4e1702d15d836285d694cc # v1
Expand Down Expand Up @@ -244,6 +267,9 @@ jobs:
with:
python-version: "3.11"

- name: Install build automation
run: python -m pip install -r tools/requirements-build.txt ninja==1.13.0

- name: Download release archives
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
Expand All @@ -256,16 +282,8 @@ jobs:
run: |
set -euo pipefail

python x.py checksum \
x86_64-unknown-linux-gnu \
aarch64-unknown-linux-gnu \
riscv64gc-unknown-linux-gnu \
loongarch64-unknown-linux-gnu \
x86_64-apple-darwin \
aarch64-apple-darwin \
x86_64-pc-windows-msvc \
aarch64-pc-windows-msvc \
x86_64-unknown-freebsd
meson setup build -Drelease_targets=x86_64-unknown-linux-gnu,aarch64-unknown-linux-gnu,riscv64gc-unknown-linux-gnu,loongarch64-unknown-linux-gnu,x86_64-apple-darwin,aarch64-apple-darwin,x86_64-pc-windows-msvc,aarch64-pc-windows-msvc,x86_64-unknown-freebsd
meson compile -C build checksum
cd dist
sha256sum --check SHA256SUMS

Expand Down
42 changes: 34 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ boundaries or a persistent file format.
You need:

- Rust 1.96.0 with its `rustfmt` and `clippy` components
- Python 3.11 or newer for `x.py` release tooling
- Python 3.11 or newer, Meson 1.8.5+ and Ninja for repository automation
- Git for dependency integration tests
- a compatible `wavec` in `PATH` for end-to-end build and run tests

`rust-toolchain.toml`, workspace `rust-version`, CI, and release builds select
1.96.0. This is the first supported toolchain and MSRV; changing it requires a
reviewed change to all four and native platform validation. `x.py` also selects
reviewed change to all four and native platform validation. Meson automation also selects
the pinned toolchain when a caller has set a different `RUSTUP_TOOLCHAIN`.

Set `VEX_WAVEC=/path/to/wavec` when testing a specific compiler binary.
Expand All @@ -47,10 +47,12 @@ cargo clippy --workspace --locked --all-targets -- -D warnings
cargo build --workspace --locked
```

The same baseline is available through the repository release tool:
The same baseline is available through Meson (including the Python tooling tests):

```sh
python3 x.py check
python3 -m pip install -r tools/requirements-build.txt ninja==1.13.0
meson setup build
meson compile -C build check
```

## Making a change
Expand All @@ -74,7 +76,7 @@ Add tests at the same level as the behavior being changed:
- parser and policy details belong in unit tests
- dependency graph and Git behavior belong in integration tests
- compiler invocation changes require dry-run schema and end-to-end smoke tests
- release-tool changes require `python3 -m unittest discover -s tests/xpy -v`
- release-tool changes require `python3 -m unittest discover -s tests/tooling -v`
- package changes require archive-content, checksum, and executable smoke tests
- platform changes must preserve native integration coverage where a hosted
runner exists; cross-build-only targets must be documented as experimental
Expand Down Expand Up @@ -106,9 +108,9 @@ The official Wave v0.2.0-pre-beta archive lacks the canonical package import
contract used by current Vex; do not treat its Hello World success as full
package compatibility.

Release packages are created with `python3 x.py build` followed by
`python3 x.py package`. Do not hand-edit `dist/` artifacts. The stricter
`python3 x.py release` command is reserved for a clean commit carrying the exact
Release packages are created with `meson compile -C build build-release` followed by
`meson compile -C build package`. Do not hand-edit `dist/` artifacts. The stricter
`meson compile -C build release` command is reserved for a clean commit carrying the exact
annotated `v<version>` tag. Maintainers must follow [RELEASING.md](RELEASING.md)
for multi-platform artifact aggregation and publication.

Expand Down Expand Up @@ -191,3 +193,27 @@ references and missing platform lanes. No dependency-update bot is enabled.
CI uses PR runs for feature branches and push runs for master. Superseded runs
with the same PR/branch identity are cancelled; release runs use their separate,
non-cancelling concurrency group.

## Source licensing and line endings

Own Rust source (including executable test fixtures), Python/shell/PowerShell and
Windows command scripts, TOML and YAML configuration carry the full MPL 2.0 source
notice plus `SPDX-License-Identifier: MPL-2.0` near the start, after any shebang.
Copyright attribution remains centralized in the existing project files.
Third-party/vendor files keep their original ownership. Generated Cargo locks,
CLI manuals/completions and notices are not relabeled. JSON and exact WSON/lock/
Wave syntax fixtures are exempt where comments would change meaning or diagnostics.

Text defaults to LF through `.gitattributes`; cmd/bat scripts use CRLF. Declared
binary formats are not normalized. This policy's normalization is grouped in the
repository-policy commit. `python3 tools/source_policy.py` checks both source
headers and worktree line endings without fixing files implicitly.

The existing read-only Quality CI checks every contribution commit in the PR's
exact `base..head` range. Old base history is not checked retroactively. Each
commit needs a real author-matching `Signed-off-by: Name <email>` trailer; bots
and ordinary merges are not exempt. Only GitHub-generated merges verified by
GitHub's API and signature metadata receive the merge exception. Synthetic PR
merge refs are not used as contribution heads. No DCO application or repository
write token is used. Repair your own missing certification with
`git commit --amend -s`, or rebase and sign off the affected contribution commits.
Loading
Loading