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

glib-networking: clean up & add installed tests #67957

Merged
merged 11 commits into from Sep 3, 2019

Conversation

jtojnar
Copy link
Contributor

@jtojnar jtojnar commented Sep 2, 2019

  • built glib-networking
  • ran glib-networking.tests
  • checked that nothing relies on the dependencies formerly propagated (nix-review?)

So that this can be loaded from programs not depending on gsettings-desktop-schemas.

Currently, this patch is much uglier than it could be due to
https://gitlab.gnome.org/GNOME/glib/issues/1884
@jtojnar jtojnar mentioned this pull request Sep 3, 2019
6 tasks
find "$installedTests/libexec" -type f -executable -print0 \
| while IFS= read -r -d "" file; do
echo "Wrapping program '$file'"
wrapProgram "$file" --prefix GIO_EXTRA_MODULES : "$out/lib/gio/modules"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why just the gio modules? Couldn't we use wrapGAppsHook, disable it, and wrap them with its args?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I do not want to introduce dependencies on GTK, librsvg etc.

Copy link
Contributor

Choose a reason for hiding this comment

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

Right, can we make note of that so someone doesn't refactor it to this down the line?

Copy link
Contributor Author

@jtojnar jtojnar Sep 3, 2019

Choose a reason for hiding this comment

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

Can we fix the assumptions about wrapGAppsHook instead? It even has apps in the name.

I really need to finish #43150

Copy link
Contributor

Choose a reason for hiding this comment

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

I really need to finish #43150

I do have notes locally on some things I wanted to add to #43150 but documentation writing escapes me also.
Though it would be good, just even as a start, to merge the parts about wrapGAppsHook which I believe was your original intent with this.

Can we fix the assumptions about wrapGAppsHook instead? It even has apps in the name.

When you say "it has apps in the name", it's confusing when it would be used for executables in a library?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I do have notes locally on some things I wanted to add to #43150 but documentation writing escapes me also.

I guess I will try to work on I today.

Though it would be good, just even as a start, to merge the parts about wrapGAppsHook which I believe was your original intent with this.

Yeah keeping the scope narrow will make it easier to consider it mergeable. It is just bad that the wrapper connects so much stuff.

When you say "it has apps in the name", it's confusing when it would be used for executables in a library?

For me, an app is primarily a graphical program that a person can use to carry out some task. Though there can be console apps for which we would not want to depend on GTK either. I would not consider such helper of library to be an app.

Copy link
Contributor

Choose a reason for hiding this comment

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

I do have notes locally on some things I wanted to add to #43150 but documentation writing escapes me also.

I guess I will try to work on I today.

Though it would be good, just even as a start, to merge the parts about wrapGAppsHook which I believe was your original intent with this.

Yeah keeping the scope narrow will make it easier to consider it mergeable. It is just bad that the wrapper connects so much stuff.

Great, I'd be happy to follow up on it once it's merged. And our roadmap can include what needs to be documented in the future.

@worldofpeace
Copy link
Contributor

Huh, why does libsoup have?

propagatedUserEnvPackages = [ glib-networking.out ];

(in passthru)

@worldofpeace
Copy link
Contributor

worldofpeace commented Sep 3, 2019

checked that nothing relies on the dependencies formerly propagated (nix-review?)

Hmm, maybe we can use staging-next for this 😄
Thinking it's low likelihood.

Also, I think glib-networking has the glib-pacrunner. Could that do with any wrapping?

@jtojnar
Copy link
Contributor Author

jtojnar commented Sep 3, 2019

Huh, why does libsoup have?

propagatedUserEnvPackages = [ glib-networking.out ];

(in passthru)

I suspect that is because we cannot add wrappers to libraries and we wanted to add TLS support to libsoup.

@jtojnar
Copy link
Contributor Author

jtojnar commented Sep 3, 2019

checked that nothing relies on the dependencies formerly propagated (nix-review?)

Hmm, maybe we can use staging-next for this smile
Thinking it's low likelihood.

Yeah looking through the reverse dependencies there do not seem to be any obvious issues.

@jtojnar
Copy link
Contributor Author

jtojnar commented Sep 3, 2019

Also, I think glib-networking has the glib-pacrunner. Could that do with any wrapping?

They use g_proxy_resolver_lookup_async so apparently, yes.

Copy link
Contributor

@worldofpeace worldofpeace left a comment

Choose a reason for hiding this comment

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

Builds and tests passes.

@worldofpeace worldofpeace merged commit 42f63ff into NixOS:staging Sep 3, 2019
@jtojnar jtojnar deleted the glib-networking-cleanup branch September 3, 2019 14:55
@jtojnar
Copy link
Contributor Author

jtojnar commented Sep 4, 2019

By the way, I used Coccinelle to create a base patch here as well:

spatch --sp-file hardcode-gsettings.cocci --dir proxy/ --in-place

@r1@
expression GSETTINGS_SCHEMA;
expression settings;
@@
- settings = g_settings_new (GSETTINGS_SCHEMA);
+ {
+ GSettingsSchemaSource *schema_source;
+ GSettingsSchema *schema;
+ schema_source = g_settings_schema_source_new_from_directory ("@gds_gsettings_path@",  g_settings_schema_source_get_default (), TRUE, NULL);
+ schema = g_settings_schema_source_lookup (schema_source, GSETTINGS_SCHEMA, FALSE);
+ settings = g_settings_new_full (schema, NULL, NULL);
+ g_settings_schema_source_unref (schema_source);
+ g_settings_schema_unref (schema);
+ }

Due to this GLib bug, I had to use a second patch:

@r2@
expression CHILD_SCHEMA;
expression settings;
expression parent_settings;
@@
- settings = g_settings_get_child (parent_settings, CHILD_SCHEMA);
+ {
+ GSettingsSchemaSource *schema_source;
+ GSettingsSchema *schema;
+ schema_source = g_settings_schema_source_new_from_directory ("@gds_gsettings_path@", g_settings_schema_source_get_default (), TRUE, NULL);
+ schema = g_settings_schema_source_lookup (schema_source, CHILD_SCHEMA, FALSE);
+ settings = g_settings_new_full (schema, NULL, NULL);
+ g_settings_schema_source_unref (schema_source);
+ g_settings_schema_unref (schema);
+ }

and then had to modify the files with sed -i 's/GNOME_PROXY_.*_CHILD_SCHEMA,/GNOME_PROXY_SETTINGS_SCHEMA "." \0/g' hardcode-gsettings.patch because Coccinelle complained about parse error when I tried to build the child schema id directly in the cocci patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants