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

replace shell.nix with Nix Flake #1154

Merged
merged 3 commits into from
Mar 14, 2023
Merged

Conversation

peterbecich
Copy link
Member

@peterbecich peterbecich commented Jan 3, 2023

@gbaz
Copy link
Contributor

gbaz commented Jan 3, 2023

Peter -- you're more qualified than me on this stuff, so I just went ahead and invited you to the hackage team so you should be able to merge prs on this repo. Please only do so unilaterally with safe-ish build/nix stuff :-)

@peterbecich
Copy link
Member Author

peterbecich commented Jan 4, 2023

Great, thanks, understood

hackage-server.cabal Outdated Show resolved Hide resolved
hackage-server.cabal Outdated Show resolved Hide resolved
@peterbecich
Copy link
Member Author

Please review part of this PR, deletion of Basic Auth: #1165

@peterbecich
Copy link
Member Author

Trying to fix the DocTests error: input-output-hk/haskell.nix#1829

@@ -647,5 +647,5 @@ test-suite DocTests
main-is: DocTestMain.hs
build-depends:
, lib-server
, doctest-parallel ^>= 0.2.2
, doctest-parallel >= 0.3.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any justification for this new lower bound? (Add to the comment below it.)
I suppose it should also be given an upper bound.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running the DocTests in the Flake currently has an error. I'm not sure yet if the error is in haskell.nix, doctest-parallel, or some other place

Investigating
input-output-hk/haskell.nix#1829
martijnbastiaan/doctest-parallel#66

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replacing ghc with ghc-lib in doctests-parallel produces a different error, but I think it may be a step in the right direction

@peterbecich peterbecich force-pushed the nix-flake branch 2 times, most recently from aaf24c8 to 1df3d4a Compare February 4, 2023 19:52
peterbecich added a commit to peterbecich/hackage-server that referenced this pull request Feb 4, 2023
the `flake.nix` build fails on these warnings: haskell#1154
@peterbecich peterbecich force-pushed the nix-flake branch 2 times, most recently from cfbecdb to 24b1e75 Compare February 5, 2023 00:28
@peterbecich
Copy link
Member Author

peterbecich commented Feb 12, 2023

about doctest-parallel
martijnbastiaan/doctest-parallel#65 (comment)

-- Andreas, 2022-10-28: `Cabal-3.8.1.0` wants `process >= 1.6.14`
-- which is too new for the `ghc < 9.4` package that is pulled in
-- by `doctest-parallel`.
-- Since, Cabal-3.8.1.0 has no reason to want such a new version
-- of process, we can solve the conflict here by allowing
-- `Cabal` to use the shipped version of `process`.
-- This workaround can be removed once `Cabal-3.8` drops
-- its (unreasonable) constraint on `process`.
-- See: https://github.com/haskell/cabal/issues/8554
allow-older: Cabal:process

peterbecich added a commit to peterbecich/hackage-server that referenced this pull request Feb 25, 2023
the `flake.nix` build fails on these warnings: haskell#1154
andreasabel pushed a commit that referenced this pull request Feb 26, 2023
* fix `incomplete-uni-patterns` warning, ignore some others

the `flake.nix` build fails on these warnings: #1154

* ignore `incomplete-uni-patterns` warning
@andreasabel
Copy link
Member

@peterbecich , FYI:

  • The doctest conundrum should now be fixed due to revisions I made to Cabal.
  • I switched the nix CI off on master as it malfunctioned over a long time. (But I am aware that you are working on a fix.)

peterbecich added a commit to peterbecich/hackage-server that referenced this pull request Feb 27, 2023
the `flake.nix` build fails on these warnings: haskell#1154
@peterbecich
Copy link
Member Author

peterbecich commented Feb 27, 2023

@andreasabel

We can also try using https://github.com/srid/haskell-flake instead of haskell.nix; I have tried this, it pulls Hackage dependencies from Nix Pkgs instead of https://github.com/input-output-hk/hackage.nix, the work involved is to pin the correct dependencies from Nix Pkgs

@andreasabel
Copy link
Member

Ah, yes, I was suprised that I had to add libgd-dev to CI yesterday, I thought we maybe had new features requiring it. But gd comes to us via hs-captcha (last updated in 2009). We use it here:


makeCaptchaHash :: IO (UTCTime, BS.ByteString, BS.ByteString)
makeCaptchaHash = do
(code, image) <- makeCaptcha
timestamp <- getCurrentTime
pure (timestamp, hashTimeAndCaptcha timestamp code, fromString "data:image/png;base64," <> Base64.encode image)

peterbecich added a commit to peterbecich/hackage-server that referenced this pull request Mar 13, 2023
the `flake.nix` build fails on these warnings: haskell#1154
Squashed commit of the following:

commit fae5c89
Author: Peter Becich <[email protected]>
Date:   Sun Mar 12 21:43:23 2023 -0700

    `nix develop` and `nix build` work

commit 9c3d54e
Author: Peter Becich <[email protected]>
Date:   Sun Mar 5 13:24:29 2023 -0800

    use https://github.com/srid/haskell-flake

commit a56bcee
Author: Peter Becich <[email protected]>
Date:   Fri Mar 3 22:21:27 2023 -0800

    update sources

commit b013302
Author: Peter Becich <[email protected]>
Date:   Tue Feb 28 18:06:28 2023 -0800

    update Cabal in both NixPkgs and hackage.nix

commit aaff29c
Author: Peter Becich <[email protected]>
Date:   Mon Feb 27 18:55:48 2023 -0800

    attempt to fix `doctest-parallel` by updating Cabal

    input-output-hk/haskell.nix#1829

commit ccc9ced
Author: Peter Becich <[email protected]>
Date:   Sun Feb 26 23:16:28 2023 -0800

    investigate `gd` build error in `nix develop` shell

    input-output-hk/haskell.nix#1865

commit efd9de5
Author: Peter Becich <[email protected]>
Date:   Sun Feb 26 01:49:08 2023 -0800

    more dependencies

commit fb94055
Author: Peter Becich <[email protected]>
Date:   Sun Feb 26 01:19:33 2023 -0800

    work on `develop` shell

commit 495a54e
Author: Peter Becich <[email protected]>
Date:   Sat Feb 4 16:28:05 2023 -0800

    replace `shell.nix` with `haskell.nix` Flake

commit e0e8f41
Author: Peter Becich <[email protected]>
Date:   Sun Feb 5 17:56:04 2023 -0800

    ignore `incomplete-uni-patterns` warning

commit e4747e9
Author: Peter Becich <[email protected]>
Date:   Sat Feb 4 15:31:06 2023 -0800

    fix `incomplete-uni-patterns` warning, ignore some others

    the `flake.nix` build fails on these warnings: haskell#1154
@peterbecich peterbecich marked this pull request as ready for review March 13, 2023 04:59
@peterbecich peterbecich merged commit 0a53ded into haskell:master Mar 14, 2023
@peterbecich peterbecich deleted the nix-flake branch March 14, 2023 02:13
@andreasabel andreasabel added the re: nix Concerning Nix stuff label Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
re: nix Concerning Nix stuff
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants