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

Increase upper bound on ansi-terminal #14

Merged
merged 1 commit into from
Aug 22, 2017
Merged

Conversation

Gabriella439
Copy link

I verified that this build against ansi-terminal-0.7

@quchen
Copy link
Collaborator

quchen commented Aug 21, 2017

Hi Gabriel, thanks for the patch!

I trust you did what you claimed, but could you include a log for archival purposes anyway, so if something happens we can refer to it?

One problem I’m seeing here is that ansi-wl-pprint is completely untested, so even if the build works it might break the example application. Have you tried running that one as well?

@RyanGlScott
Copy link

If you want a log, here's what I got when I built the library (and example application) with 8.2.1:

Preprocessing library for ansi-wl-pprint-0.6.8.1..
Building library for ansi-wl-pprint-0.6.8.1..
[1 of 2] Compiling Text.PrettyPrint.ANSI.Leijen.Internal ( Text/PrettyPrint/ANSI/Leijen/Internal.hs, dist/build/Text/PrettyPrint/ANSI/Leijen/Internal.o )
[2 of 2] Compiling Text.PrettyPrint.ANSI.Leijen ( Text/PrettyPrint/ANSI/Leijen.hs, dist/build/Text/PrettyPrint/ANSI/Leijen.o )
Preprocessing executable 'ansi-wl-pprint-example' for ansi-wl-pprint-0.6.8.1..
Building executable 'ansi-wl-pprint-example' for ansi-wl-pprint-0.6.8.1..
[1 of 1] Compiling Main             ( src-exe/Example.hs, dist/build/ansi-wl-pprint-example/ansi-wl-pprint-example-tmp/Main.o )
Linking dist/build/ansi-wl-pprint-example/ansi-wl-pprint-example ...

No warnings—that's a good sign!

The example application also appears to work the same:

$ ./dist/build/ansi-wl-pprint-example/ansi-wl-pprint-example
Red, white and blue!
Nested colors example
Red, white and blue!
Nested colors example
I will be green on Unix but uncolored on Windows
We can do boldness, if your terminal supports it, and even perhaps underlining
There is a handy utility called 'plain' to remove formatting if you need to e.g. support non-ANSI terminals

@Gabriella439
Copy link
Author

If you want something really reproducible and detailed:

$ cat nixpkgs.json 
{
  "url": "https://github.com/NixOS/nixpkgs.git",
  "rev": "fd22d671ecad983fbbbd92c4626204f09c9af8ff",
  "date": "2017-08-22T04:00:39+02:00",
  "sha256": "0pn8w5v2b7c82nr0zbb91bfzylr97hq3knwhlc8xhzibhp0d723a",
  "fetchSubmodules": true
}

$ cat ansi-terminal.nix 
{ mkDerivation, base, colour, stdenv }:
mkDerivation {
  pname = "ansi-terminal";
  version = "0.7";
  sha256 = "1p66w12i2nr653ixdxly98q4g895a4nav8afmgq6yifm96shf89f";
  isLibrary = true;
  isExecutable = true;
  libraryHaskellDepends = [ base colour ];
  homepage = "https://github.com/feuerbach/ansi-terminal";
  description = "Simple ANSI terminal support, with Windows compatibility";
  license = stdenv.lib.licenses.bsd3;
}

$ cat release.nix 
let
  inherit (import <nixpkgs> { }) fetchFromGitHub;

  json = builtins.fromJSON (builtins.readFile ./nixpkgs.json);

  nixpkgs = fetchFromGitHub {
    owner = "NixOS";

    repo = "nixpkgs";

    inherit (json) rev sha256;
  };

  config = {
    packageOverrides = pkgs: {
      haskellPackages = pkgs.haskellPackages.override {
        overrides = haskellPackagesNew: haskellPackagesOld: {
          ansi-wl-pprint = haskellPackagesNew.callPackage ./default.nix { };

          ansi-terminal = haskellPackagesNew.callPackage ./ansi-terminal.nix { };
        };
      };
    };
  }
  pkgs = import nixpkgs { inherit config; };

in
  pkgs.haskellPackages.ansi-wl-pprint

