Opened 8 months ago

Closed 8 months ago

#68188 closed defect (fixed)

synfigstudio @1.4.4_1: touch: /opt/local/share/mime/packages: Operation not permitted

Reported by: cooljeanius (Eric Gallager) Owned by: mascguy (Christopher Nielsen)
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: Cc: ryandesign (Ryan Carsten Schmidt)
Port: shared-mime-info

Description

Looks like synfigstudio is attempting to skip the destroot and modify the filesystem directly:

make[3]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_synfig/synfigstudio/work/synfigstudio-1.4.4'
/opt/local/bin/update-mime-database "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_synfig/synfigstudio/work/destroot/opt/local/share/mime"
touch: /opt/local/share/mime/packages: Operation not permitted
make[3]: *** [install-data-hook] Error 1
make[3]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_synfig/synfigstudio/work/synfigstudio-1.4.4'
make[2]: *** [install-data-am] Error 2
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_synfig/synfigstudio/work/synfigstudio-1.4.4'
make[1]: *** [install-am] Error 2
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_synfig/synfigstudio/work/synfigstudio-1.4.4'
make: *** [install-recursive] Error 1
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_synfig/synfigstudio/work/synfigstudio-1.4.4'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_synfig/synfigstudio/work/synfigstudio-1.4.4" && /usr/bin/make -w install DESTDIR=/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_synfig/synfigstudio/work/destroot 
Exit code: 2
Error: Failed to destroot synfigstudio: command execution failed
DEBUG: Error code: CHILDSTATUS 64143 2

Isn't updating the mime database usually done in a post-activate block anyways?

Change History (10)

comment:1 Changed 8 months ago by mascguy (Christopher Nielsen)

Owner: set to mascguy
Status: newassigned

Since this involves shared-mime-info, I'll take a look.

comment:2 Changed 8 months ago by ryandesign (Ryan Carsten Schmidt)

Huh. But we have successful builds on all buildbot systems except Lion.

comment:3 Changed 8 months ago by mascguy (Christopher Nielsen)

Isn't updating the mime database usually done in a post-activate block anyways?

Yes it is, and that's precisely what this port is doing:

    post-activate {
        system "${prefix}/bin/update-mime-database ${prefix}/share/mime"
    }

    post-deactivate {
        system "${prefix}/bin/update-mime-database ${prefix}/share/mime"
    }

comment:4 in reply to:  2 Changed 8 months ago by mascguy (Christopher Nielsen)

Replying to ryandesign:

Huh. But we have successful builds on all buildbot systems except Lion.

The Lion failure might have been caused by an earlier version of shared-mime-info, which was subsequently fixed. Just queued a rebuild, to see if all is well.

comment:5 Changed 8 months ago by mascguy (Christopher Nielsen)

Are you running without sudo?

comment:6 Changed 8 months ago by mascguy (Christopher Nielsen)

Port: shared-mime-info added

Ah, I'm able to reproduce on 10.15 too. And this is a bug in shared-mime-info, specifically script update-mime-database: The latter is supposed to accept the path via an argument, but instead is hard-coded to use ${prefix}/share/mime/packages.

EDIT: This isn't the problem after all. See comment:7

Last edited 8 months ago by mascguy (Christopher Nielsen) (previous) (diff)

comment:7 in reply to:  6 ; Changed 8 months ago by mascguy (Christopher Nielsen)

Port: shared-mime-info removed

Replying to mascguy:

Ah, I'm able to reproduce on 10.15 too. And this is a bug in shared-mime-info, specifically script update-mime-database: The latter is supposed to accept the path via an argument, but instead is hard-coded to use ${prefix}/share/mime/packages.

Actually, this isn't the problem after all: Instead, upstream runs update-mime-database by default, via their install. And that needs to be disabled, via the following configure argument:

$ ./configure --help | ggrep "mime"
  --disable-update-mimedb disable the update-mime-database after install

And adding that flag fixes the issue, based on local testing.

Ryan, can I go ahead and commit a fix for that, or would you prefer to? (That one additional flag is all that's needed.)

comment:8 in reply to:  7 ; Changed 8 months ago by ryandesign (Ryan Carsten Schmidt)

Replying to mascguy:

Replying to ryandesign:

But we have successful builds on all buildbot systems except Lion.

The Lion failure might have been caused by an earlier version of shared-mime-info, which was subsequently fixed. Just queued a rebuild, to see if all is well.

It fails with an unrelated configure issue. I didn't want to dwell on the Lion issue in this ticket; I just wanted to point out that it succeeded everywhere else.

Replying to mascguy:

upstream runs update-mime-database by default, via their install. And that needs to be disabled, via the following configure argument:

$ ./configure --help | ggrep "mime"
  --disable-update-mimedb disable the update-mime-database after install

And adding that flag fixes the issue, based on local testing.

Ryan, can I go ahead and commit a fix for that, or would you prefer to? (That one additional flag is all that's needed.)

You can add; it seems reasonable. But I don't understand why we didn't see the problem on the buildbot.

comment:9 in reply to:  8 Changed 8 months ago by mascguy (Christopher Nielsen)

Port: shared-mime-info added; synfigstudio removed

Replying to ryandesign:

Replying to mascguy:

Ryan, can I go ahead and commit a fix for that, or would you prefer to? (That one additional flag is all that's needed.)

You can add; it seems reasonable. But I don't understand why we didn't see the problem on the buildbot.

The reason it didn't fail previously, is that we subsequently made changes to shared-mime-info. And specifically, update-mime-database is now a simple stub script, which touches the mime packages directory. And that, in turn, kicks off the daemon... which takes care of the real update.

So given all that, it's really shared-mime-info that needs to be fixed, rather than synfigstudio. Will commit a fix shortly.

comment:10 Changed 8 months ago by Christopher Nielsen <mascguy@…>

Resolution: fixed
Status: assignedclosed

In 5434013047a9976ccf74a846d888bfdf5afb5bba/macports-ports (master):

shared-mime-info: stub script: add path checks

  • For ports like 'synfigstudio', which run 'update-mime-database' for a destroot path, ensure we don't fail.

See: #45396
Fixes: #68188

Note: See TracTickets for help on using tickets.