Linuxbrew / legacy-linuxbrew

:skull: This repository is defunct, because it has been split into https://github.com/Linuxbrew/brew and https://github.com/Linuxbrew/homebrew-core
http://linuxbrew.sh
Other
2.23k stars 295 forks source link

glibc: post_install fails with custom LC_ environment variables #1054

Closed leonschreuder closed 7 years ago

leonschreuder commented 8 years ago

I've had trouble installing glibc with a weird error message. Turns out my custom environment variable LC_NESTING_DEPTH which is a simple int, was interfering with the post-install code (below). I've removed the |^LC_ part which solved the problem. I would have submitted a pull-request, but I don't know what the script is trying to do with this LC_ variable in the first place. Anyway, I don't think a custom environment variable should cause problems like this.

    mkdir_p lib/"locale"
    locales = ENV.map { |k, v| v if k[/^LANG$|^LC_/] && v != "C" }.compact
    locales << "en_US.UTF-8" # Required by gawk make check
    locales.uniq.each do |locale|
      lang, charmap = locale.split(".", 2)
      if !charmap.nil?
        system bin/"localedef", "-i", lang, "-f", charmap, locale
      else
        system bin/"localedef", "-i", lang, locale
      end
    end
sjackman commented 8 years ago

Hmm. That's a good point. I think the complete list of environment variables that should be checked is some subset of LANG, LC_ALL, LC_COLLATE, LC_CTYPE, LC_MESSAGES, LC_MONETARY, LC_NUMERIC, LC_TIME, possibly just LANG, LC_ALL, LC_MESSAGES.