Skip to content

Fix CI #147

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

Merged
merged 1 commit into from
Jun 7, 2018
Merged

Fix CI #147

merged 1 commit into from
Jun 7, 2018

Conversation

int-index
Copy link
Contributor

@int-index int-index commented May 22, 2018

also fixes #142

@int-index int-index changed the title Mark Data.Binary.Class as Safe Fix CI (WIP) May 22, 2018
@int-index int-index force-pushed the fix-ci branch 7 times, most recently from 3443fe0 to 9b5a615 Compare May 26, 2018 12:33
@int-index int-index changed the title Fix CI (WIP) Fix CI May 26, 2018
@int-index
Copy link
Contributor Author

I fixed CI errors that caused master and some of the other PRs to fail sometimes. cc @kolmodin please review/merge?

binary.cabal Outdated
@@ -162,6 +162,7 @@ benchmark generics-bench
build-depends:
base >= 4.5.0.0 && < 5,
bytestring >= 0.10.4,
generic-deriving >= 0.10,
Copy link
Contributor Author

@int-index int-index May 26, 2018

Choose a reason for hiding this comment

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

Note that the benchmark already depended on generic-deriving transitively. That's what caused one of the problems, as both generic-deriving and GenericsBenchTypes used to define instance Generic Version.

Copy link
Member

Choose a reason for hiding this comment

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

This is good and non-obvious info, please add that as a comment in the file.
And add how exactly we already depend on generic-deriving, which package depends on it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

criterion depends on it via aeson.

@int-index
Copy link
Contributor Author

ping @kolmodin

I would appreciate if you could merge this so I'd be able to adapt #148 for older compilers.

@kolmodin
Copy link
Member

kolmodin commented Jun 6, 2018

Hey! I'll take a look within a few days. Thanks a lot for fixing this!

.travis.yml Outdated
@@ -33,7 +33,10 @@ install:
- cabal sandbox init
# can't use "cabal install --only-dependencies --enable-tests --enable-benchmarks" due to dep-cycle.
# must split in two separate 'cabal install's since cabal doesn't update the cabal library before it's needed in 'cabal-version' constraints.
- cabal install "bytestring >= 0.10.4" 'Cabal == 1.24.*' -j
- cabal install "bytestring >= 0.10.4" -j
Copy link
Member

Choose a reason for hiding this comment

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

Hmm. Maybe we should just install CABALVER=1.24 right away instead of upgrading later.
I can't remember why I made it install an older version (the one shipped with Haskell Platform, iirc) and then upgrade it.

So instead of adding CABALUPGR, does it work to just change CABALVER?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alright, let me see.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can't remember why I made it install an older version (the one shipped with Haskell Platform, iirc) and then upgrade it.

The version of cabal-install actually doesn't matter, it's about the version of Cabal the lib that is shipped with GHC.

@int-index int-index force-pushed the fix-ci branch 3 times, most recently from 8431f68 to a867271 Compare June 6, 2018 14:55
@int-index
Copy link
Contributor Author

I decided to also add GHC 8.2 and 8.4 to CI — now the problem is that Cabal 1.24.* which is needed for the benchmark doesn't work on 8.4, and the benchmark doesn't work with Cabal 2.2.*

My plan is to copy-paste (or "vendor" to use the modern jargon) some bits of Cabal 1.24.* to the benchmark so it's no longer a dependency of binary. This will significantly simplify the CI script and lead to more reproducible benchmark results.

@int-index
Copy link
Contributor Author

Turns out copying the entire Cabal parser requires more patience than I have. However, maybe instead of getting rid of a Cabal dep I can loosen it up and allow more versions than 1.24.* by copying only type definitions and writing a conversion module.

@kolmodin
Copy link
Member

kolmodin commented Jun 6, 2018

Ah, now I recall, it's part of the benchmark suite.
IIRC I adapted something that @dcoutts had done and used that as part of the benchmark suite.
However, since Cabal keeps changing this stuff keeps breaking in binary. Better would be to use code that didn't change, something we could include in the binary repository. We have no interest in the Cabal format in particular, just need something to benchmark.

What are some candidates for benchmarking binary? Cabal was good because it's real world code. Maybe good to write some custom code to try parsing trees, lists, small and large structs.

@int-index int-index force-pushed the fix-ci branch 3 times, most recently from 711c2d6 to 85ba13f Compare June 6, 2018 23:37
@int-index
Copy link
Contributor Author

int-index commented Jun 6, 2018

However, since Cabal keeps changing this stuff keeps breaking in binary. Better would be to use code that didn't change, something we could include in the binary repository. We have no interest in the Cabal format in particular, just need something to benchmark.

Cabal was good because it's real world code.

I found a way to have our cake and eat it too: instead of depending on Cabal, I copied data types from it (only 360 lines) and committed a compressed Hackage index to the repo. The benchmark reads the data from this file. This gives us a benchmark with real world code and real world data.

I also added comments explaining the difference between the current solution and the old one.

Unfortunately, I couldn't get rid of CABALUPGR — a newer Cabal lib is needed by criterion.

@kolmodin
Copy link
Member

kolmodin commented Jun 7, 2018

Ok, that looks like a good trade off.

Thanks for doing this!

@kolmodin kolmodin merged commit b660e3d into haskell:master Jun 7, 2018
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.

Add GHC-8.2 to CI
2 participants