pervoj / valdo-gtk

Create new Vala projects from templates
https://pervoj.cz/valdo-gtk/
GNU General Public License v3.0
12 stars 4 forks source link

Git can not be run from Flatpak #3

Closed juxuanu closed 2 years ago

juxuanu commented 3 years ago

I installed from Flathub, I see this: imatge Now, I gave it $HOME read and write permissions with Flatseal. Still, the same issue.

pervoj commented 3 years ago

Does the valdotest directory already exist in vala?

pervoj commented 3 years ago

I made a small change that might solve this issue. Can you please install Valdo GTK from Actions and try if the issue persists?

https://github.com/pervoj/valdo-gtk/actions/runs/1094849651

juxuanu commented 3 years ago

Does the valdotest directory already exist in vala?

It does not. But I created it and it still spits the same error.

I made a small change that might solve this issue. Can you please install Valdo GTK from Actions and try if the issue persists?

https://github.com/pervoj/valdo-gtk/actions/runs/1094849651

I tried this build, but upon clicking the Create button, I get the following:

** (valdo-gtk:2): CRITICAL **: 11:29:43.259: valdo_template_engine_apply_template: assertion 'current_dir != NULL' failed

(valdo-gtk:2): GLib-GIO-CRITICAL **: 11:29:43.259: g_file_get_path: assertion 'G_IS_FILE (file)' failed

And nothing happens (the directory remains empty)

pervoj commented 3 years ago

I didn't know that using fix in the commit would close the issue. Sorry for that.

I think now it should work. So please try latest build: https://github.com/pervoj/valdo-gtk/actions/runs/1097246542

juxuanu commented 3 years ago

Ok, now the files get created successfully. Although an issue remains:

β•°β”€πŸš€ flatpak --user run cz.pervoj.valdo-gtk   

** (valdo-gtk:2): WARNING **: 12:14:41.196: templateengine.vala:165: could not initialize a git repository - Failed to execute child process β€œgit” (El fitxer o directori no existeix)

(valdo-gtk:2): GLib-GIO-CRITICAL **: 12:14:41.197: g_file_get_path: assertion 'G_IS_FILE (file)' failed

"El fitxer o directori no existeix" <=> "The file or directory doesn't exist"

I am guessing this is a container's permissions issue?

pervoj commented 3 years ago

That's possible. Can you please try to build the application on your own and see if the error persists?

It's strange that a project is created and then suddenly doesn't exist.

juxuanu commented 3 years ago

I think that the error message refers to the git command not being found, not the project itself. From within Flatpak, it cannot access git.

pervoj commented 3 years ago

Maybe. I tried it for myself and it works fine when running from code, but when running from Flatpak I get the same error. I'll try to do something about it.

pervoj commented 3 years ago

When running from the sandbox, I disabled features that are not available in the sandbox. I can't disable Git repository creation only because it's a Valdo feature. Hopefully this is an acceptable solution. Sadly though, Flatpak is currently the only way to install the app.

juxuanu commented 3 years ago

I know you can include your own programs into the flatpak package (and compile them aswell). You could try to include git inside the flatpak package.

pervoj commented 3 years ago

Yes, I know, but I don't want to include whole git when I need only creating a new respository.

juxuanu commented 3 years ago

You could then generate a .git directory without git. Since project generation is always with the same files and there is no commit at the beginning, it could be easy.

pervoj commented 3 years ago

Yes, but git repo creating is doing Valdo, not Valdo GTK. This is only frontend, which is using Valdo classes.

I think git repo creation is simple process, which can everyone do on his own. So I think I won't implement this feature in other way then is Valdo doing.

pervoj commented 3 years ago

I sent the PR to the Valdo repository with the edit. I will fix it as soon as the merge is done.