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

Use hpack not cabal #626

Merged
merged 15 commits into from
Feb 15, 2019
Merged

Use hpack not cabal #626

merged 15 commits into from
Feb 15, 2019

Conversation

ChrisPenner
Copy link
Contributor

Adds *.cabal to gitignore

Generated package.yaml using hpack-convert


Unfortunately I'm getting some compilation problems related to file path case sensitivity :'(

There's a note on this here;
haskell/cabal#4739

I've tried adding --ghc-options=-optP-Wno-nonportable-include-path; which removes the warning but the actual gcc linking fails later on.

Not entirely sure why this is breaking as a result of the switch; seems mostly to be affecting Proxy; so maybe I'll switch the cabal file back for just that one?

Definitely open to thoughts on this PR; is this something we should bother doing at all?

author: Wire Swiss GmbH
maintainer: Wire Swiss GmbH <[email protected]>
license: AGPL-3
default-extensions:
Copy link
Contributor

@neongreen neongreen Feb 14, 2019

Choose a reason for hiding this comment

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

Let's use https://github.com/sol/hpack#defaults for this section.

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 didn't make any manual edits since that would take a fair amount more time than just using the automated tool; do you think it's worthwhile to dig through and clean everything up? I suppose if we don't do it now it's unlikely to happen. Should I look into somehow adding some sort of yaml inheritance for these sort of settings or do we not care enough to look into that?

Copy link
Contributor

Choose a reason for hiding this comment

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

You don't need YAML inheritance, it's a built-in hpack feature. You can create a file in the repo:

-- package-defaults.yaml

default-extensions:
  - ...

And then in every package.yaml file you say on the top level:

defaults:
  path: package-defaults.yaml

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, or maybe it should be local: package-defaults.yaml; I'm not sure.

Copy link
Contributor

Choose a reason for hiding this comment

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

@ChrisPenner if you don't to I'm happy to do this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After taking a peak; yup this is a good idea 😄

I added it.

@neongreen
Copy link
Contributor

It doesn't seem that module-defaults is a better name, since those are really package defaults and not module defaults (e.g. I can easily imagine author: Wire Swiss GmbH also going there).

Regardless, approved.

Copy link
Member

@jschaul jschaul left a comment

Choose a reason for hiding this comment

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

Where did the -O2 ghc option disappear to? Before, we were compiling with optimizations for real deployment, and without optimizations (with --fast) for development. Does hpack do something smart here I'm not aware of?

@@ -1,2 +1 @@
turn:localhost:3478
turn:localhost:3479
turn:localhost:3478
Copy link
Member

Choose a reason for hiding this comment

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

unrelated change, undo?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Very strange, no idea what happened here; great catch!

Copy link
Contributor

Choose a reason for hiding this comment

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

Out of curiosity: when running brig's integration tests, one of the tests creates that 2nd entry... but it should always fallback to the original after, something funky happened there

ghc-options:
- -j
- -Wno-redundant-constraints
- -Werror
Copy link
Member

Choose a reason for hiding this comment

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

Can you motivate the change (removal) of ghc options here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As Artyom mentioned, several of the more pervasive options are now globally applied via module-defaults.yaml

@neongreen
Copy link
Contributor

-O2 went into module-defaults.yaml.

@jschaul
Copy link
Member

jschaul commented Feb 14, 2019

-O2 went into module-defaults.yaml.

Ah I see, thanks, I missed that in the rather large diff.

👍

@@ -39,7 +39,6 @@ services/nginz/src
services/.env
tools/api-simulations/mailboxes.json
tools/api-simulations/reports
.DS_Store
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was duplicated

@@ -61,6 +60,8 @@ spar.integration-aws.yaml
integration-aws.yaml
DOCKER_ID*
swagger-ui
services/spar/spar.cabal
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now covered by *.cabal

@ChrisPenner
Copy link
Contributor Author

Any have other global GHC options they'd like added before I send this through?

Copy link
Contributor

@fisx fisx left a comment

Choose a reason for hiding this comment

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

@ChrisPenner please merge this if you're comfortable doing so. We can always tweak the ghc opts later.

@ChrisPenner ChrisPenner merged commit ba28495 into develop Feb 15, 2019
@ChrisPenner ChrisPenner deleted the cp/hpack branch February 15, 2019 12:48
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