SuperNEMO-DBD / brew

Installation, management, and containers for the SuperNEMO Software
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

New Install: Debian - Locale error #27

Closed edbird closed 4 years ago

edbird commented 4 years ago

Hi,

Started a new install on my local machine. This is (nearly) new OS - so I hope this problem will be fairly easy to debug.

$ brew doctor

/home/ecb/snemo-sdk/Library/Homebrew/brew.sh: line 4: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8): No such file or directory
Traceback (most recent call last):
    4: from /home/ecb/snemo-sdk/Library/Homebrew/brew.rb:17:in `<main>'
    3: from /home/ecb/snemo-sdk/Library/Homebrew/brew.rb:17:in `require_relative'
    2: from /home/ecb/snemo-sdk/Library/Homebrew/global.rb:10:in `<top (required)>'
    1: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
/usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require': cannot load such file -- active_support/core_ext/object/blank (LoadError)

This appears to be a "proper error" as brew snemo-bootstrap fails.

$ brew snemo-bootstrap

/home/ecb/snemo-sdk/Library/Homebrew/brew.sh: line 4: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8): No such file or directory
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
/home/ecb/snemo-sdk/Library/Homebrew/brew.sh: line 4: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8): No such file or directory
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
/home/ecb/snemo-sdk/Library/Homebrew/brew.sh: line 4: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8): No such file or directory
Traceback (most recent call last):
    4: from /home/ecb/snemo-sdk/Library/Homebrew/brew.rb:17:in `<main>'
    3: from /home/ecb/snemo-sdk/Library/Homebrew/brew.rb:17:in `require_relative'
    2: from /home/ecb/snemo-sdk/Library/Homebrew/global.rb:10:in `<top (required)>'
    1: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
/usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require': cannot load such file -- active_support/core_ext/object/blank (LoadError)
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
/home/ecb/snemo-sdk/Library/Homebrew/brew.sh: line 4: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8): No such file or directory
Traceback (most recent call last):
    4: from /home/ecb/snemo-sdk/Library/Homebrew/brew.rb:17:in `<main>'
    3: from /home/ecb/snemo-sdk/Library/Homebrew/brew.rb:17:in `require_relative'
    2: from /home/ecb/snemo-sdk/Library/Homebrew/global.rb:10:in `<top (required)>'
    1: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
/usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require': cannot load such file -- active_support/core_ext/object/blank (LoadError)

Required Information

Output of brew config?

/home/ecb/snemo-sdk/Library/Homebrew/brew.sh: line 4: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8): No such file or directory
Traceback (most recent call last):
    4: from /home/ecb/snemo-sdk/Library/Homebrew/brew.rb:17:in `<main>'
    3: from /home/ecb/snemo-sdk/Library/Homebrew/brew.rb:17:in `require_relative'
    2: from /home/ecb/snemo-sdk/Library/Homebrew/global.rb:10:in `<top (required)>'
    1: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
/usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require': cannot load such file -- active_support/core_ext/object/blank (LoadError)

Output of brew snemo-doctor?

see above

Are you experiencing...

[x] A problem with running brew itself?

see above

[x] A problem with running brew snemo-bootstrap?

see above

ADDITIONAL INFO

The locale warning appears to be a seperate issue

 sudo localedef -v -c -i en_US -f UTF-8 en_US.UTF-8

Fixes this issue - the other error appears to be a ruby issue? Am I missing some ruby packages on my system?

info here: https://www.linuxquestions.org/questions/linux-general-1/locale-cannot-set-lc_all-to-default-locale-no-such-file-or-directory-218622/

drbenmorgan commented 4 years ago

Try export HOMEBREW_FORCE_VENDOR_RUBY=1 then

$ brew update
$ brew doctor
edbird commented 4 years ago

Thanks - currently running doctor...

I don't know why this works as a solution - is this something that would be useful to add as a note on the installation instructions?

Doctor has reported a few things back

