RJVB / macstrop

RJVB's repository of alternative macports, with ports missing from or overriding those in the standard collection, including a set of KF5 ports.
20 stars 9 forks source link

ffmpeg-dev: destroot issue #97

Closed 21stcaveman closed 8 months ago

21stcaveman commented 8 months ago

Hello again,

Now having issues with destroot stage of the newly created port, ffmpeg-dev.

This is the error in main.log: :debug:destroot Executing org.macports.destroot (ffmpeg-dev) :debug:destroot system -W /opt/local/var/devcontent: bsdtar -xOf /opt/local/var/macports/software/ffmpeg/ffmpeg-4.4.4_4+gpl2.darwin_23.x86_64.tbz2 ./opt/local/var/devcontent/ffmpeg@4.4.4-dev.tar.bz2 > ffmpeg@4.4.4-dev.tar.bz2 :info:destroot sh: ffmpeg@4.4.4-dev.tar.bz2: Operation not permitted :info:destroot Command failed: bsdtar -xOf /opt/local/var/macports/software/ffmpeg/ffmpeg-4.4.4_4+gpl2.darwin_23.x86_64.tbz2 ./opt/local/var/devcontent/ffmpeg@4.4.4-dev.tar.bz2 > ffmpeg@4.4.4-dev.tar.bz2 :info:destroot Exit code: 1

Trying to run command manually, I get: % bsdtar -xOf /opt/local/var/macports/software/ffmpeg/ffmpeg-4.4.4_4+gpl2.darwin_23.x86_64.tbz2 ./opt/local/var/devcontent/ffmpeg@4.4.4-dev.tar.bz2 > ffmpeg@4.4.4-dev.tar.bz2 bsdtar: ./opt/local/var/devcontent/ffmpeg@4.4.4-dev.tar.bz2: Not found in archive bsdtar: Error exit delayed from previous errors.

RJVB commented 8 months ago

Wow, you're really an expert at exposing regressions in unexpected places! What exactly were you trying to do? These devports are not intended to be installed manually!

21stcaveman commented 8 months ago

I try :)) consider me the annoying QA person :D

I'm still going through upgrades, so this popped up with sudo port upgrade outdated

RJVB commented 8 months ago

So you already had ffmpeg-dev installed? Still weird (I think) that it tries to upgrade the port as if you did it manually. I haven't tried upgrade outdated on my system but I understand that your port:acl and port:acl-dev were upgraded after your previous ticket and port:ffmpeg{,-dev} should have worked the same way.

Can you tell whether port:ffmpeg was already updated? It should have been since that is a dependency of port:ffmpeg-dev !

Anyway, I pushed some changes which should at least take care of the permissions error.

21stcaveman commented 8 months ago

seems like it. ffmpeg itself was updated, no issues.

After pulling the new changes, ran the upgrade again, and this is what I get: :debug:destroot Executing proc-pre-org.macports.destroot-destroot-0 :debug:destroot sandbox_enable=yes portsandbox_profile=(version 1) (allow default) (deny file-write) (allow file-write-data (literal "/dev/null") (literal "/dev/zero") (literal "/dev/dtracehelper") (literal "/dev/tty") (literal "/dev/stdin") (literal "/dev/stdout") (literal "/dev/stderr") (literal "/dev/random") (literal "/dev/urandom") (regex #"^/dev/fd/")) (allow file-write (regex #"^(/private)?(/var)?/tmp/" #"^(/private)?/var/folders/" #"^(/private)?/var/db/mds/")) (allow file-write-data (regex #"^/dev/ttys") (literal "/dev/ptmx")) (allow file-write-mode (regex #"^/dev/ttys")) (allow file-write (subpath "/opt/local/var/macports/build/_opt_local_site-ports_multimedia_ffmpeg/ffmpeg-dev/work")) (allow file-write-setugid (subpath "/opt/local/var/macports/build/_opt_local_site-ports_multimedia_ffmpeg/ffmpeg-dev/work")) (allow file-write (subpath "/opt/local/var/macports/sip-workaround")) (allow file-write-setugid (subpath "/opt/local/var/macports/sip-workaround")) (allow file-write* (subpath "/opt/local/var/devcontent")) :debug:destroot Executing org.macports.destroot (ffmpeg-dev) :debug:destroot port:ffmpeg-dev is not installed from /opt/local/var/macports/software/ffmpeg/ffmpeg-4.4.4_4+gpl2.darwin_23.x86_64.tbz2: bsdtar: ./opt/local/var/devcontent/ffmpeg@4.4.4-dev.tar.bz2: Not found in archive :debug:destroot bsdtar: Error exit delayed from previous errors.

I don't think this is a permission error, it seems like something is missing from the archive?! bsdtar: ./opt/local/var/devcontent/ffmpeg@4.4.4-dev.tar.bz2: Not found in archive

RJVB commented 8 months ago

On Monday January 22 2024 12:19:10 Hamid wrote:

seems like it. ffmpeg itself was updated, no issues.

In principle this means that ffmpeg-dev was either installed (if you didn't have it before) or upgraded because I have rolled those operations into the main port install/upgrade operation.

Unless ... maybe I'm seeing a side-effect here of the fact that I am obliged to "queue" the actual install/upgrade operation, because otherwise the operation would hang waiting to obtain a file lock that's held by the ongoing install and thus would never be released. That could well mean that what you are seeing is in fact completely expected: MacPorts sees that port:ffmpeg-dev hasn't yet been upgraded, doesn't know that the final step has been queued and tries itself.

Dang... if that's what's going on I've painted myself in a catch-22 corner...

Also, in that case you circumvented the situation with port:acl by upgrading it and its devport manually.

The only thing that doesn't really make sense with this explanation is that the devport should in fact be ready to be installed. The destroot step has been finalised just after the destroot step of port:ffmpeg (the main port). That's something I did test (because I needed to confirm that I created a proper statefile). Do you see any evidence of a port clean ffmpeg-dev being executed as part of port upgrade outdated? Does port work ffmeg-dev print a path after your upgrade failure?

If that is the case you could try to do sudo port -p upgrade outdated; the -p option means "continue after an error". If not, something apparently clears the devport workdir before starting and the annoying part for you is that you'll have to rebuild ffmpeg...

I don't think this is a permission error, it seems like something is missing from the archive?! bsdtar: .@.***: Not found in archive

Yes, this is to be expected (see above); there must have been more output!

Anyway, I thought I had sent this message ... and pushed another change that should take care of the hypothesis above.

21stcaveman commented 8 months ago

got it. I don't see anything in the logs, but since port work ffmeg-dev returns Error: Port ffmeg-dev not found, your explanation makes sense.

I'll continue my upgrade with -p because I need to get this up and running, but I'm getting the same error with the latest pull.

RJVB commented 8 months ago

I'm getting the same error with the latest pull.

Yes, that's to be expected unfortunately. The content of port:ffmpeg-dev has been lost, sadly.

If you don't use the -u flag (and previous versions of your upgraded ports remain installed but inactive), you could do

sudo port activate ffmpeg to activate the latest version from before the currently active version sudo port uninstall ffmpeg to uninstall that version you upgraded to today.

A sudo port -p upgrade outdated will then redo the upgrade that got botched. I'm really sorry that this didn't come to light with the much smaller acl port!

But I'd advise you to do this after the bulk of your upgrade has succeeded (hoping you won't find other errors in my ports and PortGroups). Triaging port upgrade outdated issues is a lot easier if there are only 2 ports to upgrade! ;) (and make sure you set up ccache for the next time, if you haven't already; that can really make a lot of difference if you have to rebuild!)

21stcaveman commented 8 months ago

no worries at all, the -p switch worked and most upgrades went through, which is good news.

21stcaveman commented 8 months ago

going over updates that failed, I see ffmpeg-dev is a dependency for kf5-kfilemetadata. Given that the contents for ffmpeg-dev has been lost, should the dependency be removed? I commented it out in the portfile and it built fine.

RJVB commented 8 months ago

I commented it out in the portfile and it built fine.

Maybe the dependency is optional and your build now simply doesn't have the feature that require ffmpeg? Or maybe ffmpeg is a runtime dependency only, I haven't checked that.

RJVB commented 8 months ago

I checked: FFmpeg is indeed an optional dependency that is used for a plugin (kfilemetadata_ffmpegextractor). I'd expect you don't have that plugin in your rebuilt port.

Maybe time to rebuild port:ffmpeg and install port:ffmpeg-dev? You can do that with

> sudo port -n destroot ffmpeg [+variants]
> sudo port -n install ffmpeg-dev [+variants]
> sudo port clean ffmpeg

Or, if you have my scripts installed:

> sudo port -n `port-active-variants -echo ffmpeg`
> sudo port -n ffmpeg-dev `port-active-variants ffmpeg`
> sudo port clean ffmpeg