unison-nix icon indicating copy to clipboard operation
unison-nix copied to clipboard

wip jit runtime...

Open aryairani opened this issue 1 year ago β€’ 18 comments

currently hangs on run.native with no output :-\

aryairani avatar May 19 '24 17:05 aryairani

I can take a look at this tomorrow. One thing I want to do is make this align more closely with the Homebrew cask to ease future maintenance. That means making the native runtime (and fzf) optional. The optionality should be trivial, but (again, to match Homebrew) the native runtime should default to disabled.

So, I’d like to see this PR have that flag, rather than merge it with it enabled and have a breaking change to change that.

I can make the change for the flag on top of this PR, this is just a note to hopefully prevent merging until I do.

sellout avatar May 20 '24 00:05 sellout

Oh, and I wanted to comment that @ereslibre made a PR to upgrade the nixpkgs derivation similarly. The current PR there clearly doesn’t enable the native runtime at all, so I don’t mind it getting in as-is. But,

  1. yay that someone beat us to the punch with upgrading that derivation (thanks, @ereslibre!);
  2. I hope to get that derivation and the one in this repo pretty close to bit-for-bit identical sometime this week; and
  3. hopefully retire this repo (by moving everything except this derivation to unisonweb/unison) not long after.

sellout avatar May 20 '24 00:05 sellout

πŸ‘‹ @sellout! regarding:

The current PR there clearly doesn’t enable the native runtime at all

I am wrapping the ucm wrapper with β€”-runtime-path. Is there anything else missing in order to enable the native runtime?

Thanks!

ereslibre avatar May 20 '24 05:05 ereslibre

@ereslibre Seems fine to me. Does the native runtime work for you though? e.g. if you create a

foo = do printLine "foo"

and then

myproject/main> run.native foo

? I'm guessing there's some missing dependencies but since there's no output I'm not sure what it would be.

aryairani avatar May 20 '24 12:05 aryairani

Does the native runtime work for you though?

@aryairani: no, doesn't seem to be working here. I'd have to check, but I won't have the time to dig into that very soon.

sometest/main>

  Loading changes detected in ~/test.u.


  I found and typechecked these definitions in ~/test.u. If you do an `add` or `update`, here's how
  your codebase would change:

    ⍟ These new definitions are ok to `add`:

      foo : '{IO, Exception} ()

sometest/main> add

  ⍟ I've added these definitions:

    foo : '{IO, Exception} ()

sometest/main> run.native foo

  I got an error when starting the Unison native runtime using:

    /nix/store/a4rjks7sf0l1ijdcy3vawzgi5f3si4pk-unison-code-manager-0.5.20/runtime/bin/unison-runtime --help

  The exit code was 1 and the output was:

    ffi-obj: could not find export from foreign library
      name: EVP_Digest
      library: [all opened]
      system error: /nix/store/a4rjks7sf0l1ijdcy3vawzgi5f3si4pk-unison-code-manager-0.5.20/runtime/bin/unison-runtime: undefined symbol: EVP_Digest
      context...:
       .../ffi/unsafe.rkt:255:20
       .../ffi/unsafe.rkt:249:2: get-ffi-obj*
       body of '#%embedded:unison/crypto:

ereslibre avatar May 20 '24 15:05 ereslibre

Ah, I think both derivations are missing a minimal-racket dependency at least – that’s what made me think that @ereslibre’s wasn’t supporting native runtime.

sellout avatar May 20 '24 15:05 sellout

Also, EVP_Digest is openssl, so something along those lines might also be missing.

ereslibre avatar May 20 '24 15:05 ereslibre

    ffi-obj: could not find export from foreign library
      name: EVP_Digest
      library: [all opened]
      system error: /nix/store/a4rjks7sf0l1ijdcy3vawzgi5f3si4pk-unison-code-manager-0.5.20/runtime/bin/unison-runtime: undefined symbol: EVP_Digest
      context...:
       .../ffi/unsafe.rkt:255:20
       .../ffi/unsafe.rkt:249:2: get-ffi-obj*
       body of '#%embedded:unison/crypto:

Nevermind – that error leads me to believe it’s finding Racket. I guess I should actually try out these derivations before I talk more …

sellout avatar May 20 '24 15:05 sellout

With this PR, on aarch64-darwin, I see the no output behavior. But on x86_64-linux, I see @ereslibre’s behavior. Don’t know why Apple wants to keep us in the dark …

So, at least it seems like both PRs are behaving the same.

sellout avatar May 20 '24 16:05 sellout

Ah, I think both derivations are missing a minimal-racket dependency at least – that’s what made me think that @ereslibre’s wasn’t supporting native runtime.

