Git Product home page Git Product logo

Comments (12)

ysangkok avatar ysangkok commented on June 9, 2024 1

Thanks for the detailed instructions!

This depends on:

from servant.

ysangkok avatar ysangkok commented on June 9, 2024 1

@benz0li You need to specify which subdirs of the repo to use. For example:

source-repository-package
    type: git
    location: https://github.com/haskell-servant/servant.git
    tag: ed07f5ac6c7535089426482e1c5a842cf28544e8
    subdir: servant-server
            servant
            servant-client-core
            servant-client

from servant.

benz0li avatar benz0li commented on June 9, 2024

Cross references:

from servant.

ysangkok avatar ysangkok commented on June 9, 2024

The MonadTrans issue has already been fixed in #1627. Can you try with master instead? The solver is probably going to fail. Are you running with allow-newer? It would be good to know such that it is easier to reproduce your issue.

from servant.

benz0li avatar benz0li commented on June 9, 2024

Can you try with master instead?

No. I am trying to build pandoc which depends on servant-server which depends on servant.

Are you running with allow-newer?

Yes.

from servant.

benz0li avatar benz0li commented on June 9, 2024

It would be good to know such that it is easier to reproduce your issue.

git clone https://github.com/jgm/pandoc.git
cd pandoc
nano linux/make_artifacts.sh
diff --git a/linux/make_artifacts.sh b/linux/make_artifacts.sh
index 6d3c48954..6b025d9dc 100644
--- a/linux/make_artifacts.sh
+++ b/linux/make_artifacts.sh
@@ -1,6 +1,7 @@
 #!/bin/bash
 set -e
 
+cabal update
 cabal build $CABALOPTS --ghc-options="$GHCOPTS" pandoc-cli
 BINPATH=$(cabal list-bin $CABALOPTS --ghc-options="$GHCOPTS" pandoc-cli)
 echo "Built executable: $BINPATH"
export DOCKERIMAGE=glcr.b-data.ch/ghc/ghc-musl:9.6.1
export GHCOPTS="-fwrite-ide-info -fdiagnostics-color=always -j4 +RTS -A8m -RTS"
export CABALOPTS="--allow-newer --disable-optimization -f-export-dynamic"
export REVISION=1
docker run --rm -v $PWD:/mnt -v $PWD/linux/artifacts:/artifacts -e REVISION -e CABALOPTS -e GHCOPTS -w /mnt --userns host --memory=0 $DOCKERIMAGE bash /mnt/linux/make_artifacts.sh 2>&1 > docker.log

Build log: docker.log


Error: cabal: Failed to build servant-0.19.1 (which is required by exe:pandoc
from pandoc-cli-0.1). See the build log above for details.

from servant.

9999years avatar 9999years commented on June 9, 2024

After removing the upper version bounds for base, mtl, and transformers, I was able to build servant from master (commit ff2c1bb) with GHC 9.6.

from servant.

ysangkok avatar ysangkok commented on June 9, 2024

I was able to build servant from master (commit ff2c1bb) with GHC 9.

I am curious how this succeeded without needing to bump the http-api-data bound as proposed in #1663. http-api-data-0.5 requires base<4.18, which should exclude GHC 9.6. Which version of Cabal did you use, @9999years ? Did it choose some ancient version of http-api-data?

EDIT: Oooh, I suppose you used --allow-newer=base and not --allow-newer=servant:base. That'd explain it.

from servant.

9999years avatar 9999years commented on June 9, 2024

