Lightup Deps.json feature#1727
Conversation
4a5bbb9 to
36c58c0
Compare
|
How does this work with |
|
It does not @pakrym. This is intended to be a scoped change only to support Azure lightup scenarios. |
|
There may be unexpected consequences, for example if Azure Lightup brings controller and MVC uses runtime assembly scan to discover controllers it would not get discovered. Just wanted to make sure this is known. |
|
I think any assembly injected using this mechanism will not be discoverable via DependencyContext, from my naive understanding of it. Either ways, I believe you own DependencyContext, so you may want to followup on this. |
| if (additional_deps_serialized.empty()) | ||
| { | ||
| // additional_deps_serialized stays empty if DOTNET_ADDITIONAL_DEPS env var is not defined | ||
| pal::getenv(_X("DOTNET_ADDITIONAL_DEPS"), &additional_deps_serialized); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| new deps_json_t(true, json_file, m_fx_deps->get_rid_fallback_graph()))); | ||
| } | ||
| } | ||
| else |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| pal::string_t additional_deps_path; | ||
| pal::stringstream_t ss(additional_deps_serialized); | ||
|
|
||
| // Process the delimiter seperated custom deps files. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| } | ||
| else | ||
| { | ||
| Console.WriteLine("Lightup assembly successfully loaded!"); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| "version": "1.1.0", | ||
| "exclude": "all" | ||
| }, | ||
| "Microsoft.CSharp": { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| "frameworks": { | ||
| "netcoreapp2.0": { | ||
| "dependencies": { | ||
| "Microsoft.NETCore.App": { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| @@ -0,0 +1,386 @@ | |||
| { | |||
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
Could we have a flag in I feel like some app developers may want to be a little paranoid and disable this loading completely, to avoid having to worry about it at all. It may be a little overkill (and it's certainly not perfect), but it feels a little cleaner to have a complete opt-out that remains in the control of the app developer. In ASP.NET, our "plugin loading" system which will consume this additional deps file also has this "opt-out" functionality, but there could be cases where even loading the new deps file could be problematic to app developers, so having a global opt-out just seems like a Good Thing here ;). Ideally, this (/cc @DamianEdwards @glennc) |
|
Having a flag to override a feature that is opt-in by design sounds extremely odd to me. You should not set it for the app in question. |
|
It's not opt-in for the app, it's opt-in for the server/hoster.
…On Mar 15, 2017 12:11 PM, "Gaurav Khanna" ***@***.***> wrote:
Having a flag to override a feature that is opt-in by design sounds
extremely odd to me.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1727 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAPNADwbGo61VvwXYb-8Ggkf3qdKaqY6ks5rmDfSgaJpZM4Mb8C8>
.
|
Exactly. If I as an App Developer don't want hosters messing with my loaded app, I think it should be possible to disable this feature. |
|
But then why would they need to unconditionally apply to all apps? Why can't the app tell the host not do any "injection of plugins" so that the host only specifies the plugin deps for the apps that have not opted out. I do not see why the host has to participate in enabling override for something that is optional by design. IMHO, the server/hoster should do the right thing in determining to whom they can apply the flag. CC @richlander |
|
It definitely shouldn't apply to all apps, I'm talking about a way for an individual app to set a setting in their own |
My understanding is that an application does not ever know that such an injection may happen - such an injection is magic. This was one of the reasons why the idea to include plugin dependencies in the app.deps.json, at the time of the app publish, was turned down since the app would then need to know about this. What you are proposing above translates to app knowing about this even though we are claiming it is magical injection. I would assert that this is contradictory - either you make it explicit for the app to bring in (or not) the dependencies or handle things for them. The opt-in nature of the feature enables the server to exclude the injection from happening for apps that may choose to request. |
Agreed. If the web host wants to allow individual apps from opting out of this behavior, the host should have the flag to allow individual apps from opting out. Then the host doesn't set the Environment Variable, and it doesn't pass in |
| // application, then add them to the mix as well. | ||
| for (const auto& additional_deps : m_additional_deps) | ||
| { | ||
| auto additional_deps_entries = additional_deps->get_entries(deps_entry_t::asset_types::runtime); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| else | ||
| { | ||
| // We'll search deps files in 'base_dir'/shared/fx_name/fx_ver | ||
| append_path(&additional_deps_path, _X("shared")); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| { | ||
| // We'll search deps files in 'base_dir'/shared/fx_name/fx_ver | ||
| append_path(&additional_deps_path, _X("shared")); | ||
| append_path(&additional_deps_path, fx_name.c_str()); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
f7c07fb to
fa996c3
Compare
| for (pal::string_t json_file : m_additional_deps_files) | ||
| { | ||
| m_additional_deps.push_back(std::unique_ptr<deps_json_t>( | ||
| new deps_json_t(true, json_file, m_fx_deps->get_rid_fallback_graph()))); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| // We'll search deps files in 'base_dir'/shared/fx_name/fx_ver | ||
| append_path(&additional_deps_path, _X("shared")); | ||
| append_path(&additional_deps_path, fx_name.c_str()); | ||
| append_path(&additional_deps_path, fx_ver.c_str()); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
@eerhardt PR is updated to only support the feature for portable apps. |
| * graph in the build output. | ||
| * https://github.com/dotnet/cli/issues/2343 | ||
| */ | ||
| private static void ReplaceTestProjectOutputHostInTestProjectFixture(TestProjectFixture testProjectFixture) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| "version": "1.1.0", | ||
| "exclude": "all" | ||
| }, | ||
| "Microsoft.CSharp": { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
eerhardt
left a comment
There was a problem hiding this comment.
Just a few minor test comments.
| @@ -0,0 +1,17 @@ | |||
| { | |||
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Ported from PR #1630 and fixes https://github.com/dotnet/core-setup/issues/1597