libproxy: 0.4.18 -> 0.5.3#272353
Conversation
There was a problem hiding this comment.
If this still looks for GNOME settings, either a wrapper or patch (see makeHardcodeGsettingsPatch) will still be necessary.
There was a problem hiding this comment.
pxgsettings no longer exists.
There was a problem hiding this comment.
The new location seems to be https://github.com/libproxy/libproxy/tree/main/src/backend/plugins/config-gnome .
No idea if we need to wrap the proxy binary instead.
There was a problem hiding this comment.
proxy program is just a test tool so wrapping it will not help. Looks like the backends are all compiled into libpxbackend.
The only option is patching it as in #271037
There was a problem hiding this comment.
So, do we now wait for that PR or just hope people wrap?
There was a problem hiding this comment.
That PR only affects GTK. I meant is as an example what would have to be done here if we do not want even more wrappers everywhere.
There was a problem hiding this comment.
I have no experience with C/C++, so that would need to be done by someone else.
There was a problem hiding this comment.
I have pushed a patch + update script to update it (depends on #276828). The patch is suboptimal for now (the source is created multiple times) but at least it can be generated automatically.
ab73471 to
29225de
Compare
29225de to
526e9c6
Compare
63726c9 to
1b368a5
Compare
|
Just rebased the PR. I am not sure what needs to be done to merge this. |
|
We should probably check that it still works. Also it needs to target staging. |
1b368a5 to
d003872
Compare
I am not using gnome :/ but targeted staging |
|
I tried the following test case, which revealed the patch was insufficient (there was schema presence check which was not handled) so I pushed a fix. Unfortunately, it still returns let
pkgs = import ./. { };
testSrc = pkgs.writeText "test.py" ''
import gi
gi.require_version('Libproxy', '1.0')
from gi.repository import Libproxy
url = 'https://github.com/libproxy/libproxy'
pf = Libproxy.ProxyFactory()
proxies = pf.get_proxies(url)
print(proxies)
'';
in
pkgs.runCommand
"libproxy-test"
{
nativeBuildInputs = [
pkgs.glib
pkgs.gobject-introspection # For setup hook
];
buildInputs = [
(pkgs.python3.withPackages (pp: [
pp.pygobject3
]))
pkgs.libproxy
];
}
''
export HOME=$(mktemp -d)
export XDG_CURRENT_DESKTOP=GNOME
python3 "${testSrc}"
(
export XDG_DATA_DIRS=${pkgs.glib.getSchemaDataDirPath pkgs.gsettings-desktop-schemas}
gsettings set org.gnome.system.proxy mode manual
gsettings set org.gnome.system.proxy.http host localhost
gsettings set org.gnome.system.proxy.https host localhost
gsettings set org.gnome.system.proxy.https port 8080
# was it set correctly?
gsettings get org.gnome.system.proxy mode
gsettings get org.gnome.system.proxy.http host
gsettings get org.gnome.system.proxy.http port
gsettings get org.gnome.system.proxy.https host
gsettings get org.gnome.system.proxy.https port
)
# was it written?
cat ~/.config/glib-2.0/settings/keyfile
GSETTINGS_BACKEND=keyfile python3 "${testSrc}"
# touch "$out"
'' |
|
Looks like my test is failing just because there is no network connection in the sandbox. If I run the updated test case on my live system, it detects proxy correctly: $ gsettings set org.gnome.system.proxy mode manual
$ gsettings set org.gnome.system.proxy.http host localhost
$ gsettings set org.gnome.system.proxy.https host localhost
$ gsettings set org.gnome.system.proxy.https port 8080
$ PX_DEBUG=1 result/test
(process:137180): pxbackend-DEBUG: 16:03:16.330: px_config_sysconfig_set_config_file: Could not read file /etc/sysconfig/proxy
(process:137180): pxbackend-DEBUG: 16:03:16.330: Active config plugins:
(process:137180): pxbackend-DEBUG: 16:03:16.330: - config-env
(process:137180): pxbackend-DEBUG: 16:03:16.330: - config-kde
(process:137180): pxbackend-DEBUG: 16:03:16.330: - config-gnome
(process:137180): pxbackend-DEBUG: 16:03:16.330: - config-sysconfig
(process:137180): pxbackend-DEBUG: 16:03:16.334: px_manager_on_network_changed: Network connection changed, clearing pac data
(process:137180): pxbackend-DEBUG: 16:03:16.334: px_manager_constructed: Up and running
(process:137180): pxbackend-DEBUG: 16:03:16.334: px_manager_get_proxies_sync: url=https://github.com/libproxy/libproxy online=1
(process:137180): pxbackend-DEBUG: 16:03:16.334: px_manager_get_proxies_sync: Config[0] = http://localhost:8080
(process:137180): pxbackend-DEBUG: 16:03:16.334: px_manager_get_proxies_sync: Proxy[0] = http://localhost:8080
['http://localhost:8080']
(process:137180): pxbackend-DEBUG: 16:03:16.336: px_config_sysconfig_set_config_file: Could not read file /etc/sysconfig/proxy
(process:137180): pxbackend-DEBUG: 16:03:16.336: Active config plugins:
(process:137180): pxbackend-DEBUG: 16:03:16.336: - config-env
(process:137180): pxbackend-DEBUG: 16:03:16.336: - config-kde
(process:137180): pxbackend-DEBUG: 16:03:16.336: - config-gnome
(process:137180): pxbackend-DEBUG: 16:03:16.336: - config-sysconfig
(process:137180): pxbackend-DEBUG: 16:03:16.338: px_manager_on_network_changed: Network connection changed, clearing pac data
(process:137180): pxbackend-DEBUG: 16:03:16.338: px_manager_constructed: Up and runningAnd if I disconnect from network, it will fail on my live system the same way as the sandbox: $ PX_DEBUG=1 result/test
(process:136949): pxbackend-DEBUG: 16:03:01.921: px_config_sysconfig_set_config_file: Could not read file /etc/sysconfig/proxy
(process:136949): pxbackend-DEBUG: 16:03:01.921: Active config plugins:
(process:136949): pxbackend-DEBUG: 16:03:01.921: - config-env
(process:136949): pxbackend-DEBUG: 16:03:01.921: - config-kde
(process:136949): pxbackend-DEBUG: 16:03:01.921: - config-gnome
(process:136949): pxbackend-DEBUG: 16:03:01.921: - config-sysconfig
(process:136949): pxbackend-DEBUG: 16:03:01.924: px_manager_on_network_changed: Network connection changed, clearing pac data
(process:136949): pxbackend-DEBUG: 16:03:01.924: px_manager_constructed: Up and running
(process:136949): pxbackend-DEBUG: 16:03:01.924: px_manager_get_proxies_sync: url=https://github.com/libproxy/libproxy online=0
['direct://']
(process:136949): pxbackend-DEBUG: 16:03:01.926: px_config_sysconfig_set_config_file: Could not read file /etc/sysconfig/proxy
(process:136949): pxbackend-DEBUG: 16:03:01.926: Active config plugins:
(process:136949): pxbackend-DEBUG: 16:03:01.926: - config-env
(process:136949): pxbackend-DEBUG: 16:03:01.926: - config-kde
(process:136949): pxbackend-DEBUG: 16:03:01.926: - config-gnome
(process:136949): pxbackend-DEBUG: 16:03:01.926: - config-sysconfig
(process:136949): pxbackend-DEBUG: 16:03:01.927: px_manager_on_network_changed: Network connection changed, clearing pac data
(process:136949): pxbackend-DEBUG: 16:03:01.927: px_manager_constructed: Up and runningUpdated test caselet
pkgs = import <nixpkgs> { };
testSrc = pkgs.writeText "test.py" ''
#!/usr/bin/env python3
import gi
gi.require_version('Libproxy', '1.0')
from gi.repository import Libproxy
url = 'https://github.com/libproxy/libproxy'
pf = Libproxy.ProxyFactory()
proxies = pf.get_proxies(url)
print(proxies)
'';
in
pkgs.runCommand
"libproxy-test"
{
nativeBuildInputs = [
pkgs.glib
pkgs.makeWrapper
pkgs.gobject-introspection # For setup hook
];
buildInputs = [
(pkgs.python3.withPackages (pp: [
pp.pygobject3
]))
pkgs.libproxy
];
}
''
export HOME=$(mktemp -d)
export GSETTINGS_BACKEND=keyfile
export PX_DEBUG=1
export XDG_CURRENT_DESKTOP=GNOME
python3 "${testSrc}"
(
export XDG_DATA_DIRS=${pkgs.glib.getSchemaDataDirPath pkgs.gsettings-desktop-schemas}
gsettings set org.gnome.system.proxy mode manual
gsettings set org.gnome.system.proxy.http host localhost
gsettings set org.gnome.system.proxy.https host localhost
gsettings set org.gnome.system.proxy.https port 8080
# was it set correctly?
gsettings get org.gnome.system.proxy mode
gsettings get org.gnome.system.proxy.http host
gsettings get org.gnome.system.proxy.http port
gsettings get org.gnome.system.proxy.https host
gsettings get org.gnome.system.proxy.https port
)
# was it written?
cat ~/.config/glib-2.0/settings/keyfile
# python3 "${testSrc}"
mkdir -p "$out"
cp "${testSrc}" "$out/test"
chmod +x "$out/test"
patchShebangs --host "$out/test"
wrapProgram "$out/test" --prefix "GI_TYPELIB_PATH" ":" "${pkgs.libproxy}/lib/girepository-1.0"
''And reset the settings with: gsettings reset org.gnome.system.proxy mode
gsettings reset org.gnome.system.proxy.http host
gsettings reset org.gnome.system.proxy.https host
gsettings reset org.gnome.system.proxy.https port |
|
I have rebased and enabled tests. I think it is now good to merge. |
|
@SuperSandro2000 do you agree this would be good to have in 24.05? |
https://github.com/libproxy/libproxy/releases/tag/libproxy-0.5.0 https://github.com/libproxy/libproxy/releases/tag/0.5.1 https://github.com/libproxy/libproxy/releases/tag/0.5.2 https://github.com/libproxy/libproxy/releases/tag/0.5.3 Complete rewrite of the project, reduces runtime closure significantly. Co-authored-by: Jan Tojnar <jtojnar@gmail.com>
2f6cc3a to
3e6ae42
Compare
|
Now or never 👍🏼 |
|
|
Hopefully resolved in 107ae55. |
|
Confirmed ❤️ |
|
There's include dependency on glib, apparently: https://hydra.nixos.org/build/256292509/nixlog/1/tail I wonder if it would be best (for the long term) to ensure that they're met, either by |
|
Wait... that derivation does have glib in build inputs (and it's even shown as detected in the log). I don't get how that include error happens; I don't expect it's really related to libproxy. EDIT: pushed a workaround at least: c5910ff |
|
Looks like this is another issue caused by us interpreting |
|
Right, pushed as 3a48b90 |
Description of changes
Closes #241762
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.