-
Notifications
You must be signed in to change notification settings - Fork 197
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
WIP: [Obsolete] Integration of requirements checker plugin #1074
base: master
Are you sure you want to change the base?
Conversation
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 seemed to work for me:
(. base.sh && cabal_install --ghcjs \
./build/ghcjs/lib/ghc-api-ghcjs \
./build/ghcjs/lib/template-haskell-ghcjs \
./build/ghcjs/lib/ghci-ghcjs)
If that also works for you, you could add the cabal command into install.sh, just after running ghcjs-boot.
Installing the packages using cabal as you suggested worked, so I added this to install.sh. Now the build process completes successfully again, but I get a new and different error when trying to compile programs using CodeWorld. Now it says:
This doesn't really make sense, as the value of plugin in both RequirementsChecker.hs and the stubbed version definitely has type Plugin, so I don't know where this is coming from; but at least it's a different error. |
@luite Please help! |
Ah the error messages there aren't yet as good as they should be. And the plugin loading mechanism is rather hacky right now. Right now what GHCJS does is the following:
Most likely 2 or 3 go wrong. What's the easiest way for me to reproduce the build? |
With the extra information about how GHCJS deals with plugins, I think I've figured out how to arrange the cabal file so that it should work. The new setup looks more like this:
which matches closely with the example setup in Luite's email, and with the addition of the flag and extra conditional should install the packages with the right dependencies. However, I'm having some trouble when actually trying to build with this flag. After adding "-f build-plugin-for-ghcjs" to the cabal install command, I get this error:
It's as if ghc-api-ghcjs isn't installed, like before, except that now it is installed and works fine when it isn't being used conditionally as a result of this flag. Any advice? |
Daniel, I'm so sorry. I've been swamped at work this week, but I'll try to take a look at this tonight or tomorrow. Any chance you'll be at ICFP next week? |
It's no problem at all! I haven't made any progress on this either, unfortunately; I'm happy to keep on pushing with it after GSoC officially finishes, though, so we can get it integrated into CodeWorld properly after we get through all the cabal problems. I will be at ICFP next week; in fact, I'm writing this at the airport! It'd be great to meet you in person at some point, if you'll be around. |
Excellent! I'm leaving tomorrow night, and arriving Sunday morning. I look forward to seeing you there. I am always happy to accept any collaboration on CodeWorld, but I want to be clear that you shouldn't carry forward GSoC obligations past the coding period. Luite is usually at ICFP, and maybe the three of us can find some time and solve this quickly. But if not, you should write a GSoC recap focusing on your GHC plugin running on non-GHCJS code, and show some examples of its use. That will be a successful project. The GHCJS and CodeWorld integration will still happen, but I will not consider you obligated to continue work on it. |
I don't know if you're looking at this at the same time - no problem if you are - but I thought it was worth making the current state of my efforts more visible in case it makes any issues become apparent.
I've been following along with the advice received from Luite to try and fix my Cabal/GHCJS issues, but have generally just ended up running into different problems, so in the current state this is stuck at another cabal error.
The current issue is that the package ghc-api-ghcjs cannot be found; I've discovered that it's in the build/ghcjs/lib folder, but I don't know how to access it or other ghcjs packages from there in the cabal file! But as a summary of progress made in this pull request so far, I've gotten rid of the old requirements checker code in the compiler folder that's all duplicated in the new requirements folder, added the required plugin arguments to the call to ghcjs in Compile.hs, and implemented the feedback from Luite, i.e. created a stub version of the plugin and separated out the ghc and ghcjs versions to try and avoid the previous issues.