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

Build fixes #1022

Merged
merged 11 commits into from
Jul 6, 2023
Merged

Build fixes #1022

merged 11 commits into from
Jul 6, 2023

Conversation

exitmouse
Copy link

I gather that main is unstable right now, and also it seems like most of the dev work is in cycseq. But...
I was trying to get Tidal to build anyway, so I figured I'd attempt to send a minimal PR that makes the build commands work. With these changes, on my local machine I can run

cabal v2-build --allow-newer=base,template-haskell --enable-tests --enable-benchmarks all

and then both cabal v2-test and cabal v2-bench run successfully. Hopefully that also means the CI will work.

I'm not totally sure that the Arc benchmarks I deleted should be deleted, but I couldn't find 2.0.0 equivalents for those functions. Let me know if I should replace them.

Jesse Selover added 5 commits June 22, 2023 22:21
The main change is dropping most of the Arc benchmarks in PatternB.hs, as those functions no longer exist.
SequenceTest is changed to avoid comparing metadata now that sequences carry metadata, and SignalBaseTest was
missing some imports.
Copy link
Member

@yaxu yaxu left a comment

Choose a reason for hiding this comment

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

Thanks a lot for this, it would be great to get this building again. I've identified the missing functions if you fancy fixing those.

bench/Speed/Tidal/PatternB.hs Show resolved Hide resolved
bench/Speed/Tidal/PatternB.hs Show resolved Hide resolved
bench/Speed/Tidal/PatternB.hs Show resolved Hide resolved
bench/Speed/Tidal/PatternB.hs Show resolved Hide resolved
@exitmouse
Copy link
Author

Thanks! I'm also going to try to understand these linking failures on the ci.

@exitmouse
Copy link
Author

Ok -- the ci check is green! The linker issue was because dontcrash tests tidal-listener, but tidal-listener.cabal recently added -dynamic in the build options, which stops ghc from building static object files. With -dynamic-too it should build both static and dynamic ones.
Nix and the windows build listener are still failing, but the errors are very early and don't seem to have anything to do with Tidal. Possibly bugs in the workflow files?

@exitmouse
Copy link
Author

The nix failures seem to be from cachix/install-nix-action#183, and the windows build ones from haskell/actions#264. Both seem like they just need version bumps... I'll see if I can try that.

@exitmouse
Copy link
Author

Well, now the nix build is failing because hosc has the wrong version in nixpkgs, and the windows build is failing because

when making flags consistent: warning:
-dynamic-too is not supported on Windows

@exitmouse
Copy link
Author

@mitchmindtree, I'm not sure if you're still maintaining this nix flake, but it appears (to my uneducated eye) that we need a version of hosc that's not available in nixpkgs, and I've got no idea how to get it. The failing nix builds are the last unsuccessful checks!

@exitmouse exitmouse requested a review from yaxu June 26, 2023 21:38
@yaxu
Copy link
Member

yaxu commented Jun 28, 2023

Thanks @exitmouse

Yes looks like tidal is still on 1.9.2 in nixpkgs with the older hosc dependency. It seems it just grabs packages from stackage which does have the latest versions. Not sure how to get these versions bumped..

@yaxu
Copy link
Member

yaxu commented Jun 28, 2023

@polymorphicengine do the changes to the windows build here look good to you?

@polymorphicengine
Copy link
Collaborator