Yeah (actually, I'm using the Nix cabal-jailbreak tool which removes all upper version bounds, but same difference).

I did get servant to build but I haven't gotten servant-client-core to build yet. Getting a weird error, maybe just an issue with the build setup:

[ 9 of 13] Compiling Servant.Client.Core.HasClient ( src/Servant/Client/Core/HasClient.hs, dist/build/Servant/Client/Core/HasClient.o, dist/build/Servant/Client/Core/HasClient.dyn_o )
<no location info>: error:
    Failed to load interface for 'Servant.API.WithResource'
There are files missing in the 'servant-0.19.1-F93jxcBndG53cavOzkZsay' package,
try running 'ghc-pkg check'.

EDIT: Yep, just an issue with the build setup. The Nix builder was replacing the cabal file from the Git repo with one from Hackage.

from servant.

ysangkok avatar ysangkok commented on June 9, 2024

Can you try with master instead?

No.

You can use source-repository-package with Cabal or extra-deps with Stack to override the version in Hackage with the version from Git.

from servant.

benz0li avatar benz0li commented on June 9, 2024

You can use source-repository-package with Cabal or extra-deps with Stack to override the version in Hackage with the version from Git.

diff --git a/cabal.project b/cabal.project
index d5afefaa6..07f94455c 100644
--- a/cabal.project
+++ b/cabal.project
@@ -1,3 +1,6 @@
+source-repository-package
+    type: git
+    location: https://github.com/haskell-servant/servant.git
 packages: .
           pandoc-lua-engine
           pandoc-server
diff --git a/linux/make_artifacts.sh b/linux/make_artifacts.sh
index 6d3c48954..6b025d9dc 100644
--- a/linux/make_artifacts.sh
+++ b/linux/make_artifacts.sh
@@ -1,6 +1,7 @@
 #!/bin/bash
 set -e
 
+cabal update
 cabal build $CABALOPTS --ghc-options="$GHCOPTS" pandoc-cli
 BINPATH=$(cabal list-bin $CABALOPTS --ghc-options="$GHCOPTS" pandoc-cli)
 echo "Built executable: $BINPATH"
diff --git a/pandoc-server/pandoc-server.cabal b/pandoc-server/pandoc-server.cabal
index 66ecf0624..25d1613f5 100644
--- a/pandoc-server/pandoc-server.cabal
+++ b/pandoc-server/pandoc-server.cabal
@@ -59,6 +59,7 @@ library
                  data-default          >= 0.4      && < 0.8,
                  text                  >= 1.1.1.0  && < 2.1,
                  unicode-collation     >= 0.1.1    && < 0.2,
+                 servant,
                  servant-server        >= 0.19     && < 0.20,
                  skylighting           >= 0.13     && < 0.14,
                  wai                   >= 3.2      && < 3.3,

results in NoCabalFileFound "/mnt/dist-newstyle/src/servant-27d593665cbe2ddf".

ℹ️ I will try again as soon as a new version is released: https://hackage.haskell.org/package/servant

from servant.

benz0li avatar benz0li commented on June 9, 2024

@ysangkok Thanks a lot for your help.

@benz0li You need to specify which subdirs of the repo to use.

git clone https://github.com/jgm/pandoc.git
cd pandoc
nano cabal.project
diff --git a/cabal.project b/cabal.project
index d5afefaa6..cd1e26e95 100644
--- a/cabal.project
+++ b/cabal.project
@@ -1,3 +1,8 @@
+source-repository-package
+    type: git
+    location: https://github.com/haskell-servant/servant.git
+    subdir: servant-server
+            servant
 packages: .
           pandoc-lua-engine
           pandoc-server
nano linux/make_artifacts.sh
diff --git a/linux/make_artifacts.sh b/linux/make_artifacts.sh
index 6d3c48954..6b025d9dc 100644
--- a/linux/make_artifacts.sh
+++ b/linux/make_artifacts.sh
@@ -1,6 +1,7 @@
 #!/bin/bash
 set -e
 
+cabal update
 cabal build $CABALOPTS --ghc-options="$GHCOPTS" pandoc-cli
 BINPATH=$(cabal list-bin $CABALOPTS --ghc-options="$GHCOPTS" pandoc-cli)
 echo "Built executable: $BINPATH"
nano pandoc-server/pandoc-server.cabal
diff --git a/pandoc-server/pandoc-server.cabal b/pandoc-server/pandoc-server.cabal
index 66ecf0624..6472825ba 100644
--- a/pandoc-server/pandoc-server.cabal
+++ b/pandoc-server/pandoc-server.cabal
@@ -59,7 +59,7 @@ library
                  data-default          >= 0.4      && < 0.8,
                  text                  >= 1.1.1.0  && < 2.1,
                  unicode-collation     >= 0.1.1    && < 0.2,
-                 servant-server        >= 0.19     && < 0.20,
+                 servant-server,
                  skylighting           >= 0.13     && < 0.14,
                  wai                   >= 3.2      && < 3.3,
                  wai-cors              >= 0.2.7    && < 0.3
export DOCKERIMAGE=glcr.b-data.ch/ghc/ghc-musl:9.6.1
export GHCOPTS="-fwrite-ide-info -fdiagnostics-color=always -j4 +RTS -A8m -RTS"
export CABALOPTS="--allow-newer --disable-optimization -f-export-dynamic"
export REVISION=1
docker run --rm -v $PWD:/mnt -v $PWD/linux/artifacts:/artifacts -e REVISION -e CABALOPTS -e GHCOPTS -w /mnt --userns host --memory=0 $DOCKERIMAGE bash /mnt/linux/make_artifacts.sh 2>&1 > docker.log

Build log: docker.log


And some more output from the docker run command, because the build is failing:

src/Text/Pandoc/Writers/EPUB.hs:254:5: warning: [GHC-53633] [-Woverlapping-patterns]
    Pattern match is redundant
    In an equation for ‘addMetadataFromXML’:
        addMetadataFromXML e@(Element (QName name _ (Just "dc")) attrs _ _)
                           md | name == "type" = ...
    |
254 |   | name == "type" = md { epubType = Just $ strContent e }
    |     ^^^^^^^^^^^^^^
/usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: warning: type and size of dynamic symbol `pandoczm3zi1zi2zminplace_TextziPandocziOptions_zdfDefaultReaderOptions_closure' are not defined
/usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: warning: type and size of dynamic symbol `pandoczm3zi1zi2zminplace_TextziPandocziOptions_zdfDefaultWriterOptions_closure' are not defined
/usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: warning: type and size of dynamic symbol `pandoczm3zi1zi2zminplace_TextziPandocziFilterziEnvironment_zdfDefaultEnvironment_closure' are not defined
/usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: warning: type and size of dynamic symbol `pandoczm3zi1zi2zminplace_TextziPandocziOptions_zdfDefaultReaderOptions_closure' are not defined
/usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: warning: type and size of dynamic symbol `pandoczm3zi1zi2zminplace_TextziPandocziOptions_zdfDefaultWriterOptions_closure' are not defined

ℹ️ Build is failing at Checking that the binary is statically linked..., because it is not:

file "linux-arm64/pandoc"
linux-arm64/pandoc: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-aarch64.so.1, stripped

👉 But this has nothing to do with servant.

from servant.

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.