Code Monkey home page Code Monkey logo

Comments (8)

tibbe avatar tibbe commented on August 17, 2024

Could you provide complete instructions to reproduce and include cabal and OS version please? This works for me:

git clone https://github.com/tibbe/hashable
cd hashable
# Check out master at time of writing:
git checkout -b repro 7438adcfb233eb326a99ea12a8baf3356c93ffc9
cabal configure && cabal sdist
mkdir tmp
cd tmp
tar zxf ../dist/hashable-1.2.3.1.tar.gz
cd hashable-1.2.3.1
cabal test

from hashable.

peti avatar peti commented on August 17, 2024
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.6.3

$ curl http://hackage.haskell.org/package/hashable-1.2.3.1/hashable-1.2.3.1.tar.gz | tar xz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 23845  100 23845    0     0   149k      0 --:--:-- --:--:-- --:--:--  253k

$ cd hashable-1.2.3.1

$ ghc --make Setup && ./Setup configure --enable-tests && ./Setup build && ./Setup test
[1 of 1] Compiling Main             ( Setup.hs, Setup.o )
Linking Setup ...
Configuring hashable-1.2.3.1...
Building hashable-1.2.3.1...
Preprocessing library hashable-1.2.3.1...
[1 of 3] Compiling Data.Hashable.Class ( Data/Hashable/Class.hs, dist/build/Data/Hashable/Class.o )
[2 of 3] Compiling Data.Hashable.Generic ( Data/Hashable/Generic.hs, dist/build/Data/Hashable/Generic.o )
[3 of 3] Compiling Data.Hashable    ( Data/Hashable.hs, dist/build/Data/Hashable.o )
In-place registering hashable-1.2.3.1...
Preprocessing test suite 'tests' for hashable-1.2.3.1...

tests/Regress.hs:8:18:
    Could not find module `Regress.Mmap'
    Use -v to see a list of the files searched for.

With GHC 7.8.4 (a.k.a. Cabal 1.18.x) this works fine.

from hashable.

tibbe avatar tibbe commented on August 17, 2024

Still works for me. Try this somewhat more explicit command line, so you see which Cabal version Setup.hs gets linked against.

ghc-7.6.3 --make Setup -no-user-package-db && ./Setup --version && ./Setup configure -w ghc-7.6.3 --enable-tests --user && ./Setup build && ./Setup test

Note that I

  • added -no-user-package-db when building Setup.hs to make sure I use the version of Cabal in the global package DB (i.e. the one that shipped with GHC, unless you've installed an updated version in your global package DB), and
  • added --user to the configure step as I have the test dependencies installed in the user package DB.

Also you didn't tell me which OS you're on. Regress.Mmap has an OS guard in front of it in hashable.cabal.

from hashable.

peti avatar peti commented on August 17, 2024
/tmp/hashable-1.2.3.1$ uname -a
Linux peti 3.14.27 #1-NixOS SMP Thu Jan 1 00:00:01 UTC 1970 x86_64 GNU/Linux

/tmp/hashable-1.2.3.1$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.6.3

/tmp/hashable-1.2.3.1$ ghc-pkg list
/nix/store/0x4kjirfmwpfpqvfl41q3h7v69rfs6h7-ghc-7.6.3/lib/ghc-7.6.3/package.conf.d
   Cabal-1.16.0
   HUnit-1.2.5.2
   QuickCheck-2.7.6
   ansi-terminal-0.6.2.1
   ansi-wl-pprint-0.6.7.1
   array-0.4.0.1
   base-4.6.0.1
   bin-package-db-0.0.0.0
   binary-0.5.1.1
   bytestring-0.10.0.2
   containers-0.5.0.0
   deepseq-1.3.0.1
   directory-1.2.0.1
   extensible-exceptions-0.1.1.4
   filepath-1.3.0.1
   ghc-7.6.3
   ghc-prim-0.3.0.0
   haskell2010-1.1.1.0
   haskell98-2.0.0.2
   hoopl-3.9.0.0
   hostname-1.0
   hpc-0.6.0.0
   integer-gmp-0.5.0.0
   mtl-2.2.1
   old-locale-1.0.0.5
   old-time-1.1.0.1
   pretty-1.1.1.0
   primitive-0.5.4.0
   process-1.1.0.2
   random-1.1
   regex-base-0.93.2
   regex-posix-0.95.2
   rts-1.0
   template-haskell-2.8.0.0
   test-framework-0.8.1.1
   test-framework-hunit-0.3.0.1
   test-framework-quickcheck2-0.3.0.3
   text-1.2.0.4
   tf-random-0.5
   time-1.4.0.1
   transformers-0.4.2.0
   unix-2.6.0.1
   xml-1.3.13

/tmp/hashable-1.2.3.1$ ghc-7.6.3 --make Setup -no-user-package-db && ./Setup --version && ./Setup configure -w ghc-7.6.3 --enable-tests --user && ./Setup build && ./Setup test
[1 of 1] Compiling Main             ( Setup.hs, Setup.o )
Linking Setup ...
Cabal library version 1.16.0
Configuring hashable-1.2.3.1...
Building hashable-1.2.3.1...
Preprocessing library hashable-1.2.3.1...
[1 of 3] Compiling Data.Hashable.Class ( Data/Hashable/Class.hs, dist/build/Data/Hashable/Class.o )
[2 of 3] Compiling Data.Hashable.Generic ( Data/Hashable/Generic.hs, dist/build/Data/Hashable/Generic.o )
[3 of 3] Compiling Data.Hashable    ( Data/Hashable.hs, dist/build/Data/Hashable.o )
In-place registering hashable-1.2.3.1...
Preprocessing test suite 'tests' for hashable-1.2.3.1...

tests/Regress.hs:8:18:
    Could not find module `Regress.Mmap'
    Use -v to see a list of the files searched for.

from hashable.

tibbe avatar tibbe commented on August 17, 2024

I can reproduce it now. It's a bug in Cabal-1.16 that makes it not put the file in the tarball even though it's listed in the .cabal file. Solution: upgrade to a new cabal (backporting the fix is not worth it.)

from hashable.

peti avatar peti commented on August 17, 2024

Why would I want to update Cabal? I have no intention of building a release tarball. I just want to compile the tarball that's published on Hackage.

from hashable.

tibbe avatar tibbe commented on August 17, 2024

The tarball on Hackage contains the file:

$ cabal unpack hashable-1.2.3.1
Unpacking to hashable-1.2.3.1/
$ ls hashable-1.2.3.1/tests/Regress
Mmap.hsc

Using a newer cabal to build the test suite works:

Old Cabal:

$ ghc-7.6.3 --make Setup -package Cabal-1.16.0 && ./Setup --version && ./Setup configure -w ghc-7.6.3 --enable-tests --user && ./Setup build && ./Setup test
Cabal library version 1.16.0
Configuring hashable-1.2.3.1...
Building hashable-1.2.3.1...
Preprocessing library hashable-1.2.3.1...
[1 of 3] Compiling Data.Hashable.Class ( Data/Hashable/Class.hs, dist/build/Data/Hashable/Class.o )
[2 of 3] Compiling Data.Hashable.Generic ( Data/Hashable/Generic.hs, dist/build/Data/Hashable/Generic.o )
[3 of 3] Compiling Data.Hashable    ( Data/Hashable.hs, dist/build/Data/Hashable.o )
In-place registering hashable-1.2.3.1...
Preprocessing test suite 'tests' for hashable-1.2.3.1...

tests/Regress.hs:8:18:
    Could not find module `Regress.Mmap'
    Use -v to see a list of the files searched for.

New Cabal:

$ ghc-7.6.3 --make Setup -package Cabal-1.20.0.0 && ./Setup --version && ./Setup configure -w ghc-7.6.3 --enable-tests --user && ./Setup build && ./Setup test
[1 of 1] Compiling Main             ( Setup.hs, Setup.o ) [Distribution.Simple changed]
Linking Setup ...
Cabal library version 1.20.0.0
Configuring hashable-1.2.3.1...
Building hashable-1.2.3.1...
Preprocessing library hashable-1.2.3.1...
[1 of 3] Compiling Data.Hashable.Class ( Data/Hashable/Class.hs, dist/build/Data/Hashable/Class.o )
[2 of 3] Compiling Data.Hashable.Generic ( Data/Hashable/Generic.hs, dist/build/Data/Hashable/Generic.o )
[3 of 3] Compiling Data.Hashable    ( Data/Hashable.hs, dist/build/Data/Hashable.o )
In-place registering hashable-1.2.3.1...
Preprocessing test suite 'tests' for hashable-1.2.3.1...
[1 of 4] Compiling Regress.Mmap     ( dist/build/tests/tests-tmp/Regress/Mmap.hs, dist/build/tests/tests-tmp/Regress/Mmap.o )
[2 of 4] Compiling Regress          ( tests/Regress.hs, dist/build/tests/tests-tmp/Regress.o )
[3 of 4] Compiling Properties       ( tests/Properties.hs, dist/build/tests/tests-tmp/Properties.o )

tests/Properties.hs:179:1: Warning:
    Defined but not used: `pProduct2'

tests/Properties.hs:182:1: Warning:
    Defined but not used: `pProduct3'
[4 of 4] Compiling Main             ( tests/Main.hs, dist/build/tests/tests-tmp/Main.o )
Linking dist/build/tests/tests ...
Running 1 test suites...
Test suite tests: RUNNING...
Test suite tests: PASS
Test suite logged to: dist/test/hashable-1.2.3.1-tests.log
1 of 1 test suites (1 of 1 test cases) passed.

from hashable.

peti avatar peti commented on August 17, 2024

Ah, okay. Now I see. The file is there, but the old Cabal version doesn't pick it up for the build. Okay. Thank you for your help!

from hashable.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.