Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
157 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module Main where | ||
|
||
main :: IO () | ||
main = putStrLn "Hello, Haskell!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import Distribution.Simple | ||
main = defaultMain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
cabal-version: >=1.10 | ||
-- Initial package description 'cabal-simple.cabal' generated by 'cabal | ||
-- init'. For further documentation, see | ||
-- http://haskell.org/cabal/users-guide/ | ||
|
||
name: cabal-simple | ||
version: 0.1.0.0 | ||
-- synopsis: | ||
-- description: | ||
-- bug-reports: | ||
license: PublicDomain | ||
author: Rodney Lorrimar | ||
maintainer: rodney.lorrimar@iohk.io | ||
-- category: | ||
build-type: Simple | ||
|
||
library | ||
-- exposed-modules: | ||
-- other-modules: | ||
-- other-extensions: | ||
build-depends: base | ||
, extra | ||
, safe | ||
, aeson | ||
-- hs-source-dirs: | ||
default-language: Haskell2010 | ||
|
||
executable cabal-simple | ||
main-is: Main.hs | ||
-- other-modules: | ||
-- other-extensions: | ||
build-depends: base | ||
, cabal-simple | ||
, extra | ||
, optparse-applicative | ||
-- hs-source-dirs: | ||
default-language: Haskell2010 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Test a package set | ||
{ stdenv, lib, util, cabalProject', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name, dwarfdump }: | ||
|
||
with lib; | ||
|
||
let | ||
project = cabalProject' { | ||
inherit compiler-nix-name; | ||
src = testSrc "cabal-simple-debug"; | ||
}; | ||
|
||
packages = project.hsPkgs; | ||
|
||
in recurseIntoAttrs { | ||
ifdInputs = { | ||
inherit (project) plan-nix; | ||
}; | ||
run = stdenv.mkDerivation { | ||
name = "cabal-simple-debug-test"; | ||
|
||
buildCommand = '' | ||
exe="${(packages.cabal-simple.components.exes.cabal-simple.dwarf).exePath}" | ||
size=$(command stat --format '%s' "$exe") | ||
printf "size of executable $exe is $size. \n" >& 2 | ||
# fixme: | ||
printf "checking whether executable included DWARF debug info... " >& 2 | ||
(${dwarfdump}/bin/dwarfdump $exe || true) | grep -c 'libraries/base/[A-Za-z0-9/]*\.hs' | ||
(${dwarfdump}/bin/dwarfdump $exe || true) | grep -c '\/Main\.hs' | ||
touch $out | ||
''; | ||
|
||
meta = { | ||
platforms = platforms.all; | ||
# DWARF only works on linux with GHC 8.10.2 and newer | ||
disabled = compiler-nix-name == "ghc865" || compiler-nix-name == "ghc884" | ||
|| !stdenv.hostPlatform.isLinux || haskellLib.isCrossHost || stdenv.hostPlatform.isMusl; | ||
}; | ||
|
||
passthru = { | ||
# Used for debugging with nix repl | ||
inherit project packages; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters