dan-t / cabal-cargs Goto Github PK
View Code? Open in Web Editor NEWExtract the compiler arguments from a cabal file.
License: Other
Extract the compiler arguments from a cabal file.
License: Other
I'm really excited to see this project.
I was wondering if it's possible to add cabal.sandbox.config support. Namely extracting enough from it to support hdevtools in vim.
Let me just explain how I've got things set up, as some background.
records_stuff/
├── .cabal-sandbox
├── Vinyl
├── cabal.sandbox.config
├── http-pokemon
└── vinyl-json
How I set up my sandbox
cd records_stuff/
cabal sandbox init
for package in $packages; do
cd $package
cabal sandbox init --sandbox ../.cabal-sandbox/
cd ..
cabal sandbox add-source $package
done
I'd like to have hdevtools just work.
My previous vimscripts don't quite work, as I don't own Vinyl, and they don't use a src/
directory, but I'm doing a little work on it. My packages do use src
. I thought it'd be nice if I could just extract the hs-source-dirs from the cabal files, and that's when I found your tool and was happy that someone did this kind of thing before. Unfortunately there's still some errors importing packages.
If I look at a (cleaned up) `g:hdevtools_options
-g-i/Users/theobelaire/Code/Haskell/records_stuff/http-pokemon/src
-g-XHaskell2010
-g-i/Users/theobelaire/Code/Haskell/records_stuff/http-pokemon/dist/dist-sandbox-f83aa2ea/build/autogen
-g-I/Users/theobelaire/Code/Haskell/records_stuff/http-pokemon/dist/dist-sandbox-f83aa2ea/build/autogen
-g-optP-include
-g-optPcabal_macros.h
--socket=/Users/theobelaire/Code/Haskell/records_stuff/http-pokemon/.hdevtools.sock
Which seems to have no knowledge of the sandbox at all. I'd like to fix that. First, I suppose, is figuring out what options need to pass to make it work at all, then how to generate them from the various cabal files.
cabal-cargs places the following restrictions on its build inputs: either >=4.1.1 && <4.2,
lens >=4.0.1 && <4.1, and
tasty ==0.7.*`. However, after removing these restrictions from the Cabal file, the build succeeds just fine with the respective latest version of these packages. Are you sure those limitations are accurate?
It would be nice to be able to get paths in the dist-newstyle
directory when that is being used. I noticed that cabal-lenses
has a function findNewDistDir
, but that won't work out of the box since dist-newstyle
has a different structure than dist
. For example, the build
directory is found in something like:
dist-newstyle/build/x86_64-linux/ghc-8.4.3/my-package-0.1/build/
Do you think there's a way to make this work?
I'm working on an approach to Haskell development in simple editors. I need two things to make it work:
cabal-cargs
It would be nice if a single tool could do both things. Would you accept a PR that adds a flag to make cabal-cargs
print the directory of the Cabal file?
I realize that this doesn't fit with the normal operation of cabal-cargs
, so my other option would be to make a new tool that wraps cabal-cargs
and adds the extra functionality. It's really up to what you'd prefer 🙂
Is it possible to downgrade dependency on cabal to start from >= 1.16 ?
I want to use Scotty + Wai-Handler-Devel for my devel env, but I cant, because it Wai-Handler-Devel dependencies invokes unresolvable state. This package is deprecated now, so my only hope - is you.
Thank you
Running cabal-cargs --format=ghc -r
on a cabal project with a test-suite depending on the library being tested outputs -package=<LIBRARY>
where <LIBRARY>
is the library being tested. So for example if you develop a library called "my-library" with a test-suite depending on the library <LIBRARY>
is substituted by "my-library". This is bad, as it requires the library being installed already by cabal install my-library
or else one gets an error <command line>: cannot satisfy -package my-library
So it would be quite nice if cabal-cargs would suppress the library under test from its -package
output. What do you think?
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.