uiua-lang / uiua

A stack-based array programming language
https://www.uiua.org
MIT License
1.62k stars 117 forks source link

refactor(flake): clean up the flake #567

Closed thecaralice closed 1 month ago

thecaralice commented 1 month ago
  1. Add a cargo feature named system which causes dependencies to use system versions of static libraries instead of compiling their own, which is particularly important to Nix (previously the Nix derivation would patch Cargo.toml to enable the corresponding libffi feature).
  2. Separate the package derivation from the flake itself.
  3. Properly clean source for the derivation, so changing files that are not used for building would not make Nix think everything needs to be rebuilt.
  4. Remove rust-overlay dependency. It is great, but unnecessary here, as Uiua does not need bleeding-edge toolchain versions or specific components and targets. It would make sense to use it if the website was built with Nix as well.
  5. Use flake-parts instead of flake-utils as it doesn't have design flaws flake-utils has and fits Nix better.
  6. Remove input overrides from crane as crane doesn't have any inputs anymore.
  7. Generally clean up Nix code, as there was some suspicious things like calling an ad hoc constructed function ((path: _type: ...) path type).
  8. Build dependencies separately from the main derivation to improve incremental compilation.

This also revealed a couple of suspicious things like the tests depending on the website favicon and one of the tests actually trying to write some file, so I decided to disable it when building with Nix (format::generate_format_cfg_docs).

kaikalii commented 1 month ago

I don't know nix. Can you please explain what this changes?

thecaralice commented 1 month ago

Sorry, forgot to write the description. Updated.