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

Upgrade dependencies #78

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Upgrade dependencies #78

wants to merge 8 commits into from

Conversation

Gigas002
Copy link

Mostly minor/non-breaking updates, here's some notables:

@rharish101
Copy link
Owner

I rebased this on the latest main, but unfortunately, clap isn't working with the --demo argument. Specifically, it just outputs the following line:

Unknown option --demo

Using any bogus argument, like --test, returns a well-formatted output:

error: unexpected argument '--test' found

Usage: regreet [OPTIONS]

For more information, try '--help'.

@Gigas002
Copy link
Author

Gigas002 commented Aug 3, 2024

Ack, will take a look into it

@Gigas002
Copy link
Author

Gigas002 commented Aug 3, 2024

It seems like the clap reading args correctly, but everything fails up here:

// main.rs
app.run_with_args(&args);

When this line is called, args are correct, but something fails further, into dependency. I think it's gio, which is a dependency of gtk, here to blame, since it fails on:

ffi::g_application_run(self.as_ref().to_glib_none().0, argc, argv.to_glib_none().0)

Will investigate/report upstream further

@rharish101
Copy link
Owner

Is it possible that GTK is also parsing the CLI arguments for itself? That might explain why it crashes, because --demo shouldn't be a default GTK CLI argument.

@Gigas002
Copy link
Author

Gigas002 commented Aug 3, 2024

After some thinking, I think it;s relm4 issue actually.

In version 0.5.1, which is in a main branch of ReGreet, the run_async function calls only the app.run_with_args(args); in it's body with empty args in our case. gio's run_with_args function then just continues the execution without attmepts to read args manually.

But in latest version of relm4, the run_async checks if args have been passed, and then runs gio's app.run();, which, under the hood, attempts to read args from command line and fails to recognize demo.

As a dirty hack, we can change the line to execute ReGreet as:

    app.with_args(vec![]).run_async::<Greeter>(GreeterInit {
        config_path: args.config,
        css_path: args.style,
        demo: args.demo,
    });

This works, but...
I'm sure it's to be reported upstream, rather than writing this. Note, that we have to initialize the empty vec here, None won't pass the check and relm4 will try to run args initialization via gio.

@rharish101
Copy link
Owner

rharish101 commented Aug 3, 2024

Ah, in that case, let's raise an issue upstream first and see how long they take to fix it and tag a release. If it takes too long, we could just add this hack.

@Gigas002
Copy link
Author

Gigas002 commented Aug 3, 2024

Created an issue for this problem, trackable here: Relm4/Relm4#667

@Gigas002
Copy link
Author

Gigas002 commented Aug 14, 2024

I think it's kinda safe to introduce a workaround for now. It seems like relm4 is not very active lately, so I doubt they'll fix it soon.
Should I add it? @rharish101

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.

2 participants