Warning: The following directories do not exist:
/home/ecb/snemo-sdk/etc
/home/ecb/snemo-sdk/include
/home/ecb/snemo-sdk/lib
/home/ecb/snemo-sdk/opt
/home/ecb/snemo-sdk/sbin
/home/ecb/snemo-sdk/share
/home/ecb/snemo-sdk/var/homebrew/linked
/home/ecb/snemo-sdk/Cellar

You should create these directories and change their ownership to your account.
  sudo mkdir -p /home/ecb/snemo-sdk/etc /home/ecb/snemo-sdk/include /home/ecb/snemo-sdk/lib /home/ecb/snemo-sdk/opt /home/ecb/snemo-sdk/sbin /home/ecb/snemo-sdk/share /home/ecb/snemo-sdk/var/homebrew/linked /home/ecb/snemo-sdk/Cellar
  sudo chown -R $(whoami) /home/ecb/snemo-sdk/etc /home/ecb/snemo-sdk/include /home/ecb/snemo-sdk/lib /home/ecb/snemo-sdk/opt /home/ecb/snemo-sdk/sbin /home/ecb/snemo-sdk/share /home/ecb/snemo-sdk/var/homebrew/linked /home/ecb/snemo-sdk/Cellar
==> Tapping supernemo-dbd/core
Cloning into '/home/ecb/snemo-sdk/Library/Taps/supernemo-dbd/homebrew-core'...
remote: Enumerating objects: 4998, done.
remote: Counting objects: 100% (4998/4998), done.
remote: Compressing objects: 100% (4789/4789), done.
remote: Total 4998 (delta 50), reused 801 (delta 15), pack-reused 0
Receiving objects: 100% (4998/4998), 4.20 MiB | 1.14 MiB/s, done.
Resolving deltas: 100% (50/50), done.
Tapped 3 commands and 4777 formulae (5,040 files, 13MB).

Warning: Your Homebrew's prefix is not /home/linuxbrew/.linuxbrew.
Some of Homebrew's bottles (binary packages) can only be used with the default
prefix (/home/linuxbrew/.linuxbrew).
You may encounter build failures with some formulae as
brew is being run in an unsupported configuration
In these cases, please raise an issue at https://github.com/SuperNEMO-DBD/homebrew-core/issues

Do I need to do anything about either of these? Thanks for the help so far

drbenmorgan commented 4 years ago

Nope, they're just warnings - you should be fine to do brew snemo-bootstrap now.

edbird commented 4 years ago

Hi Ben, I encountered some errors asking me to run

brew install gcc@7

Here are those errors

$ brew snemo-bootstrap
/home/ecb/snemo-sdk/bin/brew tap supernemo-dbd/bundle
==> Tapping supernemo-dbd/bundle
Cloning into '/home/ecb/snemo-sdk/Library/Taps/supernemo-dbd/homebrew-bundle'...
remote: Enumerating objects: 80, done.
remote: Counting objects: 100% (80/80), done.
remote: Compressing objects: 100% (73/73), done.
remote: Total 80 (delta 7), reused 25 (delta 4), pack-reused 0
Receiving objects: 100% (80/80), 43.18 KiB | 491.00 KiB/s, done.
Resolving deltas: 100% (7/7), done.
Tapped 1 command (94 files, 338KB).
Installing patchelf formula. It is not currently installed.
Error: An exception occurred within a child process:
  RuntimeError: The requested Homebrew GCC was not installed. You must:
  brew install gcc@7

Installing patchelf has failed!
Installing python formula. It is not currently installed.
==> Installing dependencies for python: pkg-config, gdbm, openssl, gpatch, ncurses, readline, sqlite, xz, bzip2, libffi and zlib
==> Installing python dependency: pkg-config
Error: An exception occurred within a child process:
  RuntimeError: The requested Homebrew GCC was not installed. You must:
  brew install gcc@7

Installing python has failed!
Installing cmake formula. It is not currently installed.
==> Installing dependencies for cmake: pkg-config, gdbm, openssl, gpatch, ncurses, readline, sqlite, xz, bzip2, libffi, zlib, python and sphinx-doc
==> Installing cmake dependency: pkg-config
Error: An exception occurred within a child process:
  RuntimeError: The requested Homebrew GCC was not installed. You must:
  brew install gcc@7