You need minimal-racket if you're trying to set up compile.native; otherwise you don't need it.

With this PR, on aarch64-darwin, I see the no output behavior. But on x86_64-linux, I see @ereslibre’s behavior. Don’t know why Apple wants to keep us in the dark …

So, at least it seems like both PRs are behaving the same.

On macOS, Racket has bundled some libs for us into the runtime/lib directory; on Linux, Racket doesn't. You'll need to have libssl (1.1?) libcrypto (1.1?), and libb2 available, and then I imagine you'll get the same hang as on macOS, but who knows.

aryairani avatar May 20 '24 17:05 aryairani

Just updated https://github.com/NixOS/nixpkgs/pull/312922. It seems to work fine now on x86_64-linux. Since racket uses get-lib-search-dirs we can rely on LD_LIBRARY_PATH, so I made the wrapper append these paths and it works as expected now. Not sure if there might be other edge cases that I'm missing though.

sometest/main> run.native foo
foo

  ()

ereslibre avatar May 20 '24 21:05 ereslibre

Nice, thanks @ereslibre!

If you want to do a more comprehensive test, you can:

.> clone @unison/runtime-tests
...
@unison/runtime-tests/main> run.native tests

But I suspect that based on what you have shown so far, it will work.

Let me know if you want some help trying to get compile.native working, but I think it could also wait for a later release.

aryairani avatar May 20 '24 22:05 aryairani

Hello @aryairani,

It failed, but not sure why exactly, open-input-file seems to have failed. Do I need to run this command from a specific folder or something similar?

native tests
@unison/runtime-tests/main> run.native tests

*** Test suite ***

 βœ…  sin 0
 βœ…  sin pi/2
 βœ…  cos 0
 βœ…  cos pi
 βœ…  cosh pi
 βœ…  sinh pi/2
 βœ…  addf
 βœ…  asin 1.0
 βœ…  asinh 1.0
 βœ…  atan 1.0
 βœ…  atan2 1.0 2.0
 βœ…  atanh 0.5
 βœ…  tan 0.5
 βœ…  tanh 0.5
 βœ…  ceiling 0.1
 βœ…  ceiling 0.9
 βœ…  floor 0.9
 βœ…  floor 1.9
 βœ…  rndf
 βœ…  divf
 βœ…  maxf
 βœ…  minf
 βœ…  mulf
 βœ…  muli
 βœ…  powi
 βœ…  pown
 βœ…  powf
 βœ…  ntof
 βœ…  negi
 βœ…  divi
 βœ…  eqlf
 βœ…  eqlf
 βœ…  leqi
 βœ…  leqn
 βœ…  subi
 βœ…  signum
 βœ…  signum
 βœ…  signum
 βœ…  logf
 βœ…  logb
 βœ…  decn
 βœ…  deci
 βœ…  inci
 βœ…  incn
 βœ…  expf
 βœ…  TZRO +0
 βœ…  TZRO +1
 βœ…  TZRO +16777216
 βœ…  TZRO 2^59
 βœ…  POPC +16777215
 βœ…  POPC +5
 βœ…  POPC -5
 βœ…  POPC -1
 βœ…  POPC -1234567891
 βœ…  POPC -1111111111

*** Test suite ***

 βœ…  Get file size should work
 βœ…  File size of missing file
 βœ…  File timestamp is reasonable
 βœ…  File timestamp of missing file
 βœ…  AbsoluteSeek
 βœ…  RelativeSeek
 βœ…  RelativeSeek
 βœ…  getLine 1
 βœ…  getLine 2
 βœ…  getLine 3
 βœ…  Block
 βœ…  Line
 βœ…  No
 βœ…  echo turned off
 βœ…  echo turned back on
 βœ…  cli args
 βœ…  HOME env variable
 βœ…  get 10 random bytes
 βœ…  get some bytes
 βœ…  get char
 βœ…  get a complicated char
 βœ…  Current directory starts with /
 βœ…  Tmp directory exists and contains prefix-
 βœ…  renameFile
 βœ…  opened handle is open
 βœ…  closed handle is not open
 βœ…  handle with text ready is ready
 βœ…  !now
 βœ…  !Clock.monotonic
 βœ…  !processCPUTime
 βœ…  !threadCPUTime
 βœ…  isSeekable file
 βœ…  handlePosition initial
 βœ…  handlePosition
 βœ…  renameFile
 βœ…  Current directory set & get


Summary of results:

  βœ…βœ…βœ…  36 PASSED
 βœ…  decoding a cert should work
 βœ…  decoding a private key should work
 βœ…  decoding an invalid private key should ignore
 βœ…  decoding an invalid cert should fail
 βœ…  self signed should connect & receive what we sent
 βœ…  self signed chain server received
 βœ…  self signed with the wrong hostname should fail
 βœ…  self signed with an unknown CA should fail
 βœ…  self signed wrong host
 βœ…  wrong host example.com fails
 βœ…  Md5 hashBytes
 βœ…  Sha1 hashBytes
 βœ…  Sha2_256 hashBytes
 βœ…  Sha2_512 hashBytes
 βœ…  Sha3_256 hashBytes
 βœ…  Sha3_512 hashBytes
 βœ…  Blake2s_256 hashBytes
 βœ…  Blake2b_256 hashBytes
 βœ…  Blake2b_512 hashBytes
 βœ…  murmurHash 0
 βœ…  murmurHash 1
 βœ…  murmurHash 2
 βœ…  murmurHash 3
 βœ…  murmurHash 4
 βœ…  murmurHash 5
 βœ…  murmurHash 6
 βœ…  murmurHash 7
 βœ…  murmurHash 8
 βœ…  murmurHash 9
 βœ…  Sha1 hmacBytes
 βœ…  Sha2_256 hmacBytes
 βœ…  Sha2_512 hmacBytes
 βœ…  Sha3_256 hmacBytes
 βœ…  Sha3_512 hmacBytes
 βœ…  Blake2s_256 hmacBytes
 βœ…  Blake2b_256 hmacBytes
 βœ…  Blake2b_512 hmacBytes
 βœ…  Ref read-write
 βœ…  Ref read-write
 βœ…  Ticket contains the Ref value
 βœ…  CAS is successful is there were no conflicting writes
 βœ…  CAS fails when there was an intervening write
 βœ…  Promise should be empty when created
 βœ…  Promise should read a value that's been written
 βœ…  Promise can only be written to once
 βœ…  Once the Promise is full, tryRead is the same as read
 βœ…  Reads awaits for completion of the Promise
 βœ…  Thread was killed
 βœ…  Thread killed, finalisers with typeLink
 βœ…  tryEval is a no-op on success
 βœ…  Thread was killed, with finalisers
 βœ…  The state of the counter is consistent
 βœ…  rejects invalid port
 βœ…  no send after close
 βœ…  no send on listener
 βœ…  Server received data
 βœ…  Client received data
open-input-file: cannot open input file
  path: /home/ereslibre/unison-src/transcripts-using-base/serialized-cases/case-04.v4.ser
  system error: No such file or directory; errno=2
  context...:
   .../unison/io-handles.rkt:208:0: unison-FOp-IO.openFile.impl.v3
   .../unison/simple-wrappers.ss:1919:0
   .../unison/boot.ss:209:41
   [repeats 3 more times]
   .../racket/control.rkt:138:30
   .../unison/boot.ss:209:41
   .../racket/control.rkt:138:30
   .../unison/boot.ss:209:41
   .../racket/control.rkt:138:30
   .../unison/boot.ss:209:41
   [repeats 2 more times]
   .../racket/control.rkt:138:30
   .../racket/unison-runtime.rkt:186:2
   body of '#%mzc:unison-runtime

  native evaluation failed

Just for sanity, run tests (without native) fails in a similar way:

tests
@unison/runtime-tests/main> run tests

*** Test suite ***

 βœ…  sin 0
 βœ…  sin pi/2
 βœ…  cos 0
 βœ…  cos pi
 βœ…  cosh pi
 βœ…  sinh pi/2
 βœ…  addf
 βœ…  asin 1.0
 βœ…  asinh 1.0
 βœ…  atan 1.0
 βœ…  atan2 1.0 2.0
 βœ…  atanh 0.5
 βœ…  tan 0.5
 βœ…  tanh 0.5
 βœ…  ceiling 0.1
 βœ…  ceiling 0.9
 βœ…  floor 0.9
 βœ…  floor 1.9
 βœ…  rndf
 βœ…  divf
 βœ…  maxf
 βœ…  minf
 βœ…  mulf
 βœ…  muli
 βœ…  powi
 βœ…  pown
 βœ…  powf
 βœ…  ntof
 βœ…  negi
 βœ…  divi
 βœ…  eqlf
 βœ…  eqlf
 βœ…  leqi
 βœ…  leqn
 βœ…  subi
 βœ…  signum
 βœ…  signum
 βœ…  signum
 βœ…  logf
 βœ…  logb
 βœ…  decn
 βœ…  deci
 βœ…  inci
 βœ…  incn
 βœ…  expf
 βœ…  TZRO +0
 βœ…  TZRO +1
 βœ…  TZRO +16777216
 βœ…  TZRO 2^59
 βœ…  POPC +16777215
 βœ…  POPC +5
 βœ…  POPC -5
 βœ…  POPC -1
 βœ…  POPC -1234567891
 βœ…  POPC -1111111111

*** Test suite ***

 βœ…  Get file size should work
 βœ…  File size of missing file
 βœ…  File timestamp is reasonable
 βœ…  File timestamp of missing file
 βœ…  AbsoluteSeek
 βœ…  RelativeSeek
 βœ…  RelativeSeek
 βœ…  getLine 1
 βœ…  getLine 2
 βœ…  getLine 3
 βœ…  Block
 βœ…  Line
 βœ…  No
 βœ…  echo turned off
 βœ…  echo turned back on
 βœ…  cli args
 βœ…  HOME env variable
 βœ…  get 10 random bytes
 βœ…  get some bytes
 βœ…  get char
 βœ…  get a complicated char
 βœ…  Current directory starts with /
 βœ…  Tmp directory exists and contains prefix-
 βœ…  renameFile
 βœ…  opened handle is open
 βœ…  closed handle is not open
 βœ…  handle with text ready is ready
 βœ…  !now
 βœ…  !Clock.monotonic
 βœ…  !processCPUTime
 βœ…  !threadCPUTime
 βœ…  isSeekable file
 βœ…  handlePosition initial
 βœ…  handlePosition
 βœ…  renameFile
 βœ…  Current directory set & get


Summary of results:

  βœ…βœ…βœ…  36 PASSED
 βœ…  decoding a cert should work
 βœ…  decoding a private key should work
 βœ…  decoding an invalid private key should ignore
 βœ…  decoding an invalid cert should fail
 βœ…  self signed should connect & receive what we sent
 βœ…  self signed chain server received
 βœ…  self signed with the wrong hostname should fail
 βœ…  self signed with an unknown CA should fail
 βœ…  self signed wrong host
 βœ…  wrong host example.com fails
 βœ…  Md5 hashBytes
 βœ…  Sha1 hashBytes
 βœ…  Sha2_256 hashBytes
 βœ…  Sha2_512 hashBytes
 βœ…  Sha3_256 hashBytes
 βœ…  Sha3_512 hashBytes
 βœ…  Blake2s_256 hashBytes
 βœ…  Blake2b_256 hashBytes
 βœ…  Blake2b_512 hashBytes
 βœ…  murmurHash 0
 βœ…  murmurHash 1
 βœ…  murmurHash 2
 βœ…  murmurHash 3
 βœ…  murmurHash 4
 βœ…  murmurHash 5
 βœ…  murmurHash 6
 βœ…  murmurHash 7
 βœ…  murmurHash 8
 βœ…  murmurHash 9
 βœ…  Sha1 hmacBytes
 βœ…  Sha2_256 hmacBytes
 βœ…  Sha2_512 hmacBytes
 βœ…  Sha3_256 hmacBytes
 βœ…  Sha3_512 hmacBytes
 βœ…  Blake2s_256 hmacBytes
 βœ…  Blake2b_256 hmacBytes
 βœ…  Blake2b_512 hmacBytes
 βœ…  Ref read-write
 βœ…  Ref read-write
 βœ…  Ticket contains the Ref value
 βœ…  CAS is successful is there were no conflicting writes
 βœ…  CAS fails when there was an intervening write
 βœ…  Promise should be empty when created
 βœ…  Promise should read a value that's been written
 βœ…  Promise can only be written to once
 βœ…  Once the Promise is full, tryRead is the same as read
 βœ…  Reads awaits for completion of the Promise
 βœ…  Thread was killed
 βœ…  Thread killed, finalisers with typeLink
 βœ…  tryEval is a no-op on success
 βœ…  Thread was killed, with finalisers
 βœ…  The state of the counter is consistent
 βœ…  rejects invalid port
 βœ…  no send after close
 βœ…  no send on listener
 βœ…  Server received data
 βœ…  Client received data
 πŸ’₯  test failure: case-00 unison-src/transcripts-using-base/serialized-cases/case-00.v4.ser: openFile: does not exist (No such file or directory)
 πŸ’₯  test failure: case-04 unison-src/transcripts-using-base/serialized-cases/case-04.v4.ser: openFile: does not exist (No such file or directory)
 πŸ’₯  test failure: case-02 unison-src/transcripts-using-base/serialized-cases/case-02.v4.ser: openFile: does not exist (No such file or directory)
 βœ…  bug is caught
 βœ…  List empty literal
 βœ…  List literal
 βœ…  List equality: empty
 βœ…  List equality: non empty
 βœ…  List inequality: non empty (1)
 βœ…  List inequality: non empty (2)
 βœ…  List inequality: non empty (3)
 βœ…  List inequality: empty
 βœ…  List equality: composite
 βœ…  List inequality: composite
 βœ…  List ordering (1)
 βœ…  List ordering (2)
 βœ…  List ordering (3)
 βœ…  List ordering (4)
 βœ…  List ordering (5)
 βœ…  List.ordering (6)
 βœ…  List.cons
 βœ…  List.snoc
 βœ…  List.++
 βœ…  List.take (1)
 βœ…  List.take (2)
 βœ…  List.take (3)
 βœ…  List.take (4)
 βœ…  List.take (5)
 βœ…  List.drop (1)
 βœ…  List.drop (2)
 βœ…  List.drop (3)
 βœ…  List.drop (4)
 βœ…  List.drop (5)
 βœ…  List.size (1)
 βœ…  List.size (2)
 βœ…  List.at (1)
 βœ…  List.at (2)
 βœ…  List.at (3)
 βœ…  List.at (4)
 βœ…  length matching: literal (1)
 βœ…  length matching: literal (2)
 βœ…  length matching: literal (3)
 βœ…  length matching: literal (4)
 βœ…  length: cons matching
 βœ…  length: snoc matching
 βœ…  length: ++ prefix matching
 βœ…  length: ++ suffix matching
 βœ…  cons matching: empty
 βœ…  cons matching: non empty
 βœ…  two cons matching (1)
 βœ…  two cons matching (2)
 βœ…  two cons matching (3)
 βœ…  two snoc matching (1)
 βœ…  two snoc matching (2)
 βœ…  two snoc matching (3)
 βœ…  middle matching (1)
 βœ…  middle matching (2)
 βœ…  middle matching (3)
 βœ…  middle matching with non-empty list (1)
 βœ…  middle matching with non-empty list (2)
 βœ…  middle matching with non-empty list (3)
 βœ…  Complex matching
 βœ…  Text empty literal
 βœ…  Text literal
 βœ…  Text equality: empty
 βœ…  Text equality: non empty
 βœ…  Text inequality: empty (1)
 βœ…  Text inequality: empty (2)
 βœ…  Text inequality: non empty
 βœ…  Universal equality with Text: empty
 βœ…  Universal equality with Text: non empty
 βœ…  Universal inequality with Text: empty (1)
 βœ…  Universal inequality with Text: empty (2)
 βœ…  Universal inequality with Text: non empty
 βœ…  Universal equality with Text: composite
 βœ…  Universal inequality with Text: composite
 βœ…  Text ordering (1)
 βœ…  Text ordering (2)
 βœ…  Text ordering (3)
 βœ…  Text ordering (4)
 βœ…  Text ordering (5)
 βœ…  Universal ordering with Text (1)
 βœ…  Universal ordering with Text (2)
 βœ…  Universal ordering with Text (3)
 βœ…  Universal ordering with Text (4)
 βœ…  Universal ordering with Text (5)
 βœ…  Universal ordering with Text (6)
 βœ…  Text.++
 βœ…  Text.take (1)
 βœ…  Text.take (2)
 βœ…  Text.take (3)
 βœ…  Text.take (4)
 βœ…  Text.take (5)
 βœ…  Text.drop (1)
 βœ…  Text.drop (2)
 βœ…  Text.drop (3)
 βœ…  Text.drop (4)
 βœ…  Text.drop (5)
 βœ…  Text.size (1)
 βœ…  Text.size (2)
 βœ…  Text.uncons (1)
 βœ…  Text.uncons (2)
 βœ…  Text.uncons (3)
 βœ…  Text.unsnoc (1)
 βœ…  Text.unsnoc (2)
 βœ…  Text.unsnoc (3)
 βœ…  Text.repeat (1)
 βœ…  Text.repeat (2)
 βœ…  Text.repeat (3)
 βœ…  Text.repeat (3)
 βœ…  Text.reverse (1)
 βœ…  Text.reverse (2)
 βœ…  Text.reverse (3)
 βœ…  Text.toUppercase (1)
 βœ…  Text.toUppercase (2)
 βœ…  Text.toLowercase (1)
 βœ…  Text.toLowercase (2)
 βœ…  Text.indexOf (1)
 βœ…  Text.indexOf (2)
 βœ…  Text.indexOf (3)
 βœ…  Text.indexOf (3)
 βœ…  Nat.toText (1)
 βœ…  Nat.toText (2)
 βœ…  Nat.toText (3)
 βœ…  Nat.fromText (1)
 βœ…  Nat.fromText (2)
 βœ…  Nat.fromText (3)
 βœ…  Nat.fromText (4)
 βœ…  Nat.fromText (5)
 βœ…  Nat.fromText (6)
 βœ…  Nat <-> Text roundtrip (1)
 βœ…  Int.toText (1)
 βœ…  Int.toText (2)
 βœ…  Int.toText (3)
 βœ…  Int.fromText (1)
 βœ…  Int.fromText (2)
 βœ…  Int.fromText (3)
 βœ…  Int.fromText (3)
 βœ…  Int.fromText (4)
 βœ…  Int.fromText (5)
 βœ…  Int.fromText (6)
 βœ…  Int <-> Text roundtrip (1)
 βœ…  Int <-> Text roundtrip (2)
 βœ…  Float.toText
 βœ…  Float.fromText (1)
 βœ…  Float.fromText (2)
 βœ…  Char.toText
 βœ…  Text.toCharList: empty
 βœ…  Text.toCharList non empty
 βœ…  Text.fromCharList: empty
 βœ…  Text.fromCharList: non empty
 βœ…  Text ut8 roundTrip
 βœ…  Debug.evalToText (1)
 βœ…  Debug.evalToText (2)
 βœ…  bug (1)
 βœ…  bug (2)
 βœ…  todo (1)
 βœ…  todo (2)
trace: First message
3
trace: Second message
"hello"
 βœ…  Debug.trace
Watch
 βœ…  Debug.watch
 βœ…  String literal matching: empty
 βœ…  String literal matching: non empty
 βœ…  String literal matching: default
 βœ…  Pattern api (1)
 βœ…  Pattern api (2)
 βœ…  Pattern api (3)
 βœ…  Pattern api (4)
 βœ…  Pattern api (5)
 βœ…  Pattern api (6)
 βœ…  Pattern api (7)
 βœ…  Pattern api (8)
 βœ…  Pattern api (9)
 βœ…  Pattern api (10)
 βœ…  Pattern api (11)
 βœ…  Pattern api (12)
 βœ…  Pattern api (13)
 βœ…  Pattern api (14)
 βœ…  Pattern api (15)
 βœ…  Pattern api (16)
 βœ…  Pattern api (17)
 βœ…  Pattern api (18)
 βœ…  Pattern api (19)
 βœ…  Pattern api (20)
 βœ…  Pattern api (21)
 βœ…  Pattern api (22)
 βœ…  Pattern api (23)
 βœ…  Pattern api (24)
 βœ…  Pattern api (25)
 βœ…  Char.Class: any
 βœ…  Char.Class: any (2)
 βœ…  Char.Class.alphanumeric (1)
 βœ…  Char.Class.alphanumeric (2)
 βœ…  Char.Class.upper
 βœ…  Char.Class.lower
 βœ…  Char.Class.number
 βœ…  Char.Class.punctuation
 βœ…  Char.Class.symbol
 βœ…  Char.Class.letter
 βœ…  Char.Class.whitespace
 βœ…  Char.Class.control
 βœ…  Char.Class.printable
 βœ…  Char.Class.mark
 βœ…  Char.Class.separator
 βœ…  Char.Class.not
 βœ…  Char.Class.and
 βœ…  Char.Class.or (1)
 βœ…  Char.Class.or (2)
 βœ…  Char.Class.range (1)
 βœ…  Char.Class.range (2)
 βœ…  Char.Class.range (3)
 βœ…  Char.Class.range (4)
 βœ…  Char.Class.anyOf (1)
 βœ…  Char.Class.anyOf (2)
 βœ…  Char.Class.anyOf (3)
 βœ…  Bytes empty literal
 βœ…  Bytes literal
 βœ…  Debug.evalToText on Bytes
 βœ…  Bytes.fromList: empty
 βœ…  Bytes.fromList: non empty
 βœ…  Bytes.fromList: invalid
 βœ…  Bytes.toList: empty
 βœ…  Bytes.toList: non empty
 βœ…  fromUtf8: invalid
 βœ…  fromUtf8
 βœ…  toUtf8
 βœ…  ut8 roundTrip
 βœ…  Bytes equality: empty
 βœ…  Bytes equality: non empty
 βœ…  Bytes inequality: non empty (1)
 βœ…  Bytes inequality: non empty (2)
 βœ…  Bytes inequality: non empty (3)
 βœ…  Bytes inequality: empty
 βœ…  Bytes equality: composite
 βœ…  Bytes inequality: composite
 βœ…  Bytes ordering (1)
 βœ…  Bytes ordering (2)
 βœ…  Bytes ordering (3)
 βœ…  Bytes ordering (4)
 βœ…  Bytes ordering (5)
 βœ…  Bytes ordering (6)
 βœ…  Bytes.flatten
 βœ…  Bytes.++
 βœ…  Bytes.take (1)
 βœ…  Bytes.take (2)
 βœ…  Bytes.take (3)
 βœ…  Bytes.take (4)
 βœ…  Bytes.take (5)
 βœ…  Bytes.drop (1)
 βœ…  Bytes.drop (2)
 βœ…  Bytes.drop (3)
 βœ…  Bytes.drop (4)
 βœ…  Bytes.drop (5)
 βœ…  Bytes.size (1)
 βœ…  Bytes.size (2)
 βœ…  Bytes.at (1)
 βœ…  Bytes.at (2)
 βœ…  Bytes.at (3)
 βœ…  Bytes.at (4)
 βœ…  Bytes.indexOf (1)
 βœ…  Bytes.indexOf (2)
 βœ…  Bytes.indexOf (3)
 βœ…  Bytes.indexOf (3)
 βœ…  gzip empty
 βœ…  gzip hello folks
 βœ…  gunzip empty
 βœ…  gunzip hello folks
 βœ…  zlib empty
 βœ…  zlib hello folks
 βœ…  zlib inflate empty
 βœ…  zlib inflate hello folks
 βœ…  base16 empty
 βœ…  from base16 empty
 βœ…  base16 hello
 βœ…  from base16 hello
 βœ…  base32 hello
 βœ…  from base32 hello
 βœ…  base64 hello
 βœ…  from base64 hello
 βœ…  base64Url hello
 βœ…  from base64Url hello
 βœ…  from base16 fail non-utf8
 βœ…  from base32 fail non-utf8
 βœ…  from base64 fail non-utf8
 βœ…  from base64Url fail non-utf8
 βœ…  from base32 fail
 βœ…  decodeNat16be 1
 βœ…  decodeNat16be 10000
 βœ…  decodeNat16le 1
 βœ…  decodeNat16le 10000
 βœ…  decodeNat32be 1
 βœ…  decodeNat32be 1000000000
 βœ…  decodeNat32le 1
 βœ…  decodeNat32le 1000000000
 βœ…  decodeNat64be 1
 βœ…  decodeNat64be 10000000000000000
 βœ…  decodeNat64le 1
 βœ…  decodeNat64le 10000000000000000
 βœ…  encodeNat16be 1
 βœ…  encodeNat16be 10000
 βœ…  encodeNat16le 1
 βœ…  encodeNat16le 10000
 βœ…  encodeNat32be 1
 βœ…  encodeNat32be 1000000000
 βœ…  encodeNat32le 1
 βœ…  encodeNat32le 1000000000
 βœ…  encodeNat64be 1
 βœ…  encodeNat64be 10000000000000000
 βœ…  encodeNat64le 1
 βœ…  encodeNat64le 10000000000000000
 βœ…  byte new/msize
 βœ…  byte mut read/write 64
 βœ…  byte mut read/write 40
 βœ…  byte mut read/write 32
 βœ…  byte mut read/write 24
 βœ…  byte mut read/write 16
 βœ…  byte mut read/write 8
 βœ…  byte new/size
 βœ…  byte imm read/write 64
 βœ…  byte imm read/write 40
 βœ…  byte imm read/write 32
 βœ…  byte imm read/write 24
 βœ…  byte imm read/write 16
 βœ…  byte imm read/write 8
 βœ…  byte immutable copyTo!
 βœ…  byte mutable copyTo!
 βœ…  byte immutable copied
 βœ…  boxed array/msize
 βœ…  boxed mut read/write
 βœ…  boxed new/size
 βœ…  boxed imm read/write
 βœ…  immuntable copyTo!
 βœ…  mutable copyTo!
 βœ…  boxed immutable copied
 βœ…  boxed serial
 βœ…  codelookup #016888slblvodphfclvfslsfg427dv1tv1me53eui24pilfeq9fa8
 βœ…  codelookup #00b3jbldq2t4plgsi6u1k23q8g7dfahfc7ggblqikvndbfijv456g
 βœ…  codelookup #01oi4j2iudlufo4iarngn292821ljgbaa7ssjbufmtukifuem6rse
 βœ…  codelookup #0197gdh70lgq40btoggomju2kvi6r466qqfdu1c628sefdrrfusga
 βœ…  codelookup #028m89oqrpm9raicunscdegrappcq9ekkgbknqa0r8uktr1ilk51o
 βœ…  codelookup #02jgonqg0sob7d8r9l75biie2q6sl3eb5ktnf99c8er0de26oq4u6
 βœ…  codelookup #0104n87srnts5ku4bd4g7sv32nru0c4cmh1ucqejt52nit0p792tq
 βœ…  codelookup #03t4555ovfl57rcn9e69mk8sad9cqvgc9dglrddonlthdbk60agcg
 βœ…  codelookup #00s4qgnlemcvuj7h18rnq3r84k1t8n5847a9n4hqupjq2s6v7nk9c
 βœ…  codelookup #01l1c0nf1hqg4acrg9ba984j92o4tcoqjpe8hmc4vprdo9lntp07e
 βœ…  codelookup #001gd5dk78n7vqrlltbi9nqpn6rapb99tf8u6o1vhqf4uf3kcuq92
 βœ…  codelookup #03npa9qar85ck28f5rsl577dctfiuuhur24gsevshc6h7i5ui32g2
 βœ…  codelookup #00n4dgeec6jt6skfmkh04d8k56d312emvhtoa41neia8drnf8m1ha
 βœ…  codelookup #00so2r5a8hjo5cippkmjkdfsckghl0876393dd70hn8rcvtgjasvi
 βœ…  codelookup #020oqghpt8t21t1m1fn0m7c369i08uv60s042d8ptgo4bqau2tmm4
 βœ…  codelookup #034m4ap7bg1rmm46cistvq2objtj3m7raoo6nekk8fu1jv9hr0f5u
 βœ…  codelookup #01dmj6kci0av8b4h1bo15vbu3n2oahvs2q7tbs5tc5f8drk6ar98i
 βœ…  codelookup #029imb8lah6pt8s2uv4o4s76ok654qeogt4fdc9upo9hm49r6jon2
 βœ…  codelookup #02j756k2gbdlomnc1s2k2nutt9con1cae9lgemmrp3jabf79mait4
 βœ…  codelookup #031djf8uaq003dfrps44sulchccgg6eegb0r1iuiq3nahgf7vanm0
 βœ…  codelookup #001v77fenc2q4prm6nds1dmrckmuf280jrg6e7ndchr6tt3g2o1rq
 βœ…  codelookup #03880kcvadlrci39lhn2gtn9vo93raan2sm6onlmjjed9mq8855hm
 βœ…  5 safe
 βœ…  5.0 safe
 βœ…  "" safe
 βœ…  0xs1337 safe
 βœ…  List.map safe
 βœ…  FilePath.open unsafe
 βœ…  sandbox.open1 unsafe
 βœ…  sandbox.open2 unsafe
 βœ…  Code.cache_ unsafe
 βœ…  FilePath.open allowed
 βœ…  Code.cache_ allowed

  πŸ’”πŸ’₯

  The program halted with an unhandled exception:

    Failure
      (typeLink IOFailure)
      "unison-src/transcripts-using-base/serialized-cases/case-04.v4.ser: openFile: does not exist (No such file or directory)"
      (Any ())

  Stack trace:
    ##raise

ereslibre avatar May 21 '24 06:05 ereslibre

Also, tested https://github.com/NixOS/nixpkgs/pull/312922 and it works fine on Darwin aarch64:

.> run.native foo
foo

  ()

Note: it takes a while to show up, but it does eventually. In the order of 1 second or so.

ereslibre avatar May 21 '24 07:05 ereslibre

And for the sake of completeness, Darwin on x86_64 working as well with https://github.com/NixOS/nixpkgs/pull/312922:

vibrant-wallaroo/main> run foo
foo

  ()

vibrant-wallaroo/main> run.native foo
foo

  ()

ereslibre avatar May 21 '24 07:05 ereslibre

Hello @aryairani,

It failed, but not sure why exactly, open-input-file seems to have failed. Do I need to run this command from a specific folder or something similar?

native tests Just for sanity, run tests (without native) fails in a similar way:

tests

@ereslibre Oops, sorry about that β€”Β that's a known issue I forgot about, which trips me up sometimes too. If you run the tests from the root directory of the unisonweb/unison repo, that file will be available.

I'm thinking that ideally the only files the tests should be reading should be ones that it also wrote, but that's a separate issue for a separate ticket for a separate repo. πŸ˜…

aryairani avatar May 21 '24 14:05 aryairani

@ereslibre Oops, sorry about that β€” that's a known issue I forgot about, which trips me up sometimes too. If you run the tests from the root directory of the unisonweb/unison repo, that file will be available.

I see, thanks for confirming. I will check later tonight just to confirm, but I think it's already looking good.

I'm thinking that ideally the only files the tests should be reading should be ones that it also wrote, but that's a separate issue for a separate ticket for a separate repo. πŸ˜…

Hehe, absolutely :)

ereslibre avatar May 21 '24 14:05 ereslibre

Yup, tests pass with run.native tests after cloning clone @unison/runtime-tests, and when executed from within the unison directory.

@unison/runtime-tests/main> run.native tests

<snip>

Summary of results:

  βœ…βœ…βœ…  499 PASSED

  ()

ereslibre avatar May 21 '24 14:05 ereslibre