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

Host dependency cleanup #2436

Merged
merged 4 commits into from
Sep 22, 2022
Merged

Host dependency cleanup #2436

merged 4 commits into from
Sep 22, 2022

Conversation

333fred
Copy link
Contributor

@333fred 333fred commented Aug 14, 2022

Today, we delete a few dlls in the cake packaging scripts, to remove DLLs that should come from the runtime we're loaded with, rather than the dlls we built with. This is fine for packaging, but is annoying when doing local tests by just rebuilding the relevant driver, because you have to remember to go into the output directly and delete them every time. I addressed this by adding explicit packagereferences to the dlls in question and setting them to not keep any assets.

Today, we delete a a few dlls in the cake packaging scripts, to remove DLLs that should come from the runtime we're loaded with, rather than the dlls we built with. This is fine for packaging, but is annoying when doing local tests by just rebuilding the relevant driver, because you have to remember to go into the output directly and delete them every time. I addressed this by removing the dlls in msbuild itself:

* System.Configuration.ConfigurationManager: this was a transitive dependency through Microsoft.CodeAnalysis.Features -> Microsoft.CodeAnalysis.Elfie. We don't need Elfie or its dependencies, so I made all references to these layers explicit and turned off flowing of transitive dependencies. This does cause a slight issue: one of those transitive dependencies is System.Text.Json 6.0, while OmniSharp.MSBuild transitively references 5.0. To ensure the appropriate binding redirects are still generated, I added an explicit reference to System.Text.Json, but we are not using that reference for anything else.
* Nuget.*.dll: these are real dependencies that we should not ship in .NET 6+. I added a target to remove that version from the list of files to be copied.
@333fred 333fred marked this pull request as draft August 14, 2022 06:36
@@ -11,6 +11,7 @@
<!-- Always run on the latest runtime installed. -->
<RuntimeFrameworkVersion>6.0.0-preview.7.21317.1</RuntimeFrameworkVersion>
<RollForward>LatestMajor</RollForward>
<SkipHostDlls>true</SkipHostDlls>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We weren't removing these libraries from the Full Framework builds. Should this be conditioned by TFM?

@filipw
Copy link
Member

filipw commented Sep 20, 2022

This looks good to me, can we move it out of draft @333fred ?

@333fred 333fred marked this pull request as ready for review September 20, 2022 17:18
@filipw filipw merged commit 8c297a1 into OmniSharp:master Sep 22, 2022
@333fred 333fred deleted the dependency-cleanup branch September 22, 2022 18:04
waf added a commit to waf/CSharpRepl that referenced this pull request Nov 10, 2022
The NuGet.* libraries should not be bundled with csharprepl and we should instead use the ones included in the SDK.

You can see other projects in the .NET community making similar fixes:

microsoft/qsharp-compiler#1470
OmniSharp/omnisharp-roslyn#2308
OmniSharp/omnisharp-roslyn#2436

If we don't do this, we get issues with the MSBuildWorkspaces and MSBuildLocators unable to load the nuget libraries due to dependency conflicts. It mostly affects our "load solution" / "load project" features.
mattstern31 added a commit to mattstern31/CSharp-Repl-Services that referenced this pull request Nov 11, 2023
The NuGet.* libraries should not be bundled with csharprepl and we should instead use the ones included in the SDK.

You can see other projects in the .NET community making similar fixes:

microsoft/qsharp-compiler#1470
OmniSharp/omnisharp-roslyn#2308
OmniSharp/omnisharp-roslyn#2436

If we don't do this, we get issues with the MSBuildWorkspaces and MSBuildLocators unable to load the nuget libraries due to dependency conflicts. It mostly affects our "load solution" / "load project" features.
syedrizvinet added a commit to syedrizvinet/Repl-Tests-CSharp that referenced this pull request Apr 24, 2024
The NuGet.* libraries should not be bundled with csharprepl and we should instead use the ones included in the SDK.

You can see other projects in the .NET community making similar fixes:

microsoft/qsharp-compiler#1470
OmniSharp/omnisharp-roslyn#2308
OmniSharp/omnisharp-roslyn#2436

If we don't do this, we get issues with the MSBuildWorkspaces and MSBuildLocators unable to load the nuget libraries due to dependency conflicts. It mostly affects our "load solution" / "load project" features.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants