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

Elementary OS default folder in home dir is replaced with symbolic links #210

Open
pracedru opened this issue Aug 10, 2020 · 13 comments
Open

Comments

@pracedru
Copy link

pracedru commented Aug 10, 2020

I have experienced a bug that seems to be related to Elementary OS.
When installing my application Folkfinder on Elementary OS 5.1 Hera the default folders in the home dir are replaced with symbolic links that point to them selves:
Video documentation of bug
List of home folder before and after app has been run:
image
Output from snap:
image
My snap yaml file for Folkfinder:
https://gitlab.com/folkfinder/folkfinder-snap/-/blob/master/snap/snapcraft.yaml

@popey
Copy link

popey commented Aug 10, 2020

I wonder if this is partly caused by:

    environment:
      HOME: /home/$USER

Can you try building and installing without that?

@pracedru
Copy link
Author

Sure i will do.

@pracedru
Copy link
Author

pracedru commented Aug 10, 2020

I wonder if this is partly caused by:

    environment:
      HOME: /home/$USER

Can you try building and installing without that?

Removing this changed the behavior.
The sym links are no longer created. But also the app doesn't have access to the files in the home folder.
Could this be a QT related issue?

@popey
Copy link

popey commented Aug 10, 2020

I can reproduce the issue with the version of folkfinder in stable. The version in candidate does not change the files in home. However both versions can see files in home just fine. I don't understand what you mean by "the app doesn't have access to the files in the home folder"? Please detail what you see and what you should see.

@pracedru
Copy link
Author

I can reproduce the issue with the version of folkfinder in stable. The version in candidate does not change the files in home. However both versions can see files in home just fine. I don't understand what you mean by "the app doesn't have access to the files in the home folder"? Please detail what you see and what you should see.

I just downloaded some random images to the Pictures folder from the internet, to see if I could select and view them.

@kenvandine
Copy link
Member

I just tried the version in candidate, has no issues accessing content in ~/Pictures. I am seeing lots of dconf errors, I think this snap needs the gsettings plug.

@pracedru
Copy link
Author

pracedru commented Aug 10, 2020

I just tried the version in candidate, has no issues accessing content in ~/Pictures. I am seeing lots of dconf errors, I think this snap needs the gsettings plug.

Ok I will add the gsettings like this:
image

And try again.

@kenvandine
Copy link
Member

You really shouldn't set HOME there, and shouldn't need to. You also can't assume a user's homedir will be /home/$USER.

@pracedru
Copy link
Author

You really shouldn't set HOME there, and shouldn't need to. You also can't assume a user's homedir will be /home/$USER.

I am not the original author of this.
I will ask the author why this was done.

@pracedru
Copy link
Author

pracedru commented Aug 10, 2020

When running with this new setup i get this in Ubuntu:
image
The home folder defaults into the snap folder .
I get the Qt file dialogs for some reason and the qt5ct style looks strange.
The default folders are not bookmarked in the file dialog.
I Elementary i get this:
image
The home folder defaults into the snap folder but there is a bookmark to the users home folder by name in the bottom.
The qt5ct style looks correct.
The filedialog is correctly set to the default system dialog.
The bookmarks to the default folders do point to the correct folders in the home dir.

Also the app can see the files on both OS'es (my bad)

@bigpod98
Copy link

I am the original author of the code he was copying, during my testing and looking trought different opensource project's snapcraft.yaml's i found thos environment variable being set and it was one which solved the problem while i already guessed this wasnt proper solution and am intent of properly configuring it when i have enought time to properly figure out what i need to do.

Why exacly is this envvar included in my snapcraft.yaml it is because this was the only way i could get right home directory in file dialogs like you can see above

@pracedru
Copy link
Author

Also the app can see the files on both OS'es (my bad)

I had downloaded two files with the extensions .gif and .jpeg.
But I had not included them in the file filter in the FolderView.

@bigpod98
Copy link

Both projects that i manage have been privated because of this code and we have discovered another unrelated bug.

Problem as it goes is that no mazter how we set it up we need to assume users have standard /home/$USER home directory because while inside python code we cannot in any other way besides hardcoding access home directory we tried using both xdg_home_dir(or something like that) but that uses ~ and when using ~ home directory it will resolve to is the snaps directory inside users home directory(~/snap/{snapname}/current(or revision number)or common cant remember exacly) /) which isnt intended behaveour.
What can we use then

Im sorry for all your trubble

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

No branches or pull requests

4 participants