Installing cmake has failed!
Installing ninja formula. It is not currently installed.
==> Installing dependencies for ninja: pkg-config, gdbm, openssl, gpatch, ncurses, readline, sqlite, xz, bzip2, libffi, zlib and python
==> Installing ninja dependency: pkg-config
Error: An exception occurred within a child process:
  RuntimeError: The requested Homebrew GCC was not installed. You must:
  brew install gcc@7

Installing ninja has failed!
Installing falaise formula. It is not currently installed.
==> Tapping supernemo-dbd/extra
Cloning into '/home/ecb/snemo-sdk/Library/Taps/supernemo-dbd/homebrew-extra'...
remote: Enumerating objects: 22, done.
remote: Counting objects: 100% (22/22), done.
remote: Compressing objects: 100% (20/20), done.
remote: Total 22 (delta 0), reused 7 (delta 0), pack-reused 0
Receiving objects: 100% (22/22), 10.23 KiB | 10.23 MiB/s, done.
Tapped 8 formulae (43 files, 136.6KB).
==> Installing dependencies for falaise: pkg-config, gdbm, openssl, gpatch, ncurses, readline, sqlite, xz, bzip2, libffi, zlib, python, sphinx-doc, cmake, m4, bison, help2man, gettext, flex, doxygen, icu4c, boost, camp, clhep, libbsd, expat, curl, xerces-c, geant4, gsl, libpng, freetype, berkeley-db, perl, autoconf, automake, gperf, libtool, json-c, util-linux, fontconfig, qt5-base, libxml2, lz4, tbb, xrootd, xxhash, root6 and bayeux
==> Installing falaise dependency: pkg-config
Error: An exception occurred within a child process:
  RuntimeError: The requested Homebrew GCC was not installed. You must:
  brew install gcc@7

Installing falaise has failed!
Homebrew Bundle failed! 5 Brewfile dependencies failed to install.

I tried that, and this is the result:

$ brew install gcc@7
==> Installing dependencies for gcc@7: m4, gmp, isl, mpfr, libmpc and zlib
==> Installing gcc@7 dependency: m4
==> Downloading https://ftp.gnu.org/gnu/m4/m4-1.4.18.tar.xz
######################################################################## 100.0%
==> ./configure --prefix=/home/ecb/snemo-sdk/Cellar/m4/1.4.18
==> make
Last 15 lines from /home/ecb/.cache/Homebrew/Logs/m4/02.make:
      |   ^~~~~
make[3]: *** [Makefile:1915: freadahead.o] Error 1
make[3]: *** Waiting for unfinished jobs....
  CC       printf-parse.o
fseeko.c: In function 'rpl_fseeko':
fseeko.c:110:4: error: #error "Please port gnulib fseeko.c to your platform! Look at the code in fseeko.c, then report this to bug-gnulib."
  110 |   #error "Please port gnulib fseeko.c to your platform! Look at the code in fseeko.c, then report this to bug-gnulib."
      |    ^~~~~
make[3]: *** [Makefile:1915: fseeko.o] Error 1
make[3]: Leaving directory '/tmp/m4-20200504-51422-43suo9/m4-1.4.18/lib'
make[2]: *** [Makefile:1674: all] Error 2
make[2]: Leaving directory '/tmp/m4-20200504-51422-43suo9/m4-1.4.18/lib'
make[1]: *** [Makefile:1572: all-recursive] Error 1
make[1]: Leaving directory '/tmp/m4-20200504-51422-43suo9/m4-1.4.18'
make: *** [Makefile:1528: all] Error 2

READ THIS: https://github.com/SuperNEMO-DBD/brew/issues
Please do not report this issue to Homebrew/brew or Homebrew/core,
which support macOS only."

Any ideas? Again sorry I can't be more help, I don't have the first idea where to start with this.

drbenmorgan commented 4 years ago

Please run brew gist-logs m4 and post the result here.

Which exact Debian version is this, and what's the system gcc?

edbird commented 4 years ago

