-
Notifications
You must be signed in to change notification settings - Fork 643
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
Migrated to lts-15.3 #4827
Migrated to lts-15.3 #4827
Conversation
Thanks for the PR! Looks good, let's see what the CI has to say. |
It will require some CI script modifications. I will investigate. |
It looks like GHC 8.4 was broken for a while (#4611). Due to megaparsec 8 requiring base 4.11 (and thus GHC 8.4 and higher), the only GHC versions left in CI are 8.6 and 8.8. |
I still get libffi errors and I have no idea what causes them or how to fix them:
|
The issue with libffi is described here. I think the issue is with the binary stack produces being built sans an option to use a locally available libFFI and to use GHC's internal copy. |
CI actually doesn't use stack. It only builds with cabal. Adding stack CI builds would probably be a good idea as well, but the would be out of the scope of this PR. |
This seems related: https://stackoverflow.com/questions/4514997/error-loading-shared-libraries It's weird that it started happening after a ghc version change |
It's because the PPAs for GHC on Launchpad are built with their own copy of libffi instead of the the one in the Ubuntu packages. |
So are you saying that to properly works with libffi GHC needs to be
rebuilt on every platform from source?
I don’t think libffi come standard with macOS, but everything worked for me
with a prebuilt GHC.
One the other hand, building the libffi library against the wrong copy of
libffi seems like a more likely cause if the problem to me.
…On Fri, 13 Mar 2020 at 02:07, Niklas Larsson ***@***.***> wrote:
It's because the PPAs for GHC on Launchpad are built with their own copy
of libffi instead of the the one in the Ubuntu packages.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#4827 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABPMAW46KWYYYFFH6EGKIG3RHFTMVANCNFSM4LGTM55A>
.
|
The problem with GHC and libffi is well documented:
When using stack locally, I get the same issue with LTS 15.3 in that stack's binary ghc's are failing at the linking stage. I recently build Idris using the hvr-ppa and GHC v8.8.2 using cabal new. It might be the case that hvr-ppa is using a work around with the flag |
Luna uses the It might be worth a shot. I'm not too familiar with Linux though and am not sure where to find the rts folder from the system GHC installation. |
BTW @jfdm if you have a look at the Travis CI build logs, it uses GHC from hvr-ppa, so it is probably not using a work-around: sudo -E apt-add-repository -y "ppa:hvr/ghc" |
I don't think it was fixed in bionic, which is the freshest ubuntu you can run on travis. I wonder how much work it would be to use docker on travis to run it on a newer version of ubuntu (or maybe just use an arch container). |
I should add that this was the exact issue that was holding us back from using a modern GHC on travis, I snuck in GHC 8.8 for the Idris2 build as I could just build idris without FFI. So another alternative is to just disable the tests that uses the interpreter and build it without the FFI flag. |
@melted It would be interesting to see in 8.8.2 works with ffi on travis. This would pretty much be a replication with my current set up. @ilyakooo0 I know the contents of the travis file, what I meant was that the hvr-ppa would have built their versions of ghc with the correct flag. |
I think I managed to fix the libffi issue: https://travis-ci.org/github/idris-lang/Idris-dev/jobs/661951376 It failed for reasons that to me seem unrelated to ffi More specifically:
|
That looks promising! |
GHC 8.6 doesn't pass the tests for some reason (I didn't look into it, but I could reproduce it locally), so I have also removed it from CI. As it currently stands, the codebase was modified in a backward-incompatible way to support megaparsec 8, which does not compile with GHC 8.2 dues to the required version of If we really wanted to, we could add pragmas to conditionally support either megaparsec 8 or megaparsec 7. This, however, would probably slowly creep all over the codebase and, as this is a compiler and not a library, I see no real benefit in striving to support multiple GHC versions. IMO simplifying the codebase is a bigger priority, than supporting multiple GHC versions. Tests are currently run in CI only with GHC 8.8. |
It's not much of a problem for Mac or Windows users to use a new GHC, the benefit is running with a distro-supplied GHC for Linux users. It wouldn't be nice if we made it so @edwinb couldn't build Idris anymore. I see debian stable is up to GHC 8.4 now, pretty close. A new Ubuntu LTS will be released next month, I guess that takes care of Ubuntu. And FreeBSD has 8.6 now. At least I think we should see what's failing on 8.6 and run that on the CI, as that is a very common version and will be for several years. |
A quick reminder that the documentation and new restrictions (if this is to be merged) will also need to be updated. |
@melted if you are curious about the GHC 8.6 issue, then check out this run: https://travis-ci.org/github/idris-lang/Idris-dev/builds/661976175 |
A way we could proceed is for people developing on Linux to either:
When distributing the prebuilt binaries, I think it would be feasible to use a patched version of GHC, so this issue shouldn't affect the end Idris user. |
Looking at that, I don't have high hopes of an easy fix for 8.6. I think the way forward is to put in a little conditional compilation so it'll work by using megaparsec 7 for 8.4 and 8.6. If you don't feel like doing that, I can implement it. We definitely want it to work with megaparsec 8 to make it easy for packaging for stack and nix. But we also want it to work with LTS Linux distributions, so we'll just have to put in some ugliness for that. |
I get errors like this when I try building with GHC version less than 8:
Does this look like a |
I was able to reproduce it in the master branch. |
seems to be related to haskell/cabal#6125 Looking at the produced directory contents, |
Looks like it's something that works on cabal-3.0 and not on 2.4 in the cabal file. Guess we could use 3.0. |
Sure, that would be a solution, but stack doesn't currently support cabal 3 and gives an error if I try to explicitly require cabal-version 3. A thing we could do is manually expand all of the |
According to this We used to generate that list in setup.hs before, but that was taken away in 3.0. We had a fully expanded list before then and that was very brittle. |
It was added in 2.4, but it is buggy in 2.4. I didn't dig into when exactly it breaks, but I was able to work around it by manually expanding a small amount of wildcards, which I think will be acceptable. |
Ok, that's fine. |
I found out what the error with 8.6.5 was, I will fix that in another PR. |
It might be my local machine weirdness (I don't think it is though), but when running
|
If we get the GHC 8.6 issue fixed, then might we drop support for 8.4 and 8.2? (For simplicity’s sake and avoiding excessive conditional compilation) |
8.2 can be dropped, but 8.4 is still common. Looks like it's fine anyway, let's merge this. |
So trying to build idris with |
It looks like my hunch is correct, I will adapt the cabal file, and update HEAD. |
The main difference is that there are far less
extra-deps
instack.yaml
and code had to be slightly modified to work with megaparsec 8.