ezrosent / frawk

an efficient awk-like language
Apache License 2.0
1.24k stars 34 forks source link

Windows supported? #108

Closed jgranduel closed 5 months ago

jgranduel commented 5 months ago

Hi,

I thought that frawk was not supported on Windows, but I came about this #87 issue where I saw that using cargo build --no-default-features does (or might) compile. I don't know anything about jemalloc, so it was just a test. I don't know if it was relevant to try!

It compiled indeed, with 3 warnings (cargo --version ⟶ cargo 1.73.0 (9c4383fb5 2023-08-26)).

warning: use of deprecated method `itertools::Itertools::fold_results`: Use .fold_ok() instead
   --> src\runtime\writers.rs:688:10
    |
688 |         .fold_results(true, |a, _| a)
    |          ^^^^^^^^^^^^
    |
    = note: `#[warn(deprecated)]` on by default

warning: field `attrs` is never read
  --> src\codegen\mod.rs:45:9
   |
44 | pub(crate) struct Sig<'a, C: Backend + ?Sized> {
   |                   --- field in this struct
45 |     pub attrs: &'a [FunctionAttr],
   |         ^^^^^
   |
   = note: `#[warn(dead_code)]` on by default

warning: `frawk` (bin "frawk") generated 2 warnings
    Finished dev [unoptimized + debuginfo] target(s) in 47.86s

But, it hanged at first trial:

> "abcd" | frawk '{ print }'
thread 'main' panicked at src\codegen\intrinsics.rs:1398:1:
assertion failed: !map.is_null()
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

so with RUST_BACKTRACE=1

> $env:RUST_BACKTRACE=1
#142 PS7 C:\git\frawk> "abcd" | frawk '{ print }'
thread 'main' panicked at src\codegen\intrinsics.rs:1398:1:
assertion failed: !map.is_null()
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\std\src\panicking.rs:595
   1: core::panicking::panic_fmt
             at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\core\src\panicking.rs:67
   2: core::panicking::panic
             at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\core\src\panicking.rs:117
   3: frawk::codegen::intrinsics::lookup_intstr
             at .\src\codegen\intrinsics.rs:1329
   4: <unknown>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Thanks! Would be happy have frawk running on Windows as there is no up to date solution, AFAIK.

ezrosent commented 5 months ago

I believe this is the same as #101 , which indeed points to an issue on Windows when running frawk using the default settings.