Linuxbrew/brew

Install Linuxbrew on a Synology filer without C compiler?

falzm opened this issue · 5 comments

falzm commented

Hi,

I'm trying to install Linuxbrew on a Synology filer, but I'm running into a chicken-and-egg situation: since there is no C compiler installed (GCC or Clang) I'm not able to install the bare minimum for brew to work:

$ brew install gcc
==> Installing dependencies for gcc: patchelf, zlib, binutils, linux-headers, glibc, gmp, mpfr, libmpc and isl@0.18
==> Installing gcc dependency: patchelf
==> Downloading https://linuxbrew.bintray.com/bottles/patchelf-0.9_1.x86_64_linux.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/00/00c02e6c700f4427da40a82e2a5d88427cfb28a79b3ac69f441d69d8377254f4?__gda__=exp=1543083158~hmac=362dddc73fdb84f2dbc7b37d4d6b45f1e692087d1d0ae87aca5e73d49f87e8
######################################################################## 100.0%
==> Pouring patchelf-0.9_1.x86_64_linux.bottle.tar.gz
🍺  /volume1/homes/marc/.linuxbrew/Cellar/patchelf/0.9_1: 6 files, 1.1MB
==> Installing gcc dependency: zlib
==> Downloading https://linuxbrew.bintray.com/bottles/zlib-1.2.11.x86_64_linux.bottle.tar.gz
######################################################################## 100.0%
==> Pouring zlib-1.2.11.x86_64_linux.bottle.tar.gz
Error: no implicit conversion of nil into String
Warning: Bottle installation failed: building from source.
Error: The following formula
  zlib
cannot be installed as binary package and must be built from source.
Install Clang or brew install gcc
Error: No such file or directory @ dir_s_mkdir - /volume1/homes/marc/.linuxbrew/Cellar/zlib/1.2.11/.d20181124-22634-5y31lw
Warning: Bottle installation failed: building from source.
Error: The following formula
  zlib
cannot be installed as binary package and must be built from source.
Install Clang or brew install gcc

I've looked at spksrc but there's no GCC/Clang available package yet. I wonder if you have a trick before I go down the rabbit hole and try to build a GCC as a spksrc package in order to bootstrap Brew? 🤔

Can you please fill out a full issue report, using the issue report template as you were instructed to do? In particular, this seems like it may be a bug:

Error: no implicit conversion of nil into String

Feel free to reopen this issue when you've done so.

Consider installing Linuxbrew in /home/linuxbrew/.linuxbrew/ if possible so that you can use precompiled binary packages (known as bottles) for non-relocatable formula like glibc.
Another possible workaround for you is brew install --force-bottle glibc, but no promises.

If it's an option for you, you could open a ticket with your information systems department to ask that they create a linuxbrew role account with home directory /home/linuxbrew.

The precompiled binary bottles of non-relocatable bottles can only be used if you install in /home/linuxbrew/.linuxbrew, otherwise they have to be built from source. See the documentation below. On macOS the default installation directory is /usr/local. On Linux the default installation directory is /home/linuxbrew/.linuxbrew.

falzm commented

Can you please fill out a full issue report, using the issue report template as you were instructed to do? In particular, this seems like it may be a bug:

Error: no implicit conversion of nil into String

Feel free to reopen this issue when you've done so.

Yes sorry, I've seen those issue templates but it felt more like an open question that a bug to me at first... I'll comply with the process :)

falzm commented

Consider installing Linuxbrew in /home/linuxbrew/.linuxbrew/ if possible so that you can use precompiled binary packages (known as bottles) for non-relocatable formula like glibc.
Another possible workaround for you is brew install --force-bottle glibc, but no promises.

If it's an option for you, you could open a ticket with your information systems department to ask that they create a linuxbrew role account with home directory /home/linuxbrew.

The precompiled binary bottles of non-relocatable bottles can only be used if you install in /home/linuxbrew/.linuxbrew, otherwise they have to be built from source. See the documentation below. On macOS the default installation directory is /usr/local. On Linux the default installation directory is /home/linuxbrew/.linuxbrew.

* http://docs.brew.sh/Installation.html#alternative-installs

* http://docs.brew.sh/FAQ.html#why-do-you-compile-everything

* http://docs.brew.sh/Bottles.html#cellar-cellar

Thank you for those pointers @sjackman. Actually it's a personal NAS so I'm technically free to do whatever I want on it, however since it's an appliance I wanted to avoid installing software outside of my user directory to avoid side effects on the base system. That said, installing Linuxbrew in /home/linuxbrew doesn't work any better:

$ which brew
/home/linuxbrew/.linuxbrew/bin/brew

$ brew install gcc
==> Installing dependencies for gcc: patchelf, zlib, glibc, gmp, mpfr, libmpc and isl@0.18
==> Installing gcc dependency: patchelf
==> Downloading https://linuxbrew.bintray.com/bottles/patchelf-0.9_1.x86_64_linux.bottle.tar.gz
Already downloaded: /var/services/homes/marc/.cache/Homebrew/downloads/db57574a8c5d4c51b86703f6616af7807a37eaa47e9fb7be610f04617dc29e2a--patchelf-0.9_1.x86_64_linux.bottle.tar.gz
==> Pouring patchelf-0.9_1.x86_64_linux.bottle.tar.gz
Error: Please install either readelf (from binutils) or file.
Warning: Bottle installation failed: building from source.
Error: The following formula
  patchelf
cannot be installed as binary package and must be built from source.
Install Clang or brew install gcc
Error: Please install either readelf (from binutils) or file.

You need either readelf or file to pour bottles. If you have neither, you won't be able to use Linuxbrew as is.

If you want to make this work, and are willing to put some extra effort in, you can start by manually downloading and extracting the bottle for binutils and putting the readelf executable somewhere in your PATH. See https://bintray.com/linuxbrew/bottles/binutils#files