Repository navigation
Failed to build with GHCJS #419
Description
Activity
We have a patch for this in reflex-platform: reflex-frp/reflex-platform#525
That's nice, @tomsmalley ! Would you like to propose this patch to the library here as well?
Unfortunately that particular patch is unsuitable for inclusion here: we'd really need the
|| defined(ghcjs_HOST_OS), but for some reason that wasn't working for me.I have zero knowledge about GHCJS. Is the
unixpackage of GHCJS different from that of Haskell?setCloseOnExeccomes frombase. GHCJS patches around the definition too:https://github.com/ghcjs/ghcjs/blob/ghc-8.6/lib/patches/base.patch#L608
The patch for network should probably be done in the same place.
Thanks. Since
ghcjs_HOST_OSis officially supported in GHC, we should use it innetwork, too.
I will take care of this in the next week.Reacted by Veronika Romashkina and Dmitrii KovanikovHey @kazu-yamamoto, have you had a chance to check this out?
Hi! I'm getting the following error while compiling
network-3.1.4.0on Mac M2 chip from the main trunk of nixpkgs repository:checking build system type... aarch64-apple-darwin22.5.0 checking host system type... Invalid configuration `js-ghcjs': machine `js-unknown' not recognizedThere's a patch for haskell.nix build environment that extends the supported platforms list that doesn't seem to be backported to this repo. And there's a further comment regarding another issue around autoreconf (that probably explains why it wasn't backported here).
The full log:
building '/nix/store/rjckcv44i9x4hj8gxr4pd7wdlwih6w1c-network-3.1.4.0.drv'... setupCompilerEnvironmentPhase Build with /nix/store/i3r1fkbgkjwhbp6ij4i0ridi3niiv487-ghcjs-8.10.7. unpacking sources unpacking source archive /nix/store/fjcj55yz46i3vmqkrgd7g71fw2p9kkyx-network-3.1.4.0.tar.gz source root is network-3.1.4.0 setting SOURCE_DATE_EPOCH to timestamp 1000000000 of file network-3.1.4.0/tests/Spec.hs patching sources compileBuildDriverPhase setupCompileFlags: -package-db=/private/tmp/nix-build-network-3.1.4.0.drv-0/tmp.4sfvkH6lTw/setup-package.conf.d -j8 -threaded -rtsopts [1 of 1] Compiling Main ( Setup.hs, /private/tmp/nix-build-network-3.1.4.0.drv-0/tmp.4sfvkH6lTw/Main.o ) Linking Setup ... updateAutotoolsGnuConfigScriptsPhase Updating Autotools / GNU config script to a newer upstream version: ./config.sub Updating Autotools / GNU config script to a newer upstream version: ./config.guess configuring configureFlags: --verbose --prefix=/nix/store/dqj7l6as809mr3l0kv8l57jybchqrnj1-network-3.1.4.0 --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --docdir=/nix/store/1v4a4mhisvhfj8sjrbiwnzazgdd1m940-network-3.1.4.0-doc/share/doc/network-3.1.4.0 --with-gcc=clang --package-db=/private/tmp/nix-build-network-3.1.4.0.drv-0/tmp.4sfvkH6lTw/package.conf.d --ghc-options=-j8 --disable-split-objs --disable-library-profiling --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --disable-tests --disable-benchmarks --enable-library-vanilla --disable-library-for-ghci --disable-library-stripping --disable-executable-stripping --ghcjs --extra-include-dirs=/nix/store/nsyj66gs4kq1v95v5ibkjvszyyv8kn2a-libcxx-11.1.0-dev/include --extra-lib-dirs=/nix/store/ykbdajlwk2klq5p4wj28jrs8vzsbxyar-libcxx-11.1.0/lib --extra-include-dirs=/nix/store/vxmfdn3s9ji4mv9zljjfij3a2casfcgd-libcxxabi-11.1.0-dev/include --extra-lib-dirs=/nix/store/jaz1mic7ss4ka3ln779sam02mmgw1msp-libcxxabi-11.1.0/lib --extra-include-dirs=/nix/store/sgab4p8xa3vsqc6qc09fyrgr0k8sn59c-compiler-rt-libc-11.1.0-dev/include --extra-lib-dirs=/nix/store/bhwqg0slgwnnnmj7s9qnrxnykw6vswkg-compiler-rt-libc-11.1.0/lib --extra-lib-dirs=/nix/store/nzsnsxhc2grpc5628icn8drd0i03kijk-apple-framework-CoreFoundation-11.0.0/lib --extra-framework-dirs=/nix/store/nzsnsxhc2grpc5628icn8drd0i03kijk-apple-framework-CoreFoundation-11.0.0/Library/Frameworks --extra-include-dirs=/nix/store/dm123lgglzdl7nw4cnl135b4laxwgcs3-libobjc-11.0.0/include --extra-lib-dirs=/nix/store/dm123lgglzdl7nw4cnl135b4laxwgcs3-libobjc-11.0.0/lib Using Parsec parser Configuring network-3.1.4.0... Warning: Unknown/unsupported 'ghc' version detected (Cabal 3.2.1.0 supports 'ghc' version < 8.8): /nix/store/i3r1fkbgkjwhbp6ij4i0ridi3niiv487-ghcjs-8.10.7/bin/ghcjs is is based on GHC version 8.10.7 Flags chosen: devel=False Dependency base >=4.9 && <5: using base-4.14.3.0 Dependency bytestring >=0.10 && <0.12: using bytestring-0.10.12.0 Dependency deepseq -any: using deepseq-1.4.4.0 Dependency directory -any: using directory-1.3.6.0 Source component graph: component lib Configured component graph: component network-3.1.4.0-EmT0GQui0WH4Ciys0PgxPz include base-4.14.3.0-D0KSEBqJsPj2jV088Mzd5k include bytestring-0.10.12.0-A1EizoKtfkUxRIgN0VmIs include deepseq-1.4.4.0-1l24lJnqQnGEBnHHreMAq3 include directory-1.3.6.0-7XxNVUbKE5xYZT9KfdX7u Linked component graph: unit network-3.1.4.0-EmT0GQui0WH4Ciys0PgxPz include base-4.14.3.0-D0KSEBqJsPj2jV088Mzd5k include bytestring-0.10.12.0-A1EizoKtfkUxRIgN0VmIs include deepseq-1.4.4.0-1l24lJnqQnGEBnHHreMAq3 include directory-1.3.6.0-7XxNVUbKE5xYZT9KfdX7u Network.Socket=network-3.1.4.0-EmT0GQui0WH4Ciys0PgxPz:Network.Socket,Network.Socket.Address=network-3.1.4.0-EmT0GQui0WH4Ciys0PgxPz:Network.Socket.Address,Network.Socket.ByteString=network-3.1.4.0-EmT0GQui0WH4Ciys0PgxPz:Network.Socket.ByteString,Network.Socket.ByteString.Lazy=network-3.1.4.0-EmT0GQui0WH4Ciys0PgxPz:Network.Socket.ByteString.Lazy,Network.Socket.Internal=network-3.1.4.0-EmT0GQui0WH4Ciys0PgxPz:Network.Socket.Internal Ready component graph: definite network-3.1.4.0-EmT0GQui0WH4Ciys0PgxPz depends base-4.14.3.0-D0KSEBqJsPj2jV088Mzd5k depends bytestring-0.10.12.0-A1EizoKtfkUxRIgN0VmIs depends deepseq-1.4.4.0-1l24lJnqQnGEBnHHreMAq3 depends directory-1.3.6.0-7XxNVUbKE5xYZT9KfdX7u Using Cabal-3.2.1.0 compiled by ghc-8.10 Using compiler: ghcjs-8.10.7 Using install prefix: /nix/store/dqj7l6as809mr3l0kv8l57jybchqrnj1-network-3.1.4.0 Executables installed in: /nix/store/dqj7l6as809mr3l0kv8l57jybchqrnj1-network-3.1.4.0/bin Libraries installed in: /nix/store/dqj7l6as809mr3l0kv8l57jybchqrnj1-network-3.1.4.0/lib/ghcjs-8.10.7/js-ghcjs-ghcjs-8.10.7-ghc8_10_7/network-3.1.4.0-EmT0GQui0WH4Ciys0PgxPz Dynamic Libraries installed in: /nix/store/dqj7l6as809mr3l0kv8l57jybchqrnj1-network-3.1.4.0/lib/ghcjs-8.10.7/js-ghcjs-ghcjs-8.10.7-ghc8_10_7 Private executables installed in: /nix/store/dqj7l6as809mr3l0kv8l57jybchqrnj1-network-3.1.4.0/libexec/js-ghcjs-ghcjs-8.10.7-ghc8_10_7/network-3.1.4.0 Data files installed in: /nix/store/dqj7l6as809mr3l0kv8l57jybchqrnj1-network-3.1.4.0/share/js-ghcjs-ghcjs-8.10.7-ghc8_10_7/network-3.1.4.0 Documentation installed in: /nix/store/1v4a4mhisvhfj8sjrbiwnzazgdd1m940-network-3.1.4.0-doc/share/doc/network-3.1.4.0 Configuration files installed in: /nix/store/dqj7l6as809mr3l0kv8l57jybchqrnj1-network-3.1.4.0/etc No alex found Using ar found on system at: /nix/store/h2r0ivj6r22nbiaxak9lqgcx7pa69p9f-clang-wrapper-11.1.0/bin/ar No c2hs found No cpphs found No doctest found Using gcc version 11.1.0 given by user at: /nix/store/h2r0ivj6r22nbiaxak9lqgcx7pa69p9f-clang-wrapper-11.1.0/bin/clang Using ghc version 8.10.7 found on system at: /nix/store/769cblzdzw9lxkli7vffi920ay9zibf7-ghc-8.10.7/bin/ghc Using ghc-pkg version 8.10.7 found on system at: /nix/store/769cblzdzw9lxkli7vffi920ay9zibf7-ghc-8.10.7/bin/ghc-pkg Using ghcjs version 8.10.7 found on system at: /nix/store/i3r1fkbgkjwhbp6ij4i0ridi3niiv487-ghcjs-8.10.7/bin/ghcjs Using ghcjs-pkg version 8.10.7 found on system at: /nix/store/i3r1fkbgkjwhbp6ij4i0ridi3niiv487-ghcjs-8.10.7/bin/ghcjs-pkg No greencard found Using haddock version 8.10.7 found on system at: /nix/store/i3r1fkbgkjwhbp6ij4i0ridi3niiv487-ghcjs-8.10.7/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.68 found on system at: /nix/store/769cblzdzw9lxkli7vffi920ay9zibf7-ghc-8.10.7/bin/hpc Using hsc2hs version 0.68.7 found on system at: /nix/store/769cblzdzw9lxkli7vffi920ay9zibf7-ghc-8.10.7/bin/hsc2hs Using hscolour version 1.24 found on system at: /nix/store/pyywvwdrvh498zmw0lwakqv7vbx0r2af-hscolour-1.24.4/bin/HsColour No jhc found Using ld found on system at: /nix/store/h2r0ivj6r22nbiaxak9lqgcx7pa69p9f-clang-wrapper-11.1.0/bin/ld No pkg-config found Using runghc version 8.10.7 found on system at: /nix/store/769cblzdzw9lxkli7vffi920ay9zibf7-ghc-8.10.7/bin/runghc Using strip found on system at: /nix/store/h2r0ivj6r22nbiaxak9lqgcx7pa69p9f-clang-wrapper-11.1.0/bin/strip Using tar found on system at: /nix/store/dlmvg1bfqg584jkyq85c5f9fh15kx3nl-gnutar-1.34/bin/tar No uhc found /nix/store/ag6lcqchlfb3nsn71slrdr9c60a4gf88-bash-5.2-p15/bin/sh //private/tmp/nix-build-network-3.1.4.0.drv-0/network-3.1.4.0/configure '--host=js-ghcjs' '--with-compiler=ghcjs' '--prefix=/nix/store/dqj7l6as809mr3l0kv8l57jybchqrnj1-network-3.1.4.0' '--libdir=$prefix/lib/$compiler' 'CC=/nix/store/h2r0ivj6r22nbiaxak9lqgcx7pa69p9f-clang-wrapper-11.1.0/bin/clang' configure: WARNING: unrecognized options: --with-compiler checking build system type... aarch64-apple-darwin22.5.0 checking host system type... Invalid configuration `js-ghcjs': machine `js-unknown' not recognized configure: error: /nix/store/ag6lcqchlfb3nsn71slrdr9c60a4gf88-bash-5.2-p15/bin/bash //private/tmp/nix-build-network-3.1.4.0.drv-0/network-3.1.4.0/config.sub js-ghcjs failed error: builder for '/nix/store/rjckcv44i9x4hj8gxr4pd7wdlwih6w1c-network-3.1.4.0.drv' failed with exit code 1; last 10 log lines: > Using strip found on system at: > /nix/store/h2r0ivj6r22nbiaxak9lqgcx7pa69p9f-clang-wrapper-11.1.0/bin/strip > Using tar found on system at: > /nix/store/dlmvg1bfqg584jkyq85c5f9fh15kx3nl-gnutar-1.34/bin/tar > No uhc found > /nix/store/ag6lcqchlfb3nsn71slrdr9c60a4gf88-bash-5.2-p15/bin/sh //private/tmp/nix-build-network-3.1.4.0.drv-0/network-3.1.4.0/configure '--host=js-ghcjs' '--with-compiler=ghcjs' '--prefix=/nix/store/dqj7l6as809mr3l0kv8l57jybchqrnj1-network-3.1.4.0' '--libdir=$prefix/lib/$compiler' 'CC=/nix/store/h2r0ivj6r22nbiaxak9lqgcx7pa69p9f-clang-wrapper-11.1.0/bin/clang' > configure: WARNING: unrecognized options: --with-compiler > checking build system type... aarch64-apple-darwin22.5.0 > checking host system type... Invalid configuration `js-ghcjs': machine `js-unknown' not recognized > configure: error: /nix/store/ag6lcqchlfb3nsn71slrdr9c60a4gf88-bash-5.2-p15/bin/bash //private/tmp/nix-build-network-3.1.4.0.drv-0/network-3.1.4.0/config.sub js-ghcjs failed For full logs, run 'nix log /nix/store/rjckcv44i9x4hj8gxr4pd7wdlwih6w1c-network-3.1.4.0.drv'. error: 1 dependencies of derivation '/nix/store/w6n23r0gyf3n7i3hjls5clbfqqdgbmyf-ghcjs-8.10.7-with-packages.drv' failed to build error: 1 dependencies of derivation '/nix/store/8za0vi763n00z028h1ig5iyy4d9bd8z2-nix-shell.drv' failed to buildThe reason the Nix build for the
networkpackage fails with GHCJS is because of theupdate-autotools-gnu-config-scripts.shsetup hook, which regeneratesconfig.sub. Thenetworkpackage has a manual override to overrideconfig.subto support thejs-ghcjsconfiguration and the setup hook was wiping out that change.The fix is to change the
networkderivation to not run that setup hook, like this:network.overrideAttrs (old: { dontUpdateAutotoolsGnuConfigScripts = true; })
I'm trying to build the project that has
networklibrary as a dependency using GHCJS compiler, but, unfortunately, I get the following error:Could you help me to fix this?
I'm using
ghcjs-8.4. building withcabal-install version 3.1.0.0.