Comments (9)
Shelling out isn't always an option. Take Roslyn as an example. We specifically avoid shelling out during build because it's costly. Yet we also have dependencies not included in the core MSBuild install (pipe ACLs in particular). Loading dependencies is a necessity for us.
Maybe we can use Arcade as another chance to nudge MSBuild on this.
It's as much of a CoreClr problem as MSBuild. Loading dependencies under full framework requires no particular effort. Our assemblies go into the LoadFrom context and hence assemblies deployed beside us just work. For CoreClr though we end up deploying runtime specific assets and hence have to add nasty probing logic to make it work.
from arcade.
Should we do something similar for .NET Core too using AssemblyLoadContext? See @AArnott's https://github.com/AArnott/Nerdbank.GitVersioning/blob/dc1fb805c6694a2ef7a6ab557c509384f1756085/src/MSBuildExtensionTask/ContextAwareTask.cs for example.
from arcade.
From a quick look that seems to be trying to add support for loading native assets side-by-side with the managed assemblies. We may end up needing something like that but for now lets not complicate things.
We will definitely need the .NET Framework assembly resolver if we want to have any hopes of unifying dependent assembly versions that don't have the exact version.
from arcade.
Having tried so many ways to isolate my tasks, control the versions I load, etc., I've come to this (sad) conclusion: if you care about controlling your assembly loads, just write a tool and have your MSBuild targets invoke it (possibly through a simple MSBuild Task). It's far too much work wasted in the (futile) attempt to get your MSBuild task's environment right. MSBuild wasn't built for tasks that care about multiple assemblies, their versions, etc.
For instance, even if you did everything perfectly, all it takes is two projects to build from the same top-level MSBuild call that bring in different versions of your MSBuild tasks assembly (via nuget package or whatever) and it all blows up anyway (non-deterministically) because MSBuild will only load one of your two task assemblies. Of course that has a workaround too, but then that breaks other workarounds you've used...
Thus I filed multiple issues against msbuild to make this better... but nothing has happened yet.
from arcade.
I've come to a similar conclusion too -- msbuild tasks with dependencies is a thorny path. That said, we have a bunch of tasks already written, and shelling out to a new process has its own problems, too. Maybe we can use Arcade as another chance to nudge MSBuild on this.
from arcade.
I agree there is no great answer but at least for the tasks in Arcade we want to agree on dependencies and try to avoid most of these problem. I know that is easier said then done but I think we have to try.
from arcade.
@weshaggard - anything more actionable here?
from arcade.
Yes we need to port the AssemblyResolver we currently use in BuildTools to Arcade (https://github.com/dotnet/buildtools/blob/master/src/common/AssemblyResolver.cs) it is general purpose and we are going to need it for all the build tasks we use in arcade.
from arcade.
Closing because the parent Epic was closed. If you believe this issue should still be worked on, please re-open.
from arcade.
Related Issues (20)
- AsmDiff: Make sure CLSCompliantAttribute shows up in diffs
- Add gpg to windows.vs2022.amd64 for signing HOT 1
- NuGet Validation fails when a pipeline doesn't produce any nuget packages
- Delete promote-build.yml in release branches HOT 3
- Move publishing back to netcore1espool-publishing-internal for the 1ES official templates HOT 1
- [1ES Template] Migrate dotnet-migrate-packages HOT 2
- [1ES Template] Migrate Core mirror HOT 1
- Update arcade-validation to use windows 11 helix queues over windows 10. HOT 2
- Updates to the docker eol report HOT 1
- Allow building with newer clang versions without changing init-compilers.sh. HOT 1
- RemoteExecutor field marshaling failure when in Live Unit Testing HOT 1
- Delete Validate Publishing in arcade-validation HOT 2
- "5 new packages used not in baseline!" after pulling the latest arcade from .Net 7 Eng channel HOT 23
- [Build Analysis] GitHub Throttling issues
- Update MicroBuildSigningPlugin to version 4 HOT 2
- Fix up devdiv pool usage in official arcade templates HOT 7
- Remove `-pt` image use HOT 2
- CA2022 error in src/SignCheck/Microsoft.SignCheck/Verification/LZMAUtils.cs
- Tools.csproj makes it hard to use central package management HOT 3
- Determine why SB break wasn't caught in arcade-validation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arcade.