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

Snap installation not compatible with modules #1222

Closed
jmooring opened this issue Sep 8, 2020 · 13 comments
Closed

Snap installation not compatible with modules #1222

jmooring opened this issue Sep 8, 2020 · 13 comments

Comments

@jmooring
Copy link
Member

jmooring commented Sep 8, 2020

There have been two (probably three) reports:

This limitation should be documented here:
https://gohugo.io/getting-started/installing/#linux

@jmooring
Copy link
Member Author

jmooring commented Sep 8, 2020

From time to time I question the value of maintaining a snap installer. Problems:

  1. Go modules (this issue)
  2. PostCSS is broken (Postcss error with snap install of Hugo 0.70 hugo#7278)
  3. Limited to $HOME access (discussion here: Issue with the snap installed version hugo#3143)

Snaps are great for accessory applications such as calculators, music players, and the like, but I feel that the snap security model hinders rather than helps when running some development apps.

@bep
Copy link
Member

bep commented Sep 8, 2020

Yea, Snap was sold to me as something "maintainance free", but I @anthonyfok (and I and others) have spent countless hours making it ... work.

@jmooring
Copy link
Member Author

jmooring commented Sep 8, 2020

Perhaps those hours would be better spent on other things. I have no idea what percentage of total installs are snaps.

@bep
Copy link
Member

bep commented Sep 8, 2020

What do you think @anthonyfok ?

@anthonyfok
Copy link
Member

Hi all,
Thanks for the @ mention, bep, as indeed I haven't been following the issues and was not aware of the new problems end users are experiencing with the Hugo snap build.

Snaps are great for accessory applications such as calculators, music players, and the like, but I feel that the snap security model hinders rather than helps when running some development apps.

That's a good point, and actually, there are security models to choose from. From https://snapcraft.io/docs/choosing-a-security-model:

Confinement can be one of the following:

devmode: enables system access and logging only while creating a snap
strict: denies all system access other than through a snap’s interfaces
classic: permits full system-level access, analogous to a deb or rpm installation.

I was hesitant in changing the confinement setting from strict (the default) to classic, but seeing the new problems that users run into, I think that changing to classic confinement would resolve most if not all existing issues, and give a better end-user experience.

Should I go ahead and start changing confinement from strict to classic? There will be a review and approval process as documented in https://snapcraft.io/docs/reviewing-classic-confinement-snaps, but that is a one-time thing that shouldn't take too long.

@jmooring
Copy link
Member Author

jmooring commented Sep 9, 2020

For reference. Installation instructions from https://snapcraft.io:

App Instructions
vscode sudo snap install code --classic
atom sudo snap install atom --classic
sublime sudo snap install sublime-text --classic
go sudo snap install go --classic
hugo sudo snap install hugo

@bep
Copy link
Member

bep commented Sep 9, 2020

Is it possible for people today to use:

sudo snap install hugo --classic

If so, we could educate people about that?

@jmooring
Copy link
Member Author

jmooring commented Sep 9, 2020

snap install hugo --channel=extended --classic

Warning: flag --classic ignored for strictly confined snap hugo

anthonyfok added a commit to gohugoio/hugo that referenced this issue Sep 10, 2020
@anthonyfok
Copy link
Member

I have just submitted a "Request for classic confinement for hugo snap" on the Snapcraft forum at

https://forum.snapcraft.io/t/request-for-classic-confinement-for-hugo-snap/19892

as a step forward to switching to classic confinement, though the Snapcraft Team usually discourages the use of classic confinement unless absolutely necessary, and may instead offer helpful advice and workarounds which would solve our problems without switching to classic confinement. We'll see what happens. Everyone reading this, please feel free to join the discussion over there.

@jmooring
Copy link
Member Author

@anthonyfok, the snapcraft team closed your request for classic confinement. They pinged you several times, then gave up.
https://forum.snapcraft.io/t/request-for-classic-confinement-for-hugo-snap/19892/8

@davidsneighbour
Copy link
Contributor

So, there are people who have not much to do with Go and Hugo that decide if it's worth having Hugo being "confined" to classic mode? That's some kind of "Peter Parker principle" gone wrong. Like @jmooring said above: Why having a snap Hugo? Is there a flatpack package? Is there an appimage package? The principal of a snap package is that it's able to run in it's own environment. Hugo can't. So why keep trying it "officially"? Someone with time and calm at their hands could maintain an unofficial package?

@nobuto-m
Copy link

My current and temporary workaround is alias hugo=/snap/hugo/current/bin/hugo which will be able to access to system's go binary.

@jmooring
Copy link
Member Author

This issue was rolled into gohugoio/hugo#9078.

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

5 participants