Brightspace / rules_csharp

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

define @net//:StandardReferences #82

Closed omsmith closed 4 years ago

omsmith commented 4 years ago

Closes: https://github.com/Brightspace/rules_csharp/issues/41

omsmith commented 4 years ago

Can successfully build netstandard and netcoreapp, but not framework

/home/omsmith/dev/rules_csharp/examples/every_framework_empty ~ bazel build :net20
INFO: Analyzed target //every_framework_empty:net20 (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /home/omsmith/dev/rules_csharp/examples/every_framework_empty/BUILD:6:1: Compiling net20 failed (Exit 1) dotnet failed: error executing command external/netcore-runtime-linux/dotnet external/csharp-build-tools/tasks/netcoreapp2.1/bincore/csc.dll /noconfig /unsafe- /checked- /nostdlib+ /utf8output /deterministic+ /filealign:512 /nologo ... (remaining 23 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
warning CS2008: No source files specified.
error CS0006: Metadata file '/home/omsmith/.cache/bazel/_bazel_omsmith/2fb55c7c47f7f9f7347244ac3cb377ea/sandbox/linux-sandbox/20/execroot/__main__/external/net20/build/.NETFramework/v2.0/System.EnterpriseServices.Wrapper.dll' could not be found
Target //every_framework_empty:net20 failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 0.609s, Critical Path: 0.56s
INFO: 0 processes.
FAILED: Build did NOT complete successfully
j3parker commented 4 years ago

So there are native DLLs that I think we just want to show up in runfiles (e.g. libgit2) but not at compile time. This one is weird because we don't want it in runfiles (it'll come from the GAC in practice) but we do need it at compile time...

I think it's reasonable to do this now but we'll probably need to revisit things later. I'll open up an issue to track this.