Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wasilibc: 20190413 -> 20190712 #64988

Merged
merged 1 commit into from Jul 18, 2019
Merged

Conversation

dingxiangfei2009
Copy link
Contributor

@dingxiangfei2009 dingxiangfei2009 commented Jul 17, 2019

Motivation for this change

@matthewbauer This version of wasi-libc seems to fix some problems when I try to link my libraries to it, so I think it worth a bump.

WASI looks super cool, by the way.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@matthewbauer
Copy link
Member

matthewbauer commented Jul 17, 2019

Looks okay! Can you verify that a C program built, runs on wasmtime? I need to add an official test, but you can do something like this:

$ > test.c <<EOF
#include <stdio.h>
int main() {
  printf("Fibonacci\n");
  unsigned long a, b = 1;
  for (int i = 1; i < 50; i++) {
    unsigned long c = a + b;
    printf("%i: %lu\n", i, c);
    a = b; b = c;
  }
  return 0;
}
EOF
$ nix-shell -I nixpkgs=./. -p pkgsCross.wasi32.stdenv.cc wasmtime --run "wasm32-unknown-wasi-cc test.c && wasmtime a.out"

Mostly want to make sure we don't need to update wasmtime as well.

@dingxiangfei2009
Copy link
Contributor Author

dingxiangfei2009 commented Jul 18, 2019

After rebasing onto the current master branch, wasmtime a.out outputs the Fibonacci sequence:

1: 1
2: 2
3: 3
4: 5
5: 8
6: 13
7: 21
8: 34
9: 55
10: 89
11: 144
12: 233
13: 377
14: 610
15: 987
16: 1597
17: 2584
18: 4181
19: 6765
20: 10946
21: 17711
22: 28657
23: 46368
24: 75025
25: 121393
26: 196418
27: 317811
28: 514229
29: 832040
30: 1346269
31: 2178309
32: 3524578
33: 5702887
34: 9227465
35: 14930352
36: 24157817
37: 39088169
38: 63245986
39: 102334155
40: 165580141
41: 267914296
42: 433494437
43: 701408733
44: 1134903170
45: 1836311903
46: 2971215073
47: 512559680
48: 3483774753
49: 3996334433

@Mic92 Mic92 merged commit 8f0b342 into NixOS:master Jul 18, 2019
@dingxiangfei2009 dingxiangfei2009 deleted the bump-wasilibc branch July 18, 2019 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants