IgKh / katvan

A bare-bones editor for Typst files, with a bias for Right-to-Left editing
GNU General Public License v3.0
35 stars 3 forks source link

katvan 0.7.0 fails to build on (AUR) arch package #7

Closed theatischbein closed 2 months ago

theatischbein commented 2 months ago

During the update I retrieve this error:

   Compiling typstdriver_rs v0.0.0 (/home/thea/.cache/yay/katvan/src/katvan-0.7.0/typstdriver/rust)
error[E0432]: unresolved import `std::hash::DefaultHasher`
  --> src/engine.rs:18:17
   |
18 | use std::hash::{DefaultHasher, Hash, Hasher};
   |                 ^^^^^^^^^^^^^ no `DefaultHasher` in `hash`
   |
   = help: consider importing this struct instead:
           std::collections::hash_map::DefaultHasher

warning: unused import: `Hasher`
  --> src/engine.rs:18:38
   |
18 | use std::hash::{DefaultHasher, Hash, Hasher};
   |                                      ^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

For more information about this error, try `rustc --explain E0432`.
warning: `typstdriver_rs` (lib) generated 1 warning
error: could not compile `typstdriver_rs` (lib) due to previous error; 1 warning emitted
make[2]: *** [typstdriver/CMakeFiles/_cargo-build_typstdriver_rs.dir/build.make:70: typstdriver/CMakeFiles/_cargo-build_typstdriver_rs] Error 101
make[1]: *** [CMakeFiles/Makefile2:159: typstdriver/CMakeFiles/_cargo-build_typstdriver_rs.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...
 -> error making: katvan-exit status 4
 -> Failed to install the following packages. Manual intervention is required:
katvan - exit status 4

My system is Arch with

❯ uname -a
Linux kis-krumplicska 6.10.7-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 29 Aug 2024 16:48:57 +0000 x86_64 GNU/Linux

I tried to install this arch package: https://aur.archlinux.org/packages/katvan

It seems that the import path of the DefaultHasher has changed.

IgKh commented 2 months ago

Hi,

The import path did change, but in the other direction :) std::hash::DefaultHasher is available since Rust 1.76 which is a good 6 versions old by now. You should update your Rust stable toolchain, if you manage it via rustup rather than by pacman updating is manual.

theatischbein commented 2 months ago

Ohhhh I see! Thanks you so much :)

theatischbein commented 2 months ago

Wouldn't it be helpful to add rust-version as package field to the Cargo.toml file ?

[package]
# ...
rust-version = "1.76"

https://github.com/IgKh/katvan/blob/master/typstdriver/rust/Cargo.toml

IgKh commented 2 months ago

Good idea, thank you for the suggestion!