Bug 213260 - audio/logitechmediaserver: build fails at staging on i386
Summary: audio/logitechmediaserver: build fails at staging on i386
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: i386 Any
: --- Affects Some People
Assignee: Ben Woods
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-06 23:38 UTC by David Z.
Modified: 2019-01-11 19:52 UTC (History)
7 users (show)

See Also:
mnd999: maintainer-feedback+
mnd999: maintainer-feedback+
woodsb02: merge-quarterly?


Attachments
Patch to use ARCHNAME in pkg-plist and PERL_VER instead of 5.20 (WIP) (38.36 KB, patch)
2016-10-10 15:28 UTC, Ben Woods
no flags Details | Diff
audio/logitechmediaserver pkg-plist on FreeBSD 9i386 (before %%ARCHNAME%%) (116.68 KB, text/plain)
2016-10-10 15:29 UTC, Ben Woods
woodsb02: maintainer-approval? (mark)
Details
audio/logitechmediaserver pkg-plist on FreeBSD 10i386 (before %%ARCHNAME%%) (117.30 KB, text/plain)
2016-10-10 15:29 UTC, Ben Woods
no flags Details
Patch to use ARCHNAME in pkg-plist and vary plist based on ARCH + OSREL (42.75 KB, patch)
2016-11-17 13:22 UTC, Ben Woods
no flags Details | Diff
Startup debug log (9.08 KB, text/plain)
2017-02-06 01:45 UTC, David Z.
no flags Details
Complete build log from Synth (155.59 KB, application/x-xz)
2017-02-06 01:46 UTC, David Z.
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Z. 2016-10-06 23:38:52 UTC
When building audio/logitechmediaserver 7.9.0.g2016.09.30, the build fails at the staging phase.  My system is running 11.0-RELEASE-p1 i386.

Brief edited excerpt:

========================< phase : package         >========================
===>  Building package for logitechmediaserver-7.9.0.g2016.09.30
pkg-static: Unable to access file /construction/xports/audio/logitechmediaserver/work/stage/usr/local/share/logitechmediaserver/CPAN/arch/5.20/i386-freebsd-thread-multi/Audio/Scan.pm: No such file or directory
pkg-static: Unable to access file /construction/xports/audio/logitechmediaserver/work/stage/usr/local/share/logitechmediaserver/CPAN/arch/5.20/i386-freebsd-thread-multi/Bundle/DBI.pm: No such file or directory
pkg-static: Unable to access file /construction/xports/audio/logitechmediaserver/work/stage/usr/local/share/logitechmediaserver/CPAN/arch/5.20/i386-freebsd-thread-multi/Class/XSAccessor.pm: No such file or directory
pkg-static: Unable to access file /construction/xports/audio/logitechmediaserver/work/stage/usr/local/share/logitechmediaserver/CPAN/arch/5.20/i386-freebsd-thread-multi/Class/XSAccessor/Array.pm: No such file or directory
pkg-static: Unable to access file /construction/xports/audio/logitechmediaserver/work/stage/usr/local/share/logitechmediaserver/CPAN/arch/5.20/i386-freebsd-thread-multi/Class/XSAccessor/Heavy.pm: No such file or directory

[...]

pkg-static: lstat(/construction/xports/audio/logitechmediaserver/work/stage/usr/local/share/logitechmediaserver/CPAN/arch/5.20/i386-freebsd-thread-multi/auto/Test/Warn/): No such file or directory
pkg-static: lstat(/construction/xports/audio/logitechmediaserver/work/stage/usr/local/share/logitechmediaserver/CPAN/arch/5.20/i386-freebsd-thread-multi/auto/Tree/DAG_Node/): No such file or directory
pkg-static: lstat(/construction/xports/audio/logitechmediaserver/work/stage/usr/local/share/logitechmediaserver/CPAN/arch/5.20/i386-freebsd-thread-multi/auto/YAML/LibYAML/): No such file or directory
pkg-static: lstat(/construction/xports/audio/logitechmediaserver/work/stage/usr/local/share/logitechmediaserver/CPAN/arch/5.20/i386-freebsd-thread-multi/auto/common/sense/): No such file or directory
*** Error code 1

Stop.
make: stopped in /xports/audio/logitechmediaserver
Comment 1 Bugzilla Automation freebsd_committer 2016-10-06 23:38:52 UTC
Maintainer informed via mail
Comment 2 Ben Woods freebsd_committer 2016-10-06 23:46:28 UTC
This is a bug in audio/logitechmediaserver/pkg-plist, which needs to vary based on whether the build system is i386 or amd64.

Working on a fix now.
Comment 3 VK freebsd_triage 2016-10-07 00:04:42 UTC
Ben, thanks for taking this.

I'm guessing you know the maintainer's address reg'd here on Bugzilla? Because the one listed under MAINTAINER apparently isn't?
Comment 4 Mark Dixon 2016-10-07 09:09:33 UTC
Created an account, and had a look. Looks like on i386 the full perl arch is:

i386-freebsd-thread-multi-64int/

On amd64 it's 

amd64-freebsd-thread-multi

And in the plist we just substitute the arch in front of freebsd-thread-multi

Need to figure out if we can do the full perl arch in the plist.
Comment 5 Mark Dixon 2016-10-07 16:54:39 UTC
Looks like the value needed is from perl -V:archname
Comment 6 Mathieu Arnold freebsd_committer 2016-10-10 11:25:54 UTC
The value that should be used for the Perl architecture is *not* the one you get from perl -V:archname, because Perl does not use it and the modules would not be able to be found.

The value used by the Ports Framework for the Perl architecture is "mach".
Comment 7 Ben Woods freebsd_committer 2016-10-10 13:59:17 UTC
Hi mat,
In this case, the perl modules logitechmediaserver are not installed as ports, but within ${PREFIX}/share/logitechmediaserver/CPAN.

The logitechmediaserver perl modules and scripts are specifically looking for the dependent modules in the sub-directory CPAN/arch/5.20/$archname
https://github.com/Logitech/slimserver/blob/public/7.9/Slim/bootstrap.pm#L104

This port is working on FreeBSD 10amd64, however if I move the directory as per below, then it stops working.
# cd /usr/local/share/logitechmediaserver/CPAN/arch/5.20
# mv amd64-freebsd-thread-multi mach
# service logitechmediaserver onestart
Starting logitechmediaserver.
The following modules failed to load: DBI EV XML::Parser::Expat HTML::Parser JSON::XS Digest::SHA1 YAML::XS Sub::Name

I believe we need to install the logitechmediaserver specific perl modules into ${PREFIX}/share/logitechmediaserver/CPANarch/5.20/$archname, or change where the LMS perl modules/scripts are looking for modules. The problem is, searching for $archname happens all throughout their code:
https://github.com/Logitech/slimserver/search?utf8=%E2%9C%93&q=archname

Thoughts?
Comment 8 Mark Dixon 2016-10-10 14:14:16 UTC
I had a go at getting it to use mach instead of amd64 in the build here:

https://github.com/freebsd/freebsd-ports/compare/master...mnd999:logitechmediaserver?expand=1

It works for all but two of the modules which probably need more hacking. I haven't tried installing or running yet. It needs some more work, but it's a start if this is how we want to go.

Might be that this simply isn't going to work though and we have to pass perl -V:archname into pkg-plist.
Comment 9 Ben Woods freebsd_committer 2016-10-10 15:28:14 UTC
Created attachment 175603 [details]
Patch to use ARCHNAME in pkg-plist and PERL_VER instead of 5.20 (WIP)

The attached patch fixes up pkg-plist to use %%ARCHNAME%%, and also a bug in Makefile where it specifically used 5.20 instead of ${PERL_VER}.

This is not quite ready for commit yet, as there are a few different files installed between amd64 and i386 - see other attachments.
Comment 10 Ben Woods freebsd_committer 2016-10-10 15:29:34 UTC
Created attachment 175604 [details]
audio/logitechmediaserver pkg-plist on FreeBSD 9i386 (before %%ARCHNAME%%)
Comment 11 Ben Woods freebsd_committer 2016-10-10 15:29:54 UTC
Created attachment 175605 [details]
audio/logitechmediaserver pkg-plist on FreeBSD 10i386 (before %%ARCHNAME%%)
Comment 12 David Z. 2016-11-01 22:57:22 UTC
Any updates on this?  Should I try patching my i386 setup with the WIP patch?
Comment 13 Mark Dixon 2016-11-06 21:07:46 UTC
Ben, is this done now?
Comment 14 Ben Woods freebsd_committer 2016-11-06 22:28:06 UTC
No, sorry, I have not finished it off, sorry.
I found that 9i386, 10i386 and 11i386 all have slightly different plists.
In contrast, 9amd64, 10amd64 and 11amd64 all have the same plist.
I have a patch almost ready to fix pkg-plist for this scenario, but it is also not clear to me why this is the case. I suspect it is because the slimserver-vendor build script specifically looks for FreeBSD to perform specific build actions, but only looks for amd64, but does not consider i386. I think a better solution may be to fix that build script, but I haven't tried yet. Hoping to get some time this week.
Comment 15 Ben Woods freebsd_committer 2016-11-17 13:22:30 UTC
Created attachment 177113 [details]
Patch to use ARCHNAME in pkg-plist and vary plist based on ARCH + OSREL

The attached patch allows audio/logitechmediaserver to build on FreeBSD 9/10/11 amd64 and i386.

adamw/mat: interested in your thoughts on how to extract output of:
ARCHNAME!=      ${PERL} -V:archname | ${AWK} -F"'" '{print $$2}'

This line causes the build to output the following warning numerous times before perl is installed as a build dependency:
/usr/local/bin/perl: not found
Comment 16 Mark Dixon 2016-11-20 15:47:35 UTC
Looks good to me. Thanks Ben
Comment 17 Sean 2016-12-01 01:54:48 UTC
I have the same issue, except i am on amd64:

pkg-static: Unable to access file /usr/ports/audio/logitechmediaserver/work/stage/usr/local/share/logitechmediaserver/CPAN/arch/5.24/amd64-freebsd-thread-multi/IO/Interface.pm: No such file or directory
pkg-static: Unable to access file /usr/ports/audio/logitechmediaserver/work/stage/usr/local/share/logitechmediaserver/CPAN/arch/5.24/amd64-freebsd-thread-multi/IO/Interface/Simple.pm: No such file or directory
pkg-static: Unable to access file /usr/ports/audio/logitechmediaserver/work/stage/usr/local/share/logitechmediaserver/CPAN/arch/5.24/amd64-freebsd-thread-multi/JSON/XS.pm: No such file or directory
pkg-static: Unable to access file /usr/ports/audio/logitechmediaserver/work/stage/usr/local/share/logitechmediaserver/CPAN/arch/5.24/amd64-freebsd-thread-multi/JSON/XS/Boolean.pm: No such file or directory
pkg-static: Unable to access file /usr/ports/audio/logitechmediaserver/work/stage/usr/local/share/logitechmediaserver/CPAN/arch/5.24/amd64-freebsd-thread-multi/MP3/Cut/Gapless.pm: No such file or directory
pkg-static: Unable to access file /usr/ports/audio/logitechmediaserver/work/stage/usr/local/share/logitechmediaserver/CPAN/arch/5.24/amd64-freebsd-thread-multi/MP3/Cut/Gapless/Track.pm: No such file or directory
pkg-static: Unable to access file /usr/ports/audio/logitechmediaserver/work/stage/usr/local/share/logitechmediaserver/CPAN/arch/5.24/amd64-freebsd-thread-multi/Media/Scan.pm: No such file or directory