$ nix-build release.nix
...
building path(s) ‘/nix/store/8ij9812x4qikz6cdgvmwhpk13rpf5a2n-ansi-wl-pprint-0.6.8.1’, ‘/nix/store/d5cgpyixcqwzdafplczxikj4jm0d2xs2-ansi-wl-pprint-0.6.8.1-doc’
setupCompilerEnvironmentPhase
Build with /nix/store/f742adnlq3q9nya8wsj7mvdx438sjd0w-ghc-8.0.2.
unpacking sources
unpacking source archive /nix/store/ibi15fi69h83ifa4303x7178ks5rhlc5-ansi-wl-pprint
source root is ansi-wl-pprint
patching sources
compileBuildDriverPhase
setupCompileFlags: -package-db=/tmp/nix-build-ansi-wl-pprint-0.6.8.1.drv-0/package.conf.d -j1 -threaded
[1 of 1] Compiling Main             ( Setup.lhs, /tmp/nix-build-ansi-wl-pprint-0.6.8.1.drv-0/Main.o )
Linking Setup ...
configuring
configureFlags: --verbose --prefix=/nix/store/8ij9812x4qikz6cdgvmwhpk13rpf5a2n-ansi-wl-pprint-0.6.8.1 --libdir=$prefix/lib/$compiler --libsubdir=$pkgid --docdir=/nix/store/d5cgpyixcqwzdafplczxikj4jm0d2xs2-ansi-wl-pprint-0.6.8.1-doc/share/doc --with-gcc=gcc --package-db=/tmp/nix-build-ansi-wl-pprint-0.6.8.1.drv-0/package.conf.d --ghc-option=-optl=-Wl,-rpath=/nix/store/8ij9812x4qikz6cdgvmwhpk13rpf5a2n-ansi-wl-pprint-0.6.8.1/lib/ghc-8.0.2/ansi-wl-pprint-0.6.8.1 --ghc-option=-j1 --disable-split-objs --disable-library-profiling --disable-profiling --enable-shared --disable-coverage --enable-library-vanilla --enable-executable-dynamic --enable-tests --ghc-option=-split-sections
Configuring ansi-wl-pprint-0.6.8.1...
Flags chosen: example=False
Dependency ansi-terminal >=0.4.0 && <0.8: using ansi-terminal-0.7
Dependency base >=4.5 && <5: using base-4.9.1.0
Using Cabal-1.24.2.0 compiled by ghc-8.0
Using compiler: ghc-8.0.2
Using install prefix:
/nix/store/8ij9812x4qikz6cdgvmwhpk13rpf5a2n-ansi-wl-pprint-0.6.8.1
Binaries installed in:
/nix/store/8ij9812x4qikz6cdgvmwhpk13rpf5a2n-ansi-wl-pprint-0.6.8.1/bin
Libraries installed in:
/nix/store/8ij9812x4qikz6cdgvmwhpk13rpf5a2n-ansi-wl-pprint-0.6.8.1/lib/ghc-8.0.2/ansi-wl-pprint-0.6.8.1
Dynamic libraries installed in:
/nix/store/8ij9812x4qikz6cdgvmwhpk13rpf5a2n-ansi-wl-pprint-0.6.8.1/lib/ghc-8.0.2/x86_64-linux-ghc-8.0.2
Private binaries installed in:
/nix/store/8ij9812x4qikz6cdgvmwhpk13rpf5a2n-ansi-wl-pprint-0.6.8.1/libexec
Data files installed in:
/nix/store/8ij9812x4qikz6cdgvmwhpk13rpf5a2n-ansi-wl-pprint-0.6.8.1/share/x86_64-linux-ghc-8.0.2/ansi-wl-pprint-0.6.8.1
Documentation installed in:
/nix/store/d5cgpyixcqwzdafplczxikj4jm0d2xs2-ansi-wl-pprint-0.6.8.1-doc/share/doc
Configuration files installed in:
/nix/store/8ij9812x4qikz6cdgvmwhpk13rpf5a2n-ansi-wl-pprint-0.6.8.1/etc
No alex found
Using ar found on system at:
/nix/store/s7nvkxqxbslqbg6szd9agv1xchq9nr39-binutils-2.28.1/bin/ar
No c2hs found
No cpphs found
Using gcc version 6.4.0 given by user at:
/nix/store/df84hkmhrhx1c2zpvrhmk6aprhlzkasx-gcc-wrapper-6.4.0/bin/gcc
Using ghc version 8.0.2 found on system at:
/nix/store/f742adnlq3q9nya8wsj7mvdx438sjd0w-ghc-8.0.2/bin/ghc
Using ghc-pkg version 8.0.2 found on system at:
/nix/store/f742adnlq3q9nya8wsj7mvdx438sjd0w-ghc-8.0.2/bin/ghc-pkg
No ghcjs found
No ghcjs-pkg found
No greencard found
Using haddock version 2.17.3 found on system at:
/nix/store/f742adnlq3q9nya8wsj7mvdx438sjd0w-ghc-8.0.2/bin/haddock
No happy found
Using haskell-suite found on system at: haskell-suite-dummy-location
Using haskell-suite-pkg found on system at: haskell-suite-pkg-dummy-location
No hmake found
Using hpc version 0.67 found on system at:
/nix/store/f742adnlq3q9nya8wsj7mvdx438sjd0w-ghc-8.0.2/bin/hpc
Using hsc2hs version 0.68.1 found on system at:
/nix/store/f742adnlq3q9nya8wsj7mvdx438sjd0w-ghc-8.0.2/bin/hsc2hs
Using hscolour version 1.24 found on system at:
/nix/store/0f7wprrfij0iv9j1nrywimpw4m28dkmi-hscolour-1.24.1/bin/HsColour
No jhc found
Using ld found on system at:
/nix/store/df84hkmhrhx1c2zpvrhmk6aprhlzkasx-gcc-wrapper-6.4.0/bin/ld
No lhc found
No lhc-pkg found
No pkg-config found
Using strip version 2.28 found on system at:
/nix/store/s7nvkxqxbslqbg6szd9agv1xchq9nr39-binutils-2.28.1/bin/strip
Using tar found on system at:
/nix/store/as4nmj3ckixwci5sjiy6hx95pd6xpm8l-gnutar-1.29/bin/tar
No uhc found
building
Building ansi-wl-pprint-0.6.8.1...
Preprocessing library ansi-wl-pprint-0.6.8.1...
[1 of 2] Compiling Text.PrettyPrint.ANSI.Leijen.Internal ( Text/PrettyPrint/ANSI/Leijen/Internal.hs, dist/build/Text/PrettyPrint/ANSI/Leijen/Internal.o )
[2 of 2] Compiling Text.PrettyPrint.ANSI.Leijen ( Text/PrettyPrint/ANSI/Leijen.hs, dist/build/Text/PrettyPrint/ANSI/Leijen.o )
running tests
Package has no test suites.
haddockPhase
Running Haddock for ansi-wl-pprint-0.6.8.1...
Running hscolour for ansi-wl-pprint-0.6.8.1...
Preprocessing library ansi-wl-pprint-0.6.8.1...
Preprocessing library ansi-wl-pprint-0.6.8.1...
Haddock coverage:
  79% (117 /148) in 'Text.PrettyPrint.ANSI.Leijen.Internal'
  Missing documentation for:
    fold (Text/PrettyPrint/ANSI/Leijen/Internal.hs:221)
     (Text/PrettyPrint/ANSI/Leijen/Internal.hs:419)
     (Text/PrettyPrint/ANSI/Leijen/Internal.hs:422)
     (Text/PrettyPrint/ANSI/Leijen/Internal.hs:425)
     (Text/PrettyPrint/ANSI/Leijen/Internal.hs:428)
     (Text/PrettyPrint/ANSI/Leijen/Internal.hs:431)
     (Text/PrettyPrint/ANSI/Leijen/Internal.hs:435)
     (Text/PrettyPrint/ANSI/Leijen/Internal.hs:438)
     (Text/PrettyPrint/ANSI/Leijen/Internal.hs:441)
     (Text/PrettyPrint/ANSI/Leijen/Internal.hs:444)
     (Text/PrettyPrint/ANSI/Leijen/Internal.hs:450)
     (Text/PrettyPrint/ANSI/Leijen/Internal.hs:453)
     (Text/PrettyPrint/ANSI/Leijen/Internal.hs:456)
    width (Text/PrettyPrint/ANSI/Leijen/Internal.hs:516)
     (Text/PrettyPrint/ANSI/Leijen/Internal.hs:651)
     (Text/PrettyPrint/ANSI/Leijen/Internal.hs:656)
     (Text/PrettyPrint/ANSI/Leijen/Internal.hs:660)
    beside (Text/PrettyPrint/ANSI/Leijen/Internal.hs:701)
    column (Text/PrettyPrint/ANSI/Leijen/Internal.hs:720)
    nesting (Text/PrettyPrint/ANSI/Leijen/Internal.hs:720)
    columns (Text/PrettyPrint/ANSI/Leijen/Internal.hs:724)
    flatten (Text/PrettyPrint/ANSI/Leijen/Internal.hs:740)
    colorFunctions (Text/PrettyPrint/ANSI/Leijen/Internal.hs:807)
    oncolorFunctions (Text/PrettyPrint/ANSI/Leijen/Internal.hs:858)
    Docs (Text/PrettyPrint/ANSI/Leijen/Internal.hs:942)
    renderFits (Text/PrettyPrint/ANSI/Leijen/Internal.hs:991)
    fits1 (Text/PrettyPrint/ANSI/Leijen/Internal.hs:1059)
    fitsR (Text/PrettyPrint/ANSI/Leijen/Internal.hs:1078)
     (Text/PrettyPrint/ANSI/Leijen/Internal.hs:1170)
    spaces (Text/PrettyPrint/ANSI/Leijen/Internal.hs:1211)
    indentation (Text/PrettyPrint/ANSI/Leijen/Internal.hs:1215)
  97% (137 /141) in 'Text.PrettyPrint.ANSI.Leijen'
  Missing documentation for:
    column (Text/PrettyPrint/ANSI/Leijen/Internal.hs:720)
    columns (Text/PrettyPrint/ANSI/Leijen/Internal.hs:724)
    nesting (Text/PrettyPrint/ANSI/Leijen/Internal.hs:720)
    width (Text/PrettyPrint/ANSI/Leijen/Internal.hs:516)
Documentation created: dist/doc/html/ansi-wl-pprint/index.html,
dist/doc/html/ansi-wl-pprint/ansi-wl-pprint.txt
installing
Installing library in
/nix/store/8ij9812x4qikz6cdgvmwhpk13rpf5a2n-ansi-wl-pprint-0.6.8.1/lib/ghc-8.0.2/ansi-wl-pprint-0.6.8.1
Creating package registration file:
/nix/store/8ij9812x4qikz6cdgvmwhpk13rpf5a2n-ansi-wl-pprint-0.6.8.1/lib/ghc-8.0.2/package.conf.d/ansi-wl-pprint-0.6.8.1.conf
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/8ij9812x4qikz6cdgvmwhpk13rpf5a2n-ansi-wl-pprint-0.6.8.1
shrinking /nix/store/8ij9812x4qikz6cdgvmwhpk13rpf5a2n-ansi-wl-pprint-0.6.8.1/lib/ghc-8.0.2/x86_64-linux-ghc-8.0.2/libHSansi-wl-pprint-0.6.8.1-1HqzeLyxemT5pxZI3BlYZj-ghc8.0.2.so
stripping (with flags -S) in /nix/store/8ij9812x4qikz6cdgvmwhpk13rpf5a2n-ansi-wl-pprint-0.6.8.1/lib 
patching script interpreter paths in /nix/store/8ij9812x4qikz6cdgvmwhpk13rpf5a2n-ansi-wl-pprint-0.6.8.1
checking for references to /tmp/nix-build-ansi-wl-pprint-0.6.8.1.drv-0 in /nix/store/8ij9812x4qikz6cdgvmwhpk13rpf5a2n-ansi-wl-pprint-0.6.8.1...
shrinking RPATHs of ELF executables and libraries in /nix/store/d5cgpyixcqwzdafplczxikj4jm0d2xs2-ansi-wl-pprint-0.6.8.1-doc
patching script interpreter paths in /nix/store/d5cgpyixcqwzdafplczxikj4jm0d2xs2-ansi-wl-pprint-0.6.8.1-doc
checking for references to /tmp/nix-build-ansi-wl-pprint-0.6.8.1.drv-0 in /nix/store/d5cgpyixcqwzdafplczxikj4jm0d2xs2-ansi-wl-pprint-0.6.8.1-doc...
/nix/store/8ij9812x4qikz6cdgvmwhpk13rpf5a2n-ansi-wl-pprint-0.6.8.1

@quchen quchen merged commit 2914bbb into ekmett:master Aug 22, 2017
@quchen
Copy link
Collaborator

quchen commented Aug 22, 2017

Okay, that should be enough :-) Thanks for the patch!

@Gabriella439
Copy link
Author

You're welcome! ☺️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants