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

Custom setup breaks GHCJS version detection #4630

Closed
cocreature opened this issue Jul 26, 2017 · 5 comments
Closed

Custom setup breaks GHCJS version detection #4630

cocreature opened this issue Jul 26, 2017 · 5 comments

Comments

@cocreature
Copy link
Collaborator

When building a package which uses a custom setup (e.g. http-api-data) the build fails after trying to run the custom setup due to

Build profile: -w ghcjs-0.2.1 -O0
In order, the following will be built:
 - http-api-data-0.3.7.1 (lib:http-api-data) (configuration changed)
creating /home/moritz/code/haskell/http-api-data/dist-newstyle/build
creating /home/moritz/code/haskell/http-api-data/dist-newstyle/tmp
creating
/home/moritz/code/haskell/http-api-data/dist-newstyle/build/x86_64-linux/ghcjs-0.2.1/http-api-data-0.3.7.1/noopt
creating
/home/moritz/code/haskell/http-api-data/dist-newstyle/build/x86_64-linux/ghcjs-0.2.1/http-api-data-0.3.7.1/noopt/cache
creating
/home/moritz/code/haskell/http-api-data/dist-newstyle/build/x86_64-linux/ghcjs-0.2.1/http-api-data-0.3.7.1/noopt/setup
/home/moritz/code/haskell/ghcjs/.cabal-sandbox/bin/ghcjs --make -fbuilding-cabal-package -odir /home/moritz/code/haskell/http-api-data/dist-newstyle/build/x86_64-linux/ghcjs-0.2.1/http-api-data-0.3.7.1/noopt/setup -hidir /home/moritz/code/haskell/http-api-data/dist-newstyle/build/x86_64-linux/ghcjs-0.2.1/http-api-data-0.3.7.1/noopt/setup -i -i/home/moritz/code/haskell/http-api-data/. -optP-include -optP/home/moritz/code/haskell/http-api-data/dist-newstyle/build/x86_64-linux/ghcjs-0.2.1/http-api-data-0.3.7.1/noopt/setup/setup_macros.h -hide-all-packages -no-user-package-db -package-db /home/moritz/.cabal/store/ghcjs-0.2.1/package.db -package-db /home/moritz/code/haskell/http-api-data/dist-newstyle/packagedb/ghcjs-0.2.1 -package-id Cabal-1.24.0.0-JpQ2gKXIYsu1GQ7K8uTVQY -package-id base-4.9.0.0-KJoxgaxCLaB5JRExU4r59H -package-id cabal-doctest-1.0.2-cb0a75257165794002e9a6d1edc974b8c63ba3d033f07e0131711cf387e1b6c0 /home/moritz/code/haskell/http-api-data/dist-newstyle/build/x86_64-linux/ghcjs-0.2.1/http-api-data-0.3.7.1/noopt/setup/setup.hs -o /home/moritz/code/haskell/http-api-data/dist-newstyle/build/x86_64-linux/ghcjs-0.2.1/http-api-data-0.3.7.1/noopt/setup/setup -build-runner
Linking /home/moritz/code/haskell/http-api-data/dist-newstyle/build/x86_64-linux/ghcjs-0.2.1/http-api-data-0.3.7.1/noopt/setup/setup.jsexe (Main)
/home/moritz/code/haskell/http-api-data/dist-newstyle/build/x86_64-linux/ghcjs-0.2.1/http-api-data-0.3.7.1/noopt/setup/setup
configure --verbose=2
--builddir=/home/moritz/code/haskell/http-api-data/dist-newstyle/build/x86_64-linux/ghcjs-0.2.1/http-api-data-0.3.7.1/noopt
--ghcjs --prefix=/home/moritz/.cabal --bindir=/home/moritz/.cabal/bin
--libdir=/home/moritz/.cabal/lib/x86_64-linux-ghcjs-0.2.1-ghc8_0_2/http-api-data-0.3.7.1-inplace
--libsubdir=
--libexecdir=/home/moritz/.cabal/libexec/x86_64-linux-ghcjs-0.2.1-ghc8_0_2/http-api-data-0.3.7.1/
--datadir=/home/moritz/.cabal/share/x86_64-linux-ghcjs-0.2.1-ghc8_0_2/http-api-data-0.3.7.1
--datasubdir=
--docdir=/home/moritz/.cabal/share/doc/x86_64-linux-ghcjs-0.2.1-ghc8_0_2/http-api-data-0.3.7.1
--htmldir=/home/moritz/.cabal/share/doc/x86_64-linux-ghcjs-0.2.1-ghc8_0_2/http-api-data-0.3.7.1/html
--haddockdir=/home/moritz/.cabal/share/doc/x86_64-linux-ghcjs-0.2.1-ghc8_0_2/http-api-data-0.3.7.1/html
--sysconfdir=/home/moritz/.cabal/etc --enable-library-vanilla
--disable-library-profiling --disable-shared --disable-executable-dynamic
--disable-profiling --profiling-detail=default
--library-profiling-detail=default --disable-optimization --disable-debug-info
--disable-library-for-ghci --disable-split-objs --disable-executable-stripping
--disable-library-stripping --package-db=clear --package-db=global
--package-db=/home/moritz/.cabal/store/ghcjs-0.2.1/package.db
--package-db=/home/moritz/code/haskell/http-api-data/dist-newstyle/packagedb/ghcjs-0.2.1
--flags=-use-text-show --ipid=http-api-data-0.3.7.1-inplace
--extra-prog-path=/home/moritz/.cabal/bin
--dependency=base=base-4.9.0.0-KJoxgaxCLaB5JRExU4r59H
--dependency=attoparsec=attoparsec-0.13.0.2-4Hm07TQ2HKo3AutijuxNoQ
--dependency=attoparsec-iso8601=attoparsec-iso8601-1.0.0.0-8e2e7a7f965a1b1d2abea24747ade24f0fe899a873c553d4633d9a7f47af645c
--dependency=bytestring=bytestring-0.10.8.1-5wktHSR60zC2wTr02OpyVU
--dependency=containers=containers-0.5.7.1-9AY76Rzb1QLJmP8p4wSZRz
--dependency=hashable=hashable-1.2.4.0-JK3S4kKZeqBK2uNUBMBbVU
--dependency=http-types=http-types-0.9.1-6b842cb6fb98371535be422715591786ca04d70e041b2654235f597fdc1d981f
--dependency=text=text-1.2.2.1-K5kKypz1wJJhsTy1Ol15P
--dependency=time=time-1.6.0.1-Lja9T8bqIudL0xdsRMOCyg
--dependency=time-locale-compat=time-locale-compat-0.1.1.3-fa26aec6b3187da12e232e5e737dfd3a9d7a4648b758ae6519e37a1f7c6ce299
--dependency=unordered-containers=unordered-containers-0.2.7.0-Fe3UEgcqpuID5CLQ12c8Uy
--dependency=uri-bytestring=uri-bytestring-0.2.3.3-a41b9e8c721596e230a5f618ab29d49fb5d4a56e6059be428435c69dcdb1ca91
--dependency=uuid-types=uuid-types-1.0.3-fe54451c4fc4935e3c1afd36736678f0915bc04703d814b318f9b69ee5d43912
--disable-tests --disable-coverage --exact-configuration --disable-benchmarks
--with-ghcjs=/home/moritz/code/haskell/ghcjs/.cabal-sandbox/bin/ghcjs
--with-ghcjs-pkg=/home/moritz/code/haskell/ghcjs/.cabal-sandbox/bin/ghcjs-pkg
--ghc-option=-hide-all-packages
Configuring http-api-data-0.3.7.1...
Warning: cannot determine version of
/home/moritz/code/haskell/ghcjs/.cabal-sandbox/bin/ghcjs :
"Linking a.jsexe ()\n"
setup: The program 'ghcjs' version >=0.1 is required but the version of
/home/moritz/code/haskell/ghcjs/.cabal-sandbox/bin/ghcjs could not be
determined.

It seems like it’s looking at the wrong output of ghcjs, ghcjs --numeric-ghcjs-version outputs 0.2.1 as expected. Afaict (using ghcjs-pkg and cabal-plan) the custom setup is built against Cabal-1.24.0.0. I installed ghcjs from the ghc-8.0 branch.

This issue is reproducible with new-build and sandboxes on both cabal-install-1.24 and cabal-install-HEAD.

@23Skidoo
Copy link
Member

/cc @luite

@ezyang
Copy link
Contributor

ezyang commented Jul 27, 2017

Is it possible to strace -e process and post the trace? I'm curious what the actual invocation is. Also, if you can figure out what version of Cabal library the setup script is being linked against, that would also be helpful. (I don't have a ghcjs install handy so it is difficult for me to try repro'ing)

@cocreature
Copy link
Collaborator Author

Here’s an strace of running the setup https://gist.githubusercontent.com/cocreature/0576db3ab4cf3c4e6bfdc7a693d890b1/raw/cfcea7fb6041602fd2bac1bb29a87df914400367/gistfile1.txt Sadly I’m unable to spot anything useful. It looks like it’s never even calling something like ghcjs --numeric-ghcjs-version.

Setup.hs is linked against Cabal-1.24.0.0 (according to cabal new-build -v3).

@cocreature
Copy link
Collaborator Author

Closing since it looks like this probably related to using the wrong version of node ghcjs/ghcjs#470

@nomeata
Copy link
Contributor

nomeata commented Sep 4, 2017

I also observe this problem: #4742

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

No branches or pull requests

5 participants