Brightspace / rules_csharp

Bazel rules for C#
Apache License 2.0
8 stars 5 forks source link

Add runtimeconfig.json for .NET Core executables #120

Closed j3parker closed 4 years ago

j3parker commented 4 years ago

This is half of #71. The other half is invoking the exe with dotnet rather than directly (I'm going to use the wrapper to do this, but in a follow-up PR).

j3parker commented 4 years ago

Still not 100% working:

$ bazel run basic:hello
INFO: Analyzed target //basic:hello (21 packages loaded, 2285 targets configured).
INFO: Found 1 target...
Target //basic:hello up-to-date:
  bazel-bin/basic/bazelout/netcoreapp3.0/hello.exe
  bazel-bin/basic/bazelout/netcoreapp3.0/hello.ref.exe
  bazel-bin/basic/bazelout/netcoreapp3.0/hello.pdb
INFO: Elapsed time: 0.773s, Critical Path: 0.01s
INFO: 0 processes.
INFO: Build completed successfully, 1 total action
INFO: Build completed successfully, 1 total action
/bin/bash: /private/var/tmp/_bazel_jacob/5ce6d685aeab8cd41f37e1f62e684c76/execroot/__main__/bazel-out/darwin-fastbuild/bin/basic/bazelout/netcoreapp3.0/hello.exe: cannot execute binary file

But now we're half-way there:

$ dotnet /private/var/tmp/_bazel_jacob/5ce6d685aeab8cd41f37e1f62e684c76/execroot/__main__/bazel-out/darwin-fastbuild/bin/basic/bazelout/netcoreapp3.0/hello.exe
Hello, world!
Some numbers for you:
        1, 1, 3, 5, 13, 21, 55, 89, 233, 377