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

fix postfix apt installation & remove ** usage so cabal copy works. #826

Closed
wants to merge 3 commits into from
Closed

fix postfix apt installation & remove ** usage so cabal copy works. #826

wants to merge 3 commits into from

Conversation

dsturnbull
Copy link

Minimum changes I needed to have docker build . work.

  • ghc-8.2.1 is no longer available in ppa:hvr/ghc
  • The ** glob didn't work so I flattened the data-files section
  • cabal-install-2.4 was also needed
  • postfix refuses to obey -y, but a noninteractive frontend for apt-get works.

@haskell haskell deleted a comment from hvriedel Apr 26, 2019
@hvr
Copy link
Member

hvr commented Apr 26, 2019

The ** glob didn't work so I flattened the data-files section

That's news to me; can you elaborate on why you think those wouldn't work?

And btw, the Dockerfile desperately needs to be converted to use v2-* commands, as building with the old-style commands is not something well-tested nor actively supported.

@dsturnbull
Copy link
Author

The ** glob didn't work so I flattened the data-files section

That's news to me; can you elaborate on why you think those wouldn't work?

I can probably fix this up. I think I was using an older cabal version initially.

And btw, the Dockerfile desperately needs to be converted to use v2-* commands, as building with the old-style commands is not something well-tested nor actively supported.

This one is more problematic. The sandbox command is v1-only. Not sure if I can just skip it or not.

@hvr
Copy link
Member

hvr commented Jun 17, 2019

This one is more problematic. The sandbox command is v1-only. Not sure if I can just skip it or not.

Well, there's a todo-comment near the sandbox command which hints at it that cabal sandbox is deprecated and no longer needed in the v2-build paradigm (i.e. v2-build was created to properly solve the problem that sandbox workarounded...) :-)

RUN cabal sandbox init
# TODO: Switch to Nix-style cabal new-install
RUN cabal install --only-dependencies --enable-tests -j --force-reinstalls

@dsturnbull
Copy link
Author

The ** syntax just doesn't work with the build as it is.

/root/.cabal/store/ghc-8.2.2/incoming/new-7/root/.cabal/store/ghc-8.2.2/hackage-server-0.5.1-3eca8c7e97a2dae3ce64cbec3e37887041b4d7e1feba6279abc894a42c624ca2/share/templates/Html: copyFile: does not exist (No such file or directory)

There is no reason why cabal-2.4 can't figure it out, but it doesn't.

I've pushed the v2- style updates though.

@peti peti mentioned this pull request Jul 11, 2019
@peti
Copy link
Contributor

peti commented Jul 11, 2019

I have run a build of the current master branch with cabal-install version 2.4.1.0 and ghc 8.2.2 on NixOS, and I get the same error as the docker build above (which uses the same setup on Ubuntu):

$ cabal new-install -j .
Wrote tarball sdist to /home/simons/src/hackage-server/dist-newstyle/sdist/hackage-server-0.5.1.tar.gz
Resolving dependencies...
Build profile: -w ghc-8.2.2 -O1
In order, the following will be built (use -v for more details):
 - hackage-server-0.5.1 (lib:lib-server) (requires build)
 - hackage-server-0.5.1 (exe:hackage-build) (requires build)
 - hackage-server-0.5.1 (exe:hackage-server) (requires build)
 - hackage-server-0.5.1 (exe:hackage-mirror) (requires build)
[...]
[169 of 169] Compiling Distribution.Server ( Distribution/Server.hs, dist/build/lib-server/Distribution/Server.o )
/home/simons/.cabal/store/ghc-8.2.2/incoming/new-8190/home/simons/.cabal/store/ghc-8.2.2/hackage-server-0.5.1-445eec1b86c4b1649e7cb92b3c4c62208ccc4f9744ba085d51bd7b47dca66816/share/templates/Users: copyFile: does not exist (No such file or directory)
cabal: Failed to build lib:lib-server from hackage-server-0.5.1 (which is
required by exe:hackage-build from hackage-server-0.5.1, exe:hackage-server
from hackage-server-0.5.1 and others). See the build log above for details.

Not that the error occurs while cabal is still compiling. If I run new-build rather then new-install, then the build succeeds.

@peti
Copy link
Contributor

peti commented Jul 12, 2019

For what it's worth, https://cloud.docker.com/repository/registry-1.docker.io/psimons/hackage-server/builds/fb8b0316-6639-41d4-a91f-e2136e2eb212 shows a log of the complete docker build (and the failure):

[...]
[169 of 169] Compiling Distribution.Server ( Distribution/Server.hs, dist/build/lib-server/Distribution/Server.o )
/root/.cabal/store/ghc-8.2.2/incoming/new-6/root/.cabal/store/ghc-8.2.2/hackage-server-0.5.1-7fefae90d236fca2cb7bc003f1543ad88119f0e9886624c2a5520a059b0688a0/share/templates/Users: copyFile: does not exist (No such file or directory)
Warning: Some package(s) failed to build. Try rerunning with -j1 if you can't
see the error.
cabal: Failed to build lib:lib-server from hackage-server-0.5.1 (which is
required by exe:hackage-build from hackage-server-0.5.1, exe:hackage-server
from hackage-server-0.5.1 and others). The failure occurred during the final
install step.

@quasicomputational
Copy link

Ah, this is getting bitten by haskell/cabal#6125 for data-files / copyFile thing. That's fixed in Cabal HEAD.

@peti
Copy link
Contributor

peti commented Jul 12, 2019

#836 fixes the build. It uses a locally compiled version of cabal-install from the current git master.

@ocramz
Copy link
Collaborator

ocramz commented Aug 5, 2019

@peti shall we close this?

@peti
Copy link
Contributor

peti commented Aug 5, 2019

@peti shall we close this?

Yes, I all issue this PR addresses are now fixed in master.

@dsturnbull dsturnbull closed this Aug 9, 2019
@dsturnbull dsturnbull deleted the make-docker-work branch August 9, 2019 05:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants