-
Notifications
You must be signed in to change notification settings - Fork 9
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
Change to build-type: Simple #14
Conversation
`cabal new-build` generates .ghc.environment files, so we can run `doctest` on sources using package db there. This works on GHC >= 8.0. In short cabal new-install -z doctest cabal new-build doctest src If there aren't `-z` flag in your `cabal`, use a workaround to install doctest: (cd /tmp && cabal new-install doctest) `stack` users can `stack exec doctest src` too, as `stack exec` will provide package environment in an environment variable. The only downside, is that `doctest` binary have to correspond to the GHC in use. This is not a problem in CI, but is inconvenient locally.
53cffeb
to
571329f
Compare
Green, "resolves" #13 |
@@ -119,6 +116,9 @@ install: | |||
cabal new-update head.hackage -v | |||
fi | |||
- grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$' | |||
- (cd /tmp && echo '' | cabal new-repl -w ${HC} --build-dep fail) | |||
- if [ $HCNUMVER -ge 80000 ]; then cabal new-install -w ${HC} -j2 --symlink-bindir=$HOME/.local/bin doctest --constraint='doctest ==0.16.*'; fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if [ $HCNUMVER -ge 80000 ]
I'm rather uncomfortable with hard-coding the GHC version to an old release like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this approach doesn't work with older GHCs, cannot lift this requirements with current tools
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be clear, I'm not suggesting that we run this on every version of GHC, but only on the latest release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's -ge
so it will run on all versions >= 8.0
(currently doctests are run for all versions)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that makes this mildly more tolerable, then. I can live this slightly suboptimal state of affairs.
@@ -119,6 +116,9 @@ install: | |||
cabal new-update head.hackage -v | |||
fi | |||
- grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$' | |||
- (cd /tmp && echo '' | cabal new-repl -w ${HC} --build-dep fail) | |||
- if [ $HCNUMVER -ge 80000 ]; then cabal new-install -w ${HC} -j2 --symlink-bindir=$HOME/.local/bin doctest --constraint='doctest ==0.16.*'; fi | |||
- if [ $HCNUMVER -eq 80403 ]; then cabal new-install -w ${HC} -j2 --symlink-bindir=$HOME/.local/bin hlint --constraint='hlint ==2.1.*'; fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's an issue about this in haskell-ci
and I'll look into it (no promises when though).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, I'm not willing to accept this PR unless this issue is resolved.
If we do decide to go with this option, I'll add a hack to travis-maintenance
for this.
FWIW, this is a demo. It's up to Neil to persuade you Ryan. No offence taken if this PR is rejected. |
Does all the travis-maintenance features have a corresponding ticket in haskell-ci?
…Sent from my iPhone
On 5 Feb 2019, at 15.40, Ryan Scott ***@***.***> wrote:
@RyanGlScott commented on this pull request.
In .travis.yml:
> @@ -119,6 +116,9 @@ install:
cabal new-update head.hackage -v
fi
- grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$'
+ - (cd /tmp && echo '' | cabal new-repl -w ${HC} --build-dep fail)
+ - if [ $HCNUMVER -ge 80000 ]; then cabal new-install -w ${HC} -j2 --symlink-bindir=$HOME/.local/bin doctest --constraint='doctest ==0.16.*'; fi
+ - if [ $HCNUMVER -eq 80403 ]; then cabal new-install -w ${HC} -j2 --symlink-bindir=$HOME/.local/bin hlint --constraint='hlint ==2.1.*'; fi
Unfortunately, I'm not willing to accept this PR unless this issue is resolved.
If we do decide to go with this option, I'll add a hack to travis-maintenance for this.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Here are all of the hacks that I currently use in data Hack
= HLint [String]
| DisableTestsGlobally
| AlternateConfig [String]
| CabalProjectMiscellanea [String] Here is (in my mind) what each hack maps to in terms of
|
cabal new-build
generates.ghc.environment
files, so wecan run
doctest
on sources, and package db info will be picked implicitly.This works on GHC >= 8.0. In short
cabal new-install -z doctest
cabal new-build
doctest src
If there aren't
-z
flag in yourcabal
, use a workaround to installdoctest:
(cd /tmp && cabal new-install doctest)
stack
users canstack exec doctest src
too, asstack exec
willprovide package environment in an environment variable.
The only downside, is that
doctest
binary have to correspondto the GHC in use. This is not a problem in CI, but is inconvenient
locally.