yeah, compiling with -dynamic-too is right, not sure if we should disable the listener workflows at the moment though since they are all broken (they run through, but produce a binary that doesn't work properly)

@mitchmindtree
Copy link
Contributor

mitchmindtree commented Jun 28, 2023

Yes looks like tidal is still on 1.9.2 in nixpkgs with the older hosc dependency. It seems it just grabs packages from stackage which does have the latest versions. Not sure how to get these versions bumped..

Just to clarify, the version of tidal used in the Nix flake is the copy local to this repo.

It looks like the reason the build is failing is that the latest pinned hosc version in nixpkgs is 0.19.1, whereas Tidal 2.0 now requires hosc >=0.20 && <0.21.

It looks like we can update nixpkgs by running the update-stackage script while cd'd into the root of the nixpkgs repo like so:

./maintainers/scripts/haskell/update-stackage.sh

but this updates the whole set of packages to their latest versions, so might take some time to review. Edit: It looks like there's a WIP update to hackage and stackage here, but even this doesn't yet update hosc. It looks like the plan is to run another update of the packages soon after it lands NixOS/nixpkgs#236431 (comment).

There's almost certainly a way to override hosc with the latest version locally in our flake.nix without waiting for all of nixpkgs to update - there's likely some answers in here https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/haskell.section.md, i'll do some digging soon.

This resolves the nix build issue encountered at
tidalcycles#1022, mentioned in
tidalcycles#1022 (comment).

Namely, as Tidal 2.0 requires `hosc` `0.20` but nixpkgs currently only
provides `0.19.1`, we temporarily include `hosc` `0.20` directly from
its source.

This commit also updates the nixpkgs pin to the latest version while
we're at it.
@mitchmindtree
Copy link
Contributor

I've opened a PR against this branch that resolves the hosc 0.20 version issue here exitmouse#1.

@mitchmindtree
Copy link
Contributor

Out of curiosity, should tidal-parse and tidal-listener be building with the local main branch version of Tidal? Or is the plan to update those later on?

E.g. it looks like tidal-parse still expects Tidal 1.10, and after fixing this hosc issue which allows the tidal lib to build it looks like the tidal-listener nix build continues to fail with a GHC panic:

tidal-listener> [1 of 5] Compiling Sound.Tidal.Listener.Config ( src/Sound/Tidal/Listener/Config.hs, dist/build/Sound/Tidal/Listener/Config.p_o, dist/build/Sound/Tidal/Listener/Config.dyn_o )
tidal-listener> <no location info>: error:
tidal-listener>     ghc: panic! (the 'impossible' happened)
tidal-listener>   (GHC version 9.2.8:
tidal-listener>         lookupGlobal
tidal-listener>   Failed to load interface for ‘GHC.Num.BigNat’
tidal-listener>   Perhaps you haven't installed the "p_dyn" libraries for package ‘ghc-bignum’?
tidal-listener>   Use -v (or `:set -v` in ghci) to see a list of the files searched for.
tidal-listener>   Call stack:
tidal-listener>       CallStack (from HasCallStack):
tidal-listener>         callStackDoc, called at compiler/GHC/Utils/Panic.hs:181:37 in ghc:GHC.Utils.Panic
tidal-listener>         pprPanic, called at compiler/GHC/Tc/Utils/Env.hs:153:32 in ghc:GHC.Tc.Utils.Env
tidal-listener> Please report this as a GHC bug:  https://www.haskell.org/ghc/reportabug
tidal-listener>
tidal-listener> [3 of 5] Compiling Sound.Tidal.Listener.Parse ( src/Sound/Tidal/Listener/Parse.hs, dist/build/Sound/Tidal/Listener/Parse.p_o, dist/build/Sound/Tidal/Listener/Parse.dyn_o )
tidal-listener> <no location info>: error:
tidal-listener>     ghc: panic! (the 'impossible' happened)
tidal-listener>   (GHC version 9.2.8:
tidal-listener>         lookupGlobal
tidal-listener>   Failed to load interface for ‘GHC.Num.BigNat’
tidal-listener>   Perhaps you haven't installed the "p_dyn" libraries for package ‘ghc-bignum’?
tidal-listener>   Use -v (or `:set -v` in ghci) to see a list of the files searched for.
tidal-listener>   Call stack:
tidal-listener>       CallStack (from HasCallStack):
tidal-listener>         callStackDoc, called at compiler/GHC/Utils/Panic.hs:181:37 in ghc:GHC.Utils.Panic
tidal-listener>         pprPanic, called at compiler/GHC/Tc/Utils/Env.hs:153:32 in ghc:GHC.Tc.Utils.Env
tidal-listener> Please report this as a GHC bug:  https://www.haskell.org/ghc/reportabug

Fix nix build for Tidal 2.0 (include hosc 0.20). Update nixpkgs input.
@yaxu
Copy link
Member

yaxu commented Jun 28, 2023

@mitchmindtree yep it'll take a some time to update tidal-parse. @polymorphicengine is working on fixing up tidal-listener builds, there's been some long running issues with the hint dependency blocking that but that might be solved soon.

@exitmouse
Copy link
Author

Hi, just checking in. Would you like me to add a commit to this PR to remove tidal-listener from the builds, so that the checks all pass? Or do you want to leave it in until it's fixed?

@polymorphicengine
Copy link
Collaborator

yes, you can remove them for now! thanks!

@exitmouse
Copy link
Author

Alright! Sorry about the scope creep on this PR, and thanks @mitchmindtree for the nix changes!

@yaxu
Copy link
Member

yaxu commented Jul 6, 2023

Thanks all, is this ready to merge @exitmouse ?

@exitmouse
Copy link
Author

All good on my end. 👍

@yaxu yaxu merged commit 077b65f into tidalcycles:main Jul 6, 2023
14 checks passed
@yaxu
Copy link
Member

yaxu commented Jul 6, 2023

Thanks again!

@exitmouse exitmouse deleted the build-fixes branch July 6, 2023 11:32
mindofmatthew pushed a commit to mindofmatthew/Tidal that referenced this pull request Nov 30, 2023
This resolves the nix build issue encountered at
tidalcycles#1022, mentioned in
tidalcycles#1022 (comment).

Namely, as Tidal 2.0 requires `hosc` `0.20` but nixpkgs currently only
provides `0.19.1`, we temporarily include `hosc` `0.20` directly from
its source.

This commit also updates the nixpkgs pin to the latest version while
we're at it.
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.

None yet

4 participants