-
Notifications
You must be signed in to change notification settings - Fork 5
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
bazel run/bazel test only work in specific circumstances #9
Comments
j3parker
added a commit
that referenced
this issue
Sep 11, 2019
This goes towards #9, but doesn't fix it. We still need to deal with how these files aren't all collected into a single directory.
j3parker
added a commit
that referenced
this issue
Sep 11, 2019
This goes towards #9, but doesn't fix it. We still need to deal with how these files aren't all collected into a single directory.
j3parker
added a commit
that referenced
this issue
Sep 11, 2019
This goes towards #9, but doesn't fix it. We still need to deal with how these files aren't all collected into a single directory.
I've got this broadly working but it doesn't make sense to check in until we support I'm still investigating how runfiles work under the hood to see what stuff we have to DIY. |
This was referenced Sep 23, 2019
j3parker
added a commit
to j3parker/rules_csharp
that referenced
this issue
Mar 7, 2020
csharp_binary needs to become a rule which emits a cc_binary that invokes "dotnet <foo>", where "<foo>" is the actual *.dll that we compile, to solve Brightspace#71. Eventually <foo> will become a wrapper C# exe that tweaks assembly loading to solve Brightspace#9. So all of this requires the wrapper to provide a default argv[1]. For stuff like dotnet vstest (Brightspace#51) we will have argv[1] = vstest, so we also need support for baking in argv[2].
j3parker
added a commit
to j3parker/rules_csharp
that referenced
this issue
Mar 7, 2020
csharp_binary needs to become a rule which emits a cc_binary that invokes "dotnet <foo>", where "<foo>" is the actual *.dll that we compile, to solve Brightspace#71. Eventually <foo> will become a wrapper C# exe that tweaks assembly loading to solve Brightspace#9. So all of this requires the wrapper to provide a default argv[1]. For stuff like dotnet vstest (Brightspace#51) we will have argv[1] = vstest, so we also need support for baking in argv[2].
j3parker
added a commit
to j3parker/rules_csharp
that referenced
this issue
Mar 7, 2020
csharp_binary needs to become a rule which emits a cc_binary that invokes "dotnet <foo>", where "<foo>" is the actual *.dll that we compile, to solve Brightspace#71. Eventually <foo> will become a wrapper C# exe that tweaks assembly loading to solve Brightspace#9. So all of this requires the wrapper to provide a default argv[1]. For stuff like dotnet vstest (Brightspace#51) we will have argv[1] = vstest, so we also need support for baking in argv[2].
j3parker
added a commit
to j3parker/rules_csharp
that referenced
this issue
Mar 7, 2020
csharp_binary needs to become a rule which emits a cc_binary that invokes "dotnet <foo>", where "<foo>" is the actual *.dll that we compile, to solve Brightspace#71. Eventually <foo> will become a wrapper C# exe that tweaks assembly loading to solve Brightspace#9. So all of this requires the wrapper to provide a default argv[1]. For stuff like dotnet vstest (Brightspace#51) we will have argv[1] = vstest, so we also need support for baking in argv[2].
j3parker
added a commit
to j3parker/rules_csharp
that referenced
this issue
Mar 7, 2020
csharp_binary needs to become a rule which emits a cc_binary that invokes "dotnet <foo>", where "<foo>" is the actual *.dll that we compile, to solve Brightspace#71. Eventually <foo> will become a wrapper C# exe that tweaks assembly loading to solve Brightspace#9. So all of this requires the wrapper to provide a default argv[1]. For stuff like dotnet vstest (Brightspace#51) we will have argv[1] = vstest, so we also need support for baking in argv[2].
j3parker
added a commit
to j3parker/rules_csharp
that referenced
this issue
Mar 7, 2020
csharp_binary needs to become a rule which emits a cc_binary that invokes "dotnet <foo>", where "<foo>" is the actual *.dll that we compile, to solve Brightspace#71. Eventually <foo> will become a wrapper C# exe that tweaks assembly loading to solve Brightspace#9. So all of this requires the wrapper to provide a default argv[1]. For stuff like dotnet vstest (Brightspace#51) we will have argv[1] = vstest, so we also need support for baking in argv[2].
j3parker
added a commit
to j3parker/rules_csharp
that referenced
this issue
Mar 7, 2020
csharp_binary needs to become a rule which emits a cc_binary that invokes "dotnet <foo>", where "<foo>" is the actual *.dll that we compile, to solve Brightspace#71. Eventually <foo> will become a wrapper C# exe that tweaks assembly loading to solve Brightspace#9. So all of this requires the wrapper to provide a default argv[1]. For stuff like dotnet vstest (Brightspace#51) we will have argv[1] = vstest, so we also need support for baking in argv[2].
j3parker
added a commit
that referenced
this issue
Mar 7, 2020
csharp_binary needs to become a rule which emits a cc_binary that invokes "dotnet <foo>", where "<foo>" is the actual *.dll that we compile, to solve #71. Eventually <foo> will become a wrapper C# exe that tweaks assembly loading to solve #9. So all of this requires the wrapper to provide a default argv[1]. For stuff like dotnet vstest (#51) we will have argv[1] = vstest, so we also need support for baking in argv[2].
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Normally in C# you put all of your DLLs in one folder, and they are loaded based on filename (the full details are more complex).
In Bazel, when you have a target with dependencies in a different folder it will fail to run because the DLL can't be found.
Solutions that probably won't work:
app.config
: you can use<probing>
to add subdirectories for the loader to consider. The problem is you can't use..
so this won't handle all cases.What I think will work:
Have an extra action that produces a shim exe, and also write the real exe path and the list of transitive dependencies to a txt file. The shim exe's
Main
function:Path.GetFilenameWithoutExtension
to the path to the DLLAssemblyLoad
event and uses the list from (1) to resolve DLLsMain( args )
(caution:Main()
vsMain( string[] args )
.. the runner would need to do the right thing).In our
DefaultInfo
for executable rules we point at that shim, with the txt file as a runfile.This probably makes sense to do after #8 because we should only need to make this exe once (probably for the latest .NET Core version?) but we could also do it for just .NET Framework first too.
The text was updated successfully, but these errors were encountered: