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

Add support for Alpine Linux #210

Open
RyanRamchandar opened this issue Jul 12, 2018 · 7 comments

Comments

@RyanRamchandar
Copy link

commented Jul 12, 2018

This would be beneficial for those who want the smallest footprint possible (eg. docker images).

As far as I can tell, all the dependencies are available in the Alpine Package manager, namely:

apk add wget faad2 flac lame sox perl-io-socket-ssl

Then just download and unzip the compressed file:

wget http://downloads.slimdevices.com/LogitechMediaServer_v7.9.1/logitechmediaserver-7.9.1-arm-linux.tgz

However, running the slimserver.pl gives an error:

/logitechmediaserver-7.9.1-arm-linux # ./slimserver.pl 
The following modules failed to load: DBI EV XML::Parser::Expat HTML::Parser JSON::XS Digest::SHA1 YAML::XS


*******

NOTE:

If you're running some unsupported Linux/Unix platform, please use the buildme.sh 
script located here:

https://github.com/Logitech/slimserver-vendor/tree/public/7.9/CPAN

If 7.9 is outdated by the time you read this, Replace "7.9" with the major version
You should never need to do this if you're on Windows or Mac OSX. If the installers
don't work for you, ask for help and/or report a bug.

*******

Note: I am testing this on a device with arm64 architecture and this error may be a result of the architecture.

@mherger

This comment has been minimized.

Copy link
Contributor

commented Jul 13, 2018

This most likely is a combination of Perl version and platform. We don't have wide support for the arm64 (aarch64) architecture yet. I think only Perl 5.24 and 5.26. What Perl would you be using (perl -V)?

But as the message says, you can build the missing modules yourself. If you really want small footprint then you better don't rely on the tarballs or deb files anyway, as they come with binaries for all kinds of other Perl versions.

@RyanRamchandar

This comment has been minimized.

Copy link
Author

commented Jul 13, 2018

I am running slimserver (from the deb file) on the same arm64 device on Debian Stretch without issue, but am only getting this error on alpine.

But as the message says, you can build the missing modules yourself. If you really want small footprint then you better don't rely on the tarballs or deb files anyway, as they come with binaries for all kinds of other Perl versions.

I will attempt to build the modules via: https://github.com/Logitech/slimserver-vendor/tree/public/7.9/CPAN

Then should I remove the the unneeded Perl version modules and place just compiled ones? Will that be the smallest possible footprint?

Looks like the perl version shouldn't be an issue.

# perl -V
Summary of my perl5 (revision 5 version 26 subversion 2) configuration:
   
  Platform:
    osname=linux
    osvers=4.14.28-0-vanilla
    archname=aarch64-linux-thread-multi
    uname='linux build-3-8-aarch64 4.14.28-0-vanilla #1-alpine smp fri mar 23 10:56:03 utc 2018 aarch64 linux '
    config_args='-des -Dcccdlflags=-fPIC -Dcccdlflags=-fPIC -Dccdlflags=-rdynamic -Dprefix=/usr -Dprivlib=/usr/share/perl5/core_perl -Darchlib=/usr/lib/perl5/core_perl -Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5/vendor_perl -Dvendorarch=/usr/lib/perl5/vendor_perl -Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl5/site_perl -Dsitearch=/usr/local/lib/perl5/site_perl -Dlocincpth=  -Doptimize=-Os -Duselargefiles -Dusethreads -Duseshrplib -Dd_semctl_semun -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dinstallman1dir=/usr/share/man/man1 -Dinstallman3dir=/usr/share/man/man3 -Dman1ext=1 -Dman3ext=3pm -Dcf_by=Alpine -Ud_csh -Dusenm'
    hint=recommended
    useposix=true
    d_sigaction=define
    useithreads=define
    usemultiplicity=define
    use64bitint=define
    use64bitall=define
    uselongdouble=undef
    usemymalloc=n
    default_inc_excludes_dot=define
    bincompat5005=undef
  Compiler:
    cc='cc'
    ccflags ='-D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
    optimize='-Os'
    cppflags='-D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong'
    ccversion=''
    gccversion='6.4.0'
    gccosandvers=''
    intsize=4
    longsize=8
    ptrsize=8
    doublesize=8
    byteorder=12345678
    doublekind=3
    d_longlong=define
    longlongsize=8
    d_longdbl=define
    longdblsize=16
    longdblkind=1
    ivtype='long'
    ivsize=8
    nvtype='double'
    nvsize=8
    Off_t='off_t'
    lseeksize=8
    alignbytes=8
    prototype=define
  Linker and Libraries:
    ld='cc'
    ldflags =' -fstack-protector-strong -L/usr/local/lib'
    libpth=/usr/local/lib /usr/include/fortify /usr/lib /lib/../lib /usr/lib/../lib /lib
    libs=-lpthread -ldl -lm -lcrypt -lutil -lc
    perllibs=-lpthread -ldl -lm -lcrypt -lutil -lc
    libc=/usr/lib/libc.a
    so=so
    useshrplib=true
    libperl=libperl.so
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs
    dlext=so
    d_dlsymun=undef
    ccdlflags='-rdynamic -Wl,-rpath,/usr/lib/perl5/core_perl/CORE'
    cccdlflags='-fPIC'
    lddlflags='-shared -Os -L/usr/local/lib -fstack-protector-strong'


Characteristics of this binary (from libperl): 
  Compile-time options:
    HAS_TIMES
    MULTIPLICITY
    PERLIO_LAYERS
    PERL_COPY_ON_WRITE
    PERL_DONT_CREATE_GVSV
    PERL_IMPLICIT_CONTEXT
    PERL_MALLOC_WRAP
    PERL_OP_PARENT
    PERL_PRESERVE_IVUV
    USE_64_BIT_ALL
    USE_64_BIT_INT
    USE_ITHREADS
    USE_LARGE_FILES
    USE_LOCALE
    USE_LOCALE_COLLATE
    USE_LOCALE_CTYPE
    USE_LOCALE_NUMERIC
    USE_LOCALE_TIME
    USE_PERLIO
    USE_PERL_ATOF
    USE_REENTRANT_API
  Built under linux
  Compiled at Jun 13 2018 12:10:26
  @INC:
    /usr/local/lib/perl5/site_perl
    /usr/local/share/perl5/site_perl
    /usr/lib/perl5/vendor_perl
    /usr/share/perl5/vendor_perl
    /usr/lib/perl5/core_perl
    /usr/share/perl5/core_perl
@RyanRamchandar

This comment has been minimized.

Copy link
Author

commented Jul 16, 2018

If the ARM tar/deb package work on Debian shouldn't they also work on an Alpine host?

Are the modules agnostic to the Linux host if the architecture and Perl version match? Meaning the modules from the tar/deb file should not need to be recompiled on the Alpine host?

@mherger

This comment has been minimized.

Copy link
Contributor

commented Jul 16, 2018

I’m not familiar with Alpine Linux. But it seems to be using a different libc than most other systems. I could imagine this to cause compatibility issues.

Is it really worth optimising that much? Wouldn’t using the same OS as the host result in a similarly small image? As most of the host‘s libraries would be used?

@RyanRamchandar

This comment has been minimized.

Copy link
Author

commented Jul 16, 2018

Alpine is known for it's very small footprint (only 5MB) compared to Debian or Ubuntu which have a larger footprint. Having a smaller image is advantageous for reducing bandwidth and time costs when pulling the Docker image.

I am having errors compiling the modules directly on Alpine (probably due to missing packages or libc as you mentioned).

However, shouldn't the pre-compiled arm modules work from logitechmediaserver-7.9.1-arm-linux.tgz already? There shouldn't be a need to recompile them unless I'm misunderstanding?

@molobrakos

This comment has been minimized.

Copy link

commented Jul 16, 2018

Have you seen the Debian-slim base images? (yes, they are still larger than the Alpine images)

@RyanRamchandar

This comment has been minimized.

Copy link
Author

commented Jul 16, 2018

@molobrakos yes I have, though I'd like to reduce it further if possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.