I am on FreeBSD11-STABLE. This is a clean install ( i did a reinstall to ensure my installation was not mucked up).  I tried the patch here, but it didn't work, same error (since it was for 386 didn't expect it to).  Any help would be appreciated.  i added it to this ticket because it appears to be the same issue.  If not let me know and i can open a new one.  I am willing to try patches if needed (been waiting awhile for an update from 7.5.4.

Sean
Comment 18 Sean 2016-12-28 15:18:26 UTC
Just an update, i am running this in a jail and the following solution fixed my install issue:

https://reviews.freebsd.org/D8872

Basically disabling the tests.
Comment 19 commit-hook freebsd_committer 2017-01-30 11:24:20 UTC
A commit references this bug:

Author: woodsb02
Date: Mon Jan 30 11:23:56 UTC 2017
New revision: 432834
URL: https://svnweb.freebsd.org/changeset/ports/432834

Log:
  audio/logitechmediaserver: Fix staging (plist) on i386

  - plist installation location varies by ARCHNAME
  - plist list of installed files varies based on ARCH + OSREL

  PR:		213260
  Reported by:	David Z. <daz@hyperchronos.org>
  Approved by:	Mark Dixon (maintainer)
  MFH:		2017Q1

Changes:
  head/audio/logitechmediaserver/Makefile
  head/audio/logitechmediaserver/pkg-plist
Comment 20 David Z. 2017-02-03 02:56:29 UTC
Looks like the commit won't allow the port to build using Synth.  See this discussion:

https://forums.freebsd.org/threads/59574/
Comment 21 David Z. 2017-02-03 04:21:09 UTC
Finally got around to testing this on my i386 system tonight.  When I start it via "service logitechmediaserver start", it says a few modules failed to load and exits:

"The following modules failed to load: XML::Parser::Expat YAML::XS Sub::Name"
Comment 22 Ben Woods freebsd_committer 2017-02-05 08:04:40 UTC
(In reply to David Z. from comment #20)
> Looks like the commit won't allow the port to build using Synth.  See this discussion:
> 
> https://forums.freebsd.org/threads/59574/

Thanks for reporting this - it has just been fixed in the ports head branch r433382.
Comment 23 David Z. 2017-02-06 01:44:07 UTC
I'm still trying to troubleshoot the missing module startup issue I reported earlier.  I've built the port using Perl 5.20, 5.22, and 5.24, and they all give the same error about the same missing modules.

I've attached the startup logfile (from executing /usr/local/share/slimserver.pl --d_startup) and the build log from Synth, in case that's helpful.
Comment 24 David Z. 2017-02-06 01:45:21 UTC
Created attachment 179663 [details]
Startup debug log
Comment 25 David Z. 2017-02-06 01:46:52 UTC
Created attachment 179664 [details]
Complete build log from Synth
Comment 26 Mark Dixon 2017-02-06 02:46:10 UTC
Try without synth, afaict it's completely unsupported.
Comment 27 David Z. 2017-02-06 02:49:37 UTC
(In reply to Mark Dixon from comment #26)
Already did -- building it via make install clean is how I discovered the problem in the first place.
Comment 28 David Z. 2017-06-01 19:30:43 UTC
Any updates?  I've been hanging on to audio/squeezeboxserver in the meantime, and Perl 5.20 was just removed from the ports tree (audio/squeezeboxserver fails to build with 5.22+ AFAIK).
Comment 29 Mark Dixon 2017-06-02 06:20:40 UTC
It buuilds just fine with 5.24 here.
Comment 30 David Z. 2017-06-02 15:31:42 UTC
Sorry, my mistake -- audio/squeezeboxserver builds fine, but it fails to run.
Comment 31 Ben Woods freebsd_committer 2017-07-30 22:59:58 UTC
Does this runtime error of missing modules still occur on i386 machines after the recent port update to 7.9.1.g2017.07.11?
Comment 32 David Z. 2017-07-31 02:01:06 UTC
It still fails to find the modules.

This might be an upstream problem, as I noticed the LMS changelog says that 7.9.1 adds Perl 5.24 modules for Linux on i386 and ARM.  I'll try posting on the Squeezebox forum about this.
Comment 33 Don Jackson 2017-11-23 18:59:44 UTC
I'm having this problem on amd64.
I am attempting to build and install this port in a jail.
The jail is hosted on a FreeNAS-11.0-U4 (54848d13b) box, and constructed using iocage.
I've tried this on jails running both FreeBSD 11.1-RELEASE and 11.0-RELEASE, same failures on each.
After creating the jail, I run portsnap fetch/extract to get a ports tree,
cd into /usr/ports/audio/logitechmediaserver, and run make install.

The errors are:

===>   Registering installation for logitechmediaserver-7.9.1.g2017.07.11
pkg-static: Unable to access file /usr/ports/audio/logitechmediaserver/work/stage/usr/local/share/logitechmediaserver/CPAN/arch/5.24/Audio/Cuefile/Parser.pm:No such file or directory
pkg-static: Unable to access file /usr/ports/audio/logitechmediaserver/work/stage/usr/local/share/logitechmediaserver/CPAN/arch/5.24/amd64-freebsd-thread-multi/IO/Interface.pm:No such file or directory

[...]

pkg-static: lstat(/usr/ports/audio/logitechmediaserver/work/stage/usr/local/share/logitechmediaserver/CPAN/arch/5.24/amd64-freebsd-thread-multi/auto/YAML/LibYAML/): No such file or directory
*** Error code 74

I've tried several of the fixes/workarounds mentioned in this thread to no avail.
I'd welcome any advice or help....
Comment 34 Mark Dixon 2017-11-24 08:46:52 UTC
This is usually what happens if the build.sh fails but doesn’t abort the build. You’d have to look further up the logs to see what the cause is but I doubt it’s the same issue since that was i386 specific. 

First thing to try with jail builds is to disable the tests in make config.
Comment 35 Kurt Jaeger freebsd_committer 2019-01-11 19:52:55 UTC
This is no longer the case with the latest update, so closing this.