having prefix='' by default is non standard and confusing

Bug #1590831 reported by Sebastien Bacher
26
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Snapcraft
New
Undecided
Unassigned
snapcraft (Ubuntu)
New
Undecided
Unassigned

Bug Description

The autotools plugin default to an empty prefix if you install by destdir (which is default), that's quite non standard and can create confusion, is there any reason to not use the upstream default (/usr/local) or the distribution default (/usr)?

I hit the issue while packaging gucharmap, the glib schemas got installed in $snap/share but the other schemas coming from the deb parts are in $snap/usr/share, our default wrapper set things to look in $snap/usr/share and it the program was not finding its schemas.

Things works after using "configflags: [--prefix=/usr]" but ideally that would be the default

summary: - having prefix='' by default is non standrd
+ having prefix='' by default is non standard
summary: - having prefix='' by default is non standard
+ having prefix='' by default is non standard and confusing
Revision history for this message
Kyle Fazzari (kyrofa) wrote :

First of all, I agree that an empty prefix is odd. However, the FHS of which /usr and /usr/local are a part really doesn't mean much when we're talking about snaps. For example, there's no concern about interoperability, or arch-dependent directories. The author could ship all binaries in $SNAP/bin and ship all config files in $SNAP/config, or just ship everything flat in the $SNAP, and it doesn't matter. I guess what I'm getting at is that using /usr or /usr/local as a default doesn't really seem to make sense in this context either.

Perhaps the best solution would be to remove the default prefix all together (if using destdir), so the project can use its own defaults. That way snapcraft doesn't try to force the "new" or the "old" ways of doing things upon projects by default. Would that work?

Changed in snapcraft:
status: New → Incomplete
Changed in snapcraft (Ubuntu):
status: New → Incomplete
Revision history for this message
Sebastien Bacher (seb128) wrote :

let me reverse the question, what's the issue with using "/usr" which is standard in our current world?

sure having a different prefix can be made to work, it's just going to create more work and issues, at least if we leverage our current ubuntu archive to make easier to bundle libraries and depends.

one example is the gsettings schemas, if you bundle libgtk-3-0 its schemas are going to be in $snap/usr/share, if the software you build also have a schemas with the current default it's going to go in $snap/share and things don't work out of the box

Changed in snapcraft:
status: Incomplete → New
Changed in snapcraft (Ubuntu):
status: Incomplete → New
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in snapcraft (Ubuntu):
status: New → Confirmed
Revision history for this message
Aaron Honeycutt (aaronhoneycutt) wrote :

While snapping pithos I hit this as well since it was looking in /share and not /usr/share.

Revision history for this message
Lucy Llewellyn (lucyllewy) wrote :

Same problem snapping Corebird. I have no further information to evolve the discussion though.

Revision history for this message
Sergio Schvezov (sergiusens) wrote :

What is your suggestion?

no longer affects: snapcraft (Ubuntu)
Changed in snapcraft:
status: New → Incomplete
Revision history for this message
Sebastien Bacher (seb128) wrote :

> What is your suggestion?

what I wrote in the bug description

"Things works after using "configflags: [--prefix=/usr]" but ideally that would be the default"

In case that was not explicit enough "use prefix='/usr' rather than prefix=''"

Changed in snapcraft:
status: Incomplete → New
Revision history for this message
Sebastien Bacher (seb128) wrote :

(oh and adding back the ubuntu component since that impacts the ubuntu version)

Revision history for this message
Sergio Schvezov (sergiusens) wrote : Re: [Bug 1590831] Re: having prefix='' by default is non standard and confusing

El 14/12/16 a las 09:40, Sebastien Bacher escribió:
> (oh and adding back the ubuntu component since that impacts the ubuntu
> version)

I cannot close Ubuntu bugs automatically as the release team has asked
me to only refer to SRU bugs in debian/changelog adding more manual tasks.

Revision history for this message
Sergio Schvezov (sergiusens) wrote :

El 14/12/16 a las 09:39, Sebastien Bacher escribió:
>> What is your suggestion?
> what I wrote in the bug description
>
> "Things works after using "configflags: [--prefix=/usr]" but ideally
> that would be the default"
>
>
> In case that was not explicit enough "use prefix='/usr' rather than prefix=''"

Why not --prefix=/?

Wouldn't prefix='' make things as location independent as possible?

Revision history for this message
Sebastien Bacher (seb128) wrote :

> I cannot close Ubuntu bugs automatically as the release team has asked
> me to only refer to SRU bugs in debian/changelog adding more manual tasks.

The bug is not targetting a stable serie of Ubuntu, you can maybe close it with the upload to zesty since there is no such rules there and strip the number for the SRU?

> Why not --prefix=/?

That wouldn't solve the problem described there where you use parts based on existing components like deb. It's also neither the upstream nor distro default value which makes it non-standard

> Wouldn't prefix='' make things as location independent as possible?

you can still do that in your snap if you want but I think compatibility with real world and what people already know is more important than looking independent...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.