diff options
author | har7an <99636919+har7an@users.noreply.github.com> | 2022-12-17 13:27:18 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-17 13:27:18 +0000 |
commit | d1f50150f6f7525f93ccb9ed94f75ce6bfb5c60b (patch) | |
tree | 4c5ebcf6016f134a21857dbcbbe195bee6664bf9 /CONTRIBUTING.md | |
parent | 6e93e8ffce24e28af4bd35bacb48424d9e1d7a26 (diff) |
WIP: Use `xtask` as build system (#2012)
* xtask: Implement a new build system
xtask is a cargo alias that is used to extend the cargo build system
with custom commands. For an introduction to xtask, see here:
https://github.com/matklad/cargo-xtask/
The idea is that instead of writing makefiles, xtask requires no
additional dependencies except `cargo` and `rustc`, which must be
available to build the project anyway.
This commit provides a basic implementation of the `build` and `test`
subcommands.
* xtask/deps: Add 'which'
* xtask/test: Handle error when cargo not found
* xtask/flags: Add more commands
to perform different useful tasks. Includes:
- clippy
- format
- "make" (composite)
- "install" (composite)
Also add more options to `build` to selectively compile plugins or leave
them out entirely.
* xtask/main: Return error when cargo not found
* xtask/build: Add more subtasks
- `wasm_opt_plugins` and
- `manpage`
that perform other build commands. Add thorough documentation on what
each of these does and also handle the new `build` cli flags
appropriately.
* xtask/clippy: Add job to run clippy
* xtask/format: Add job to run rustfmt
* xtask/pipeline: Add composite commands
that perform multiple atomic xtask commands sequentially in a pipeline
sort of fashion.
* xtask/deps: Pin dependencies
* xtask/main: Integrate new jobs
and add documentation.
* xtask: Implement 'dist'
which performs an 'install' and copies the resulting zellij binary along
with some other assets to a `target/dist` folder.
* cargo: Update xflags version
* xtask: Measure task time, update tty title
* xtask: Update various tasks
* xtask: wasm-opt plugins in release builds
automatically.
* xtask/build: Copy debug plugins to assets folder
* xtask: Add 'run' subcommand
* xtask: Add arbitrary args to test and run
* xtask: Rearrange CLI commands in help
* xtask: Add deprecation notice
* docs: Replace `cargo make` with `xtask`
* github: Use `xtask` in workflows.
* xtask: Add support for CI commands
* xtask: Streamline error handling
* github: Use new xtask commands in CI
* xtask: Add 'publish' job
* xtask/publish: Add retry when publish fails
* xtask: Apply rustfmt
* xtask: Refine 'make' deprecation warning
* xtask: add task to build manpage
* contributing: Fix e2e commands
* xtask/run: Add missing `--`
to pass all arguments following `xtask run` directly to the zellij
binary being run.
* xtask: Stay in invocation dir
and make all tasks that need it change to the project root dir
themselves.
* xtask/run: Add `--data-dir` flag
which will allow very quick iterations when not changing the plugins
between builds.
* xtask/ci: Install dependencies without asking
* utils: Allow including plugins from target folder
* utils/assets: Reduce asset map complexity
* utils/consts: Update asset map docs
* xtask: Fix plugin includes
* xtask/test: Build plugins first
because the zellij binary needs to include the plugins.
* xtask/test: Fix formatting
* xtask: Add notice on how to disable it
Diffstat (limited to 'CONTRIBUTING.md')
-rw-r--r-- | CONTRIBUTING.md | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0c79ec0f4..612dc4b25 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,8 +11,9 @@ Before contributing please read our [Code of Conduct](CODE_OF_CONDUCT.md) which all contributors are expected to adhere to. ## Building -To build Zellij, we're using cargo-make – you can install it by running `cargo -install --locked --force cargo-make`. + +To build Zellij, we're using cargo xtask. This is a standalone package shipped +inside the repository, so you don't have to install additional dependencies. To edit our manpage, the mandown crate (`cargo install --locked mandown`) is used and the work is done on a markdown file in docs/MANPAGE.md. @@ -21,25 +22,27 @@ Here are some of the commands currently supported by the build system: ```sh # Format code, build, then run tests and clippy -cargo make +cargo xtask # You can also perform these actions individually -cargo make format -cargo make build -cargo make test +cargo xtask format +cargo xtask build +cargo xtask test # Run Zellij (optionally with additional arguments) -cargo make run -cargo make run -l strider -# Run Clippy (potentially with additional options) -cargo make clippy -cargo make clippy -W clippy::pedantic +cargo xtask run +cargo xtask run -l strider +# Run Clippy +cargo xtask clippy # Install Zellij to some directory -cargo make install /path/of/zellij/binary +cargo xtask install /path/of/zellij/binary # Publish the zellij and zellij-tile crates -cargo make publish +cargo xtask publish # Update manpage -cargo make manpage +cargo xtask manpage ``` +You can see a list of all commands (with supported arguments) with `cargo xtask +--help`. For convenience, `xtask` may be shortened to `x`: `cargo x build` etc. + To run `install` or `publish`, you'll need the package `binaryen` in the version `wasm-opt --version` > 97, for it's command `wasm-opt`. @@ -78,8 +81,8 @@ To run these tests locally, you'll need to have either `docker` or `podman` and Once you do, in the repository root: 1. `docker-compose up -d` will start up the docker container -2. `cargo make build-e2e` will build the generic linux executable of Zellij in the target folder, which is shared with the container -3. `cargo make e2e-test` will run the tests +2. `cargo xtask ci e2e --build` will build the generic linux executable of Zellij in the target folder, which is shared with the container +3. `cargo xtask ci e2e --test` will run the tests To re-run the tests after you've changed something in the code base, be sure to repeat steps 2 and 3. |