Skip to content

[HaskellNG] Go back to forcing locale #5904

Closed

Description

@Fuuzetsu

We used to force locale to UTF-8 for Haskell builds but now that we use mkDerivation, we're back to POSIX. It'd be nice to bring back the locale we're all used to considering unicode is quite prominent in Haskell community.

Activity

  1. added
    6.topic: haskell
    on Jan 22, 2015
  2. self-assigned this
    on Jan 22, 2015
  3. peti commented on Jan 22, 2015

    @peti
    Member

    Huh? What makes you think that Haskell builds don't run in an UTF-8 environment?

    $ nix-shell '<nixpkgs>' -A haskell-ng.packages.ghc784.mtl --command 'declare -p LANG'
    declare -x LANG="en_US.UTF-8"
    
  4. Fuuzetsu commented on Jan 23, 2015

    @Fuuzetsu
    MemberAuthor
    [shana@lenalee:~/programming/haddock]$ NIX_PATH='nixpkgs=/home/shana/programming/nixpkgs' nix-shell --pure
    
    [nix-shell:~/programming/haddock]$ cat shell.nix  
    with (import <nixpkgs> {}).pkgs;
    let pkg = myHaskellngPackages_7101.callPackage
                ({ mkDerivation, base, Cabal, directory, filepath, haddock-api
                 , process, stdenv, glibcLocales
                 }:
                 mkDerivation {
                   pname = "haddock";
                   version = "2.16.0";
                   src = /home/shana/programming/haddock;
                   isLibrary = false;
                   isExecutable = true;
                   buildDepends = [ base haddock-api glibcLocales ];
                   testDepends = [ base Cabal directory filepath process ];
                   preCheck = "unset GHC_PACKAGE_PATH";
                   homepage = "http://www.haskell.org/haddock/";
                   description = "A documentation-generation tool for Haskell libraries";
                   license = stdenv.lib.licenses.bsd3;
                 }) {};
    in
      pkg.env
    
    [nix-shell:~/programming/haddock]$ locale                                                                                                                                                                                                                                       
    LANG=
    LC_CTYPE="POSIX"
    LC_NUMERIC="POSIX"
    LC_TIME="POSIX"
    LC_COLLATE="POSIX"
    LC_MONETARY="POSIX"
    LC_MESSAGES="POSIX"
    LC_PAPER="POSIX"
    LC_NAME="POSIX"
    LC_ADDRESS="POSIX"
    LC_TELEPHONE="POSIX"
    LC_MEASUREMENT="POSIX"
    LC_IDENTIFICATION="POSIX"
    LC_ALL=
    
  5. peti commented on Jan 23, 2015

    @peti
    Member

    Ah, you are right! We set the env variables in the build process, but not in the interactive shell. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

6.topic: haskell

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions