Commit Graph

30 Commits

Author SHA1 Message Date
Silas Schöffel df70df8062
build(flake): add pre-commit-hooks
This enforces formatting rules.
2024-05-08 21:58:17 +02:00
Benedikt Peetz 22b8af8e93 chore(treewide): Update the copyright headers 2024-05-08 19:23:11 +00:00
Silas Schöffel 0315de3ee4 chore(treewide): change license to GPL-3.0 or later
To archive this, the previous MIT-License and its mentions were removed, COPYING
was added, LICENSE.spdx and README were modified to show the correct
license, sils@sils.li was added to the project's
E-Mail adresses and ./scripts/renew_copyright_header.sh
was executed.
2024-05-08 19:23:11 +00:00
Benedikt Peetz 6a10974efb fix(flake.nix): Don't remove the `.tri` api spec file when building 2024-05-08 21:03:42 +02:00
Silas Schöffel 3ebd171e61
fix(flake): add buildinputs to devShell
This fixes a regression introduced in
cc13ec2867 which caused the devShell
to lack some dependencies required to build trinitrix
2024-05-06 15:51:41 +02:00
Benedikt Peetz 940d82561d style(treewide): Format and improve the headers
This commit represents one run of
`./scripts/renew_copyright_headers.sh`.
2024-05-04 21:06:17 +02:00
Benedikt Peetz a779fa250d fix(scripts/renew_copyright_header): Update to the new copyright text 2024-05-04 21:00:15 +02:00
Benedikt Peetz 6c80698589 chore(treewide): Add up-to-date license headers 2024-05-04 20:55:52 +02:00
Benedikt Peetz cc13ec2867 build(treewide): Update trinitrix/core to the modern standard 2024-05-04 20:40:02 +02:00
Benedikt Peetz ebc336faa3 test(valgrind): Add a script to test for memory leaks 2024-05-04 20:12:00 +02:00
Benedikt Peetz 6ef6bea61c chore(Cargo): Update to the new external crates
Note that this commit does not contain the needed code changes
2024-05-03 21:23:26 +02:00
Benedikt Peetz fcdfb4488b
chore(trixy, keymaps): Extract the libraries to their own repository 2023-12-23 21:58:19 +01:00
Benedikt Peetz 74efd3eda6
chore(flake): Remove `rust-analyzer` from the devshell
Things like language servers should be handled by the developer's
editor.
2023-12-16 11:47:51 +01:00
Benedikt Peetz 5713c90445
test(flake): Add the cargo test to the `nix flake check` tests 2023-12-16 11:47:21 +01:00
Benedikt Peetz 53862a0f65
build(flake): Switch rust version back to stable 2023-12-16 11:47:02 +01:00
Benedikt Peetz 37a0834aa0
build(flake): Use the minimal rust distribution for builds 2023-11-07 20:48:06 +01:00
Benedikt Peetz 196c392f59
build(flake): Switch to nixpkgs's wrapped mold linker
By now a wrapped version of mold exists, which thus works with the
NixOS libraries. This is obviously the same as my self-wrapped version,
but vendoring is just not important here.
2023-10-31 18:55:18 +01:00
Benedikt Peetz 66e3b362c3
build(flake): Remove language-servers from the devshell
These should always be provided by the editor, and not the devshell.
2023-10-31 18:50:46 +01:00
Benedikt Peetz 8413a30090
build(flake): Remove unused crane overrides 2023-10-31 18:50:05 +01:00
Benedikt Peetz df07c3fc24
build(flake): Replace self-packaged cranelift with rustup's
Motivation
==========
The self-packed one sort-of worked, but was rather flaky, while the one
from rustup obviously works, as it's an officially distributed part.

Running it
==========
Instead of the `cargo clif [build, etc.]` you now need to run (on nightly):
```
RUSTFLAGS="-Zcodegen-backend=cranelift" cargo build
```

Performance
===========
On my system I noticed, that a debug build takes around 20 sec *more*
with cranelift, compared to the default LLVM backend.

One possible hypothesis, for that could be, that cranelift does
not link via `mold` but instead still uses GNU's `gold`.

On the other hand, the performance decrease could also be caused
by the fact, that it's an early preview and some optimizations are
still lacking.
2023-10-31 18:47:01 +01:00
Benedikt Peetz d7b93178e8
build(treewide): Move back to rust stable 2023-10-14 12:42:36 +02:00
Benedikt Peetz eb63cb6247
build(flake): Wrap mold so that it works with the nix supplied libraries 2023-09-03 22:11:41 +02:00
Benedikt Peetz 3d417d7e15
Build(flake): Remove dead code from cranelift build process 2023-07-26 21:53:44 +02:00
Benedikt Peetz a3a26df65f
Build(flake): Add rustc cranelift codegen to development shell
This is executed by running `cargo clif` instead of `cargo`.
It _should_ result in decreased compile times (around 30%).
2023-07-26 21:42:16 +02:00
Benedikt Peetz b4d9bea75a
Build(Cargo): Add mold as default linker in both profiles
I measured the linking times by running `cargo rustc --bin trinitrix --
-Z time-passes`, which resulted in following data:

`ld`:
37.794s to link
`mold`:
21.389s to link

The downside for now is, that this requires to have mold installed to
build trinitrix (The nix flake based direnv already has it) and that
mold only works on linux.
2023-07-26 21:38:38 +02:00
Benedikt Peetz 27e3ff228c
Build(flake): Make it easier to switch to nightly 2023-07-20 21:39:38 +02:00
Benedikt Peetz c3a2b2d566
Fix(lua): Switch to mlua library, as it's better than rlua 2023-07-17 07:27:51 +02:00
Benedikt Peetz 327450c64b
Feat(command_interface): Add basic lua support 2023-07-12 21:48:51 +02:00
Benedikt Peetz 74be1c2506
Build(flake): Also add the openssl dependencies to the devShell 2023-07-09 07:53:15 +02:00
Benedikt Peetz f768d214da
Build(flake): Initialize the flake
A nix flake is a reproducible way to describe the building process
to [nix](1).
See [the nix download page](1), on how to install nix. Afterwards
running `nix build` in the repository will result in a successful build.

Flakes and nix-commands are still experimental so they must be enabled
as described in [the corresponding wiki entry](2)

[1]: https://nixos.org/download.html#nix
[2]: https://nixos.wiki/wiki/Flakes#Enable_flakes.
2023-07-09 07:28:19 +02:00