stepcut / plugins Goto Github PK
View Code? Open in Web Editor NEWDynamic linking and runtime evaluation of Haskell, and C, including dependency chasing and package resolution.
License: GNU Lesser General Public License v2.1
Dynamic linking and runtime evaluation of Haskell, and C, including dependency chasing and package resolution.
License: GNU Lesser General Public License v2.1
I've created a test here which loads an IO () function from a module.
https://github.com/xpika/plugins-ghc-7-10-segfault-io
The code does not segfault on GHC 7.6.3 but does on 7.10.3.
@stepcut The current Travis setup does not work anymore. In order to improve the reliability of the package's support window, I would like to submit a PR to set up GH Actions. Is that good with you?
plugins-1.5.5.0
fails to build with ghc-8.0
as well as with its bundled Cabal-1.23
(soon to become Cabal-1.24
):
[ 5 of 12] Compiling System.Plugins.Env ( src/System/Plugins/Env.hs, /tmp/plugins-1.5.5.0/dist-newstyle/build/plugins-1.5.5.0/build/System/Plugins/Env.o )
src/System/Plugins/Env.hs:326:21: error:
• Couldn't match expected type ‘IO (PackageIndex PackageConfig)’
with actual type ‘ProgramConfiguration -> IO InstalledPackageIndex’
• Probable cause: ‘getInstalledPackages’ is applied to too few arguments
In a stmt of a 'do' block:
pkgIndex <- getInstalledPackages
silent [GlobalPackageDB, UserPackageDB] pc
In the expression:
do { pc <- configureAllKnownPrograms
silent defaultProgramConfiguration;
pkgIndex <- getInstalledPackages
silent [GlobalPackageDB, UserPackageDB] pc;
return $ [] `union` allPackages pkgIndex }
In an equation for ‘grabDefaultPkgConf’:
grabDefaultPkgConf
= do { pc <- configureAllKnownPrograms
silent defaultProgramConfiguration;
pkgIndex <- getInstalledPackages silent [GlobalPackageDB, ....] pc;
return $ [] `union` allPackages pkgIndex }
src/System/Plugins/Env.hs:326:49: error:
• Couldn't match expected type ‘Compiler’
with actual type ‘[PackageDB]’
• In the second argument of ‘getInstalledPackages’, namely
‘[GlobalPackageDB, UserPackageDB]’
In a stmt of a 'do' block:
pkgIndex <- getInstalledPackages
silent [GlobalPackageDB, UserPackageDB] pc
In the expression:
do { pc <- configureAllKnownPrograms
silent defaultProgramConfiguration;
pkgIndex <- getInstalledPackages
silent [GlobalPackageDB, UserPackageDB] pc;
return $ [] `union` allPackages pkgIndex }
src/System/Plugins/Env.hs:326:82: error:
• Couldn't match type ‘Distribution.Simple.Program.Db.ProgramDb’
with ‘[PackageDB]’
Expected type: PackageDBStack
Actual type: Distribution.Simple.Program.Db.ProgramDb
• In the third argument of ‘getInstalledPackages’, namely ‘pc’
In a stmt of a 'do' block:
pkgIndex <- getInstalledPackages
silent [GlobalPackageDB, UserPackageDB] pc
In the expression:
do { pc <- configureAllKnownPrograms
silent defaultProgramConfiguration;
pkgIndex <- getInstalledPackages
silent [GlobalPackageDB, UserPackageDB] pc;
return $ [] `union` allPackages pkgIndex }
src/System/Plugins/Env.hs:335:17: error:
• Couldn't match expected type ‘IO (PackageIndex PackageConfig)’
with actual type ‘ProgramConfiguration -> IO InstalledPackageIndex’
• Probable cause: ‘getInstalledPackages’ is applied to too few arguments
In a stmt of a 'do' block:
pkgIndex <- getInstalledPackages
silent [GlobalPackageDB, UserPackageDB, SpecificPackageDB f] pc
In the expression:
do { pc <- configureAllKnownPrograms
silent defaultProgramConfiguration;
pkgIndex <- getInstalledPackages
silent [GlobalPackageDB, UserPackageDB, ....] pc;
tests/PackageTests/TemplateHaskell/dynamic/Lib.hs
return $ allPackages pkgIndex }
In an equation for ‘readPackageConf’:
readPackageConf f
= do { pc <- configureAllKnownPrograms
silent defaultProgramConfiguration;
pkgIndex <- getInstalledPackages silent [GlobalPackageDB, ....] pc;
return $ allPackages pkgIndex }
src/System/Plugins/Env.hs:335:45: error:
• Couldn't match expected type ‘Compiler’
with actual type ‘[PackageDB]’
• In the second argument of ‘getInstalledPackages’, namely
‘[GlobalPackageDB, UserPackageDB, SpecificPackageDB f]’
In a stmt of a 'do' block:
pkgIndex <- getInstalledPackages
silent [GlobalPackageDB, UserPackageDB, SpecificPackageDB f] pc
In the expression:
do { pc <- configureAllKnownPrograms
silent defaultProgramConfiguration;
pkgIndex <- getInstalledPackages
silent [GlobalPackageDB, UserPackageDB, ....] pc;
return $ allPackages pkgIndex }
tests/PackageTests/TemplateHaskell/profiling/Lib.hs
src/System/Plugins/Env.hs:335:99: error:
• Couldn't match type ‘Distribution.Simple.Program.Db.ProgramDb’
with ‘[PackageDB]’
Expected type: PackageDBStack
Actual type: Distribution.Simple.Program.Db.ProgramDb
• In the third argument of ‘getInstalledPackages’, namely ‘pc’
In a stmt of a 'do' block:
pkgIndex <- getInstalledPackages
silent [GlobalPackageDB, UserPackageDB, SpecificPackageDB f] pc
In the expression:
do { pc <- configureAllKnownPrograms
silent defaultProgramConfiguration;
pkgIndex <- getInstalledPackages
silent [GlobalPackageDB, UserPackageDB, ....] pc;
return $ allPackages pkgIndex }
[ 8 of 12] Compiling System.Plugins.Load ( src/System/Plugins/Load.hs, /tmp/plugins-1.5.5.0/dist-newstyle/build/plugins-1.5.5.0/build/System/Plugins/Load.o )
src/System/Plugins/Load.hs:76:46: error:
Module ‘Module’ does not export ‘packageKeyString’
Hi! I'd like to start using plugins
for an application of my own.
I tried to depend on it with GHC 9.2 as my compiler, and the following message makes me think that plugins
is still trying to look up the old module hierarchy:
src/System/Plugins/LoadTypes.hs:33:1: error:
Could not find module ‘HscTypes’
Use -v (or `:set -v` in ghci) to see a list of the files searched for.
|
33 | import HscTypes
| ^^^^^^^^^^^^^^^
You're probably busy, so would you accept a PR to fix this?
I have been able to successfully compile plugins from github, but the example of the eval function doesn't work anymore.
plugins/src/System/Eval/Haskell.hs
Lines 89 to 90 in 5866046
eval "1 + 6 :: Int" [] :: IO (Maybe Int)
just returns Nothing
.
Tried to build plugins
against ghc-8.10
. Fails as:
Building library for plugins-1.6.1..
[ 5 of 12] Compiling System.Plugins.Env ( src/System/Plugins/Env.hs, dist/build/System/Plugins/Env.o, dist/build/System/Plugins/Env.dyn_o )
src/System/Plugins/Env.hs:81:32: error:
Module ‘SysTools’ does not export ‘initLlvmConfig’
|
81 | import SysTools (initSysTools, initLlvmConfig)
| ^^^^^^^^^^^^^^
I've been trying to build this package in one of my Haskell projects. I'm using stack and keep getting the errors shown below. I've tried building this on Arch, Linux Mint, and Nixos and with several different versions of stack and ghc. This particular run was with stack 1.9.1, and ghc 8.0.2. I've tried it with stack 1.7.1 and ghc 8.4.4 with the same result. They all produce this same exact error. I've done several searches online and found nothing useful. Any ideas about what's happening and how to fix it?
` checking for a BSD-compatible install... /nix/store/wm8va53fh5158ipi0ic9gir64hrvqv1z-coreutils-8.29/bin/install -c
configure: creating ./config.status
config.status: creating config.mk
config.status: creating testsuite/makewith/io/TestIO.conf
config.status: creating testsuite/makewith/unsafeio/Unsafe.conf
config.status: creating config.h
configure: WARNING: unrecognized options: --with-compiler
Preprocessing library for plugins-1.5.7..
Building library for plugins-1.5.7..
/run/user/1000/stack7723/plugins-1.5.7/src/System/Plugins/Consts.hs:24:2: error:
fatal error: ../../../config.h: No such file or directory
^
|
24 |
| ^
compilation terminated.
`cc' failed in phase `C pre-processor'. (Exit code: 1)
`
Hi,
I get the following compiling on 9.4.x:
> [ 4 of 12] Compiling System.Plugins.Parser ( src/System/Plugins/Parser.hs, dist/build/System/Plugins/Parser.o, dist/build/System/Plugins/Parser.dyn_o )
>
> src/System/Plugins/Parser.hs:38:1: error:
> Ambiguous module name ‘Language.Haskell.Syntax’:
> it was found in multiple packages: ghc-9.4.2 haskell-src-1.0.4
> |
> 38 | import Language.Haskell.Syntax
Unsure if one of these packages just reimports another, it may be possible to reduce dependencies now?
Thanks!
Tried to run a simple plugins eval example under stack 1.6.3, with plugins-1.5.7 added to extra-deps.
Tried running
module Main where
import System.Eval.Haskell
main :: IO ()
main =
do
i <- eval "1+2 :: Int" [] :: IO (Maybe Int)
print i
and got:
$ scratch-exe
<command line>: cannot satisfy -package plugins
(use -v for more information)
Nothing
I'm not quite sure where this message is being emitted from, any ideas of what I might have to add?
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.