Hi again, is this to create a personal access token?

I assume this is not what you expected to see?

$ brew gist-logs m4
You can create a new personal access token:
  https://github.com/settings/tokens/new?scopes=gist,public_repo&description=Homebrew
echo 'export HOMEBREW_GITHUB_API_TOKEN=your_token_here' >> ~/.bash_profile

GitHub User: edbird
: 

Error: GitHub Requires authentication:The GitHub credentials in the macOS keychain may be invalid.
Clear them with:
  printf "protocol=https\nhost=github.com\n" | git credential-osxkeychain erase
Or create a personal access token:
  https://github.com/settings/tokens/new?scopes=gist,public_repo&description=Homebrew
echo 'export HOMEBREW_GITHUB_API_TOKEN=your_token_here' >> ~/.bash_profile
drbenmorgan commented 4 years ago

Yep, just follow the instructions it's giving you to create and setup the token!

edbird commented 4 years ago

Ok - is this the right thing?

https://gist.github.com/edbird/941c071da683c1ce9bcdbb3d84b56c42

drbenmorgan commented 4 years ago

Yes, thanks! The problem is down to this:

https://github.com/easybuilders/easybuild-easyconfigs/issues/7383

So we'll need the patch from there. You can try applying the patch in that Issue/PR to the m4 formula. Try brew edit m4 and setup the patch by adding an additional patch block blow the high Sierra one (line numbers added for clarity):

20   # Fix crash from usage of %n in dynamic format strings on High Sierra
21   # Patch credit to Jeremy Huddleston Sequoia <jeremyhu@apple.com>22   if MacOS.version >= :high_sierra
23     patch :p0 do
24       url "https://raw.githubusercontent.com/macports/macports-ports/edf0ee1e2cf/devel/m4/files/secure_snprintf.patch"
25       sha256 "57f972940a10d448efbd3d5ba46e65979ae4eea93681a85e1d998060b356e0d2"
26     end
27   end
28
29   patch :p0 do
30     url "https://raw.githubusercontent.com/easybuilders/easybuild-easyconfigs/develop/easybuild/easyconfigs/m/M4/M4-1.4.18_glibc_2.28.patch"
31     sha256 "a613c18f00b1a3caa46ae4b8b849a0f4f71095ad860f4fcd6c6bb4ae211681fa"
32   end
33
34  def install

I can't test directly until I have an Ubuntu 20.04LTS base system. That won't be until next week, but try the above and see what happens.

edbird commented 4 years ago

Ok, let's have a go at that then... It used to look like this image

and now it looks like this

image

Let's try it...

edbird commented 4 years ago

Did I misunderstand how to apply the patch?

$ brew snemo-bootstrap
Installing patchelf formula. It is not currently installed.
Error: An exception occurred within a child process:
  RuntimeError: The requested Homebrew GCC was not installed. You must:
  brew install gcc@7

Installing patchelf has failed!
Installing python formula. It is not currently installed.
==> Installing dependencies for python: pkg-config, gdbm, openssl, gpatch, ncurses, readline, sqlite, xz, bzip2, libffi and zlib
==> Installing python dependency: pkg-config
Error: An exception occurred within a child process:
  RuntimeError: The requested Homebrew GCC was not installed. You must:
  brew install gcc@7

Installing python has failed!
Installing cmake formula. It is not currently installed.
==> Installing dependencies for cmake: pkg-config, gdbm, openssl, gpatch, ncurses, readline, sqlite, xz, bzip2, libffi, zlib, python and sphinx-doc
==> Installing cmake dependency: pkg-config
Error: An exception occurred within a child process:
  RuntimeError: The requested Homebrew GCC was not installed. You must:
  brew install gcc@7

Installing cmake has failed!
Installing ninja formula. It is not currently installed.
==> Installing dependencies for ninja: pkg-config, gdbm, openssl, gpatch, ncurses, readline, sqlite, xz, bzip2, libffi, zlib and python
==> Installing ninja dependency: pkg-config
Error: An exception occurred within a child process:
  RuntimeError: The requested Homebrew GCC was not installed. You must:
  brew install gcc@7

Installing ninja has failed!
Installing falaise formula. It is not currently installed.
==> Installing dependencies for falaise: pkg-config, gdbm, openssl, gpatch, ncurses, readline, sqlite, xz, bzip2, libffi, zlib, python, sphinx-doc, cmake, m4, bison, help2man, gettext, flex, doxygen, icu4c, boost, camp, clhep, libbsd, expat, curl, xerces-c, geant4, gsl, libpng, freetype, berkeley-db, perl, autoconf, automake, gperf, libtool, json-c, util-linux, fontconfig, qt5-base, libxml2, lz4, tbb, xrootd, xxhash, root6 and bayeux
==> Installing falaise dependency: pkg-config
Error: An exception occurred within a child process:
  RuntimeError: The requested Homebrew GCC was not installed. You must:
  brew install gcc@7

Installing falaise has failed!
Homebrew Bundle failed! 5 Brewfile dependencies failed to install.
$ brew install gcc@7
==> Installing dependencies for gcc@7: m4, gmp, isl, mpfr, libmpc and zlib
==> Installing gcc@7 dependency: m4
==> Downloading https://ftp.gnu.org/gnu/m4/m4-1.4.18.tar.xz
Already downloaded: /home/ecb/.cache/Homebrew/downloads/bb74c92bda9bdc32be0653ca50751920ff35cfe8f329499d0bea86fbe66ce580--m4-1.4.18.tar.xz
==> Downloading https://raw.githubusercontent.com/easybuilders/easybuild-easyconfigs/develop/easybuild/easyconfigs/m/M4/M4-1.4.18_glibc_2.28.patch
######################################################################## 100.0%
==> Patching
==> Applying M4-1.4.18_glibc_2.28.patch
can't find file to patch at input line 7
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|fix problems occuring from changes in glibc 2.28
|https://github.com/coreutils/gnulib/commit/4af4a4a71827c0bc5e0ec67af23edef4f15cee8e
|
|diff -Naur m4-1.4.18_old/lib/freadahead.c m4-1.4.18/lib/freadahead.c
|--- m4-1.4.18_old/lib/freadahead.c      2019-01-08 15:26:47.835617107 +0100
|+++ m4-1.4.18/lib/freadahead.c  2019-01-08 15:29:50.827211620 +0100
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored
can't find file to patch at input line 20
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|
|diff -Naur m4-1.4.18_old/lib/fseeko.c m4-1.4.18/lib/fseeko.c
|--- m4-1.4.18_old/lib/fseeko.c  2019-01-08 15:26:47.831617117 +0100
|+++ m4-1.4.18/lib/fseeko.c      2019-01-08 15:29:50.835211605 +0100
--------------------------
No file to patch.  Skipping patch.
2 out of 2 hunks ignored
can't find file to patch at input line 42
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|
|diff -Naur m4-1.4.18_old/lib/stdio-impl.h m4-1.4.18/lib/stdio-impl.h
|--- m4-1.4.18_old/lib/stdio-impl.h      2019-01-08 15:26:47.831617117 +0100
|+++ m4-1.4.18/lib/stdio-impl.h  2019-01-08 15:29:50.835211605 +0100
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored
Error: Failure while executing; `patch -g 0 -f -p0 -i /tmp/m4--patch-20200505-16444-15b6qjw/M4-1.4.18_glibc_2.28.patch` exited with 1.
drbenmorgan commented 4 years ago

Hmm, try changing the ":p0" to ":p1", the error message suggests a file path issue rather than the patch.

edbird commented 4 years ago

This seems to be working! Curently bootstrapping

drbenmorgan commented 4 years ago

Great! Let me know if it completes o.k., and I'll add the patch in.

edbird commented 4 years ago

Hi Ben - it all seem to be ok, or at least root runs, and snemo-bootstrap finished with the final 2 steps being installations of bayeux and falaise.

Unless you want me to run any further tests I would recommend adding this as a patch and closing the issue. Thanks for your prompt replies - I can get on and do my work now. All the best