Skip to content
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

Alternative way of providing arguments to psc #1152

Closed
garyb opened this issue Jun 7, 2015 · 12 comments
Closed

Alternative way of providing arguments to psc #1152

garyb opened this issue Jun 7, 2015 · 12 comments
Assignees
Milestone

Comments

@garyb
Copy link
Member

garyb commented Jun 7, 2015

It appears Windows has a limit on the length of command line arguments. I thought it was an issue with the gulp plugin, but it's not just that: purescript-deprecated/gulp-purescript#36.

One option is to allow a file input to parse the commands from, or perhaps we could accept glob paths in the executables themselves - it would certainly make for a friendlier interface for people not using pulp, gulp, etc.

This is going to become a real problem for me soon, as slamdata is very close to exceeding that limit 😉

@garyb garyb added this to the 0.7.0 milestone Jun 7, 2015
@michaelficarra
Copy link
Contributor

@paf31 expressed a desire to be able to pass a bower_components-structured directory to psc at PureScriptConf/LambdaConf, and I thought he opened an issue for it, but I can't seem to find the issue now.

@paf31
Copy link
Contributor

paf31 commented Jun 8, 2015

I think I'd like to support glob paths rather than putting arguments in files.

@garyb
Copy link
Member Author

garyb commented Jun 8, 2015

👍

@paf31 paf31 self-assigned this Jun 8, 2015
@garyb
Copy link
Member Author

garyb commented Jun 8, 2015

I spoke too soon with this, I'm already unable to build slamdata on Windows after updating to the latest revision 😉

I see there's a glob module on hackage, does that look any use for this?

@paf31
Copy link
Contributor

paf31 commented Jun 8, 2015

I think glob would work, yeah.

@paf31 paf31 closed this as completed in 49da725 Jun 11, 2015
paf31 added a commit that referenced this issue Jun 11, 2015
Fix #1152, support globs in file paths
@chexxor
Copy link
Contributor

chexxor commented Jun 11, 2015

Holy buckets, this is huge. I was using Fish shell to use nice globs when using psc command, but it looks like I won't need to do that anymore.

Which doc page is the right place to demonstrate using globs with psc? My first reflex would be the Language Guide: Getting Started wiki page.

I wonder what happens if both a shell and the program try to handle globs. If the shell expands the glob, psc won't see it as a glob, right? When we see a demo usage, I'll give it a try.

@garyb
Copy link
Member Author

garyb commented Jun 11, 2015

The current gulp plugin expands blobs and works fine with this, so I wouldn't imagine it will introduce any problems with any existing build setup (aside from other changes like the --ffi requirement now).

@gbaz
Copy link

gbaz commented Apr 26, 2016

There's actually a standard way to handle this, which is response files (aka rsp files) and these are handled by many compilers including gcc. We had to teach cabal and ghc about them as well. The glob setup is only a partial solution because it limits our ability to be precise.

Cf:
https://ghc.haskell.org/trac/ghc/ticket/8596
https://msdn.microsoft.com/en-us/library/ms404301.aspx
https://gcc.gnu.org/wiki/Response_Files

We'd really like support for this, as our workarounds aren't nearly as nice as the precision we'd be able to get from using arbitrary length commandlines that say exactly what we want.

Would you be open to reopening this (especially if I volunteered to help with a patch? :-) )

@hdgarrood
Copy link
Contributor

Can you give an example of a situation where the level of precision given by globbing is insufficient?

@gbaz
Copy link

gbaz commented Apr 26, 2016

So the issue that prompted this is we need to provide absolute paths, and hence we need to start with C:\ -- at which point we need to have very careful globs because we could accidentally slurp the entire filesystem, as we accidentally have once or twice, and its a bear to debug.

Meanwhile, we use msbuild, which actually can already produce response files by default. And backing into a "good glob" from those response files is tricky, and not subject to automation. But if we could use the generated response files, we'd have no work to do at all!

@paf31
Copy link
Contributor

paf31 commented Apr 27, 2016

It would be nice if optparse-applicative could support this.

@gbaz
Copy link

gbaz commented Apr 27, 2016

Yeah, I checked and there doesn't seem to be direct support. On the other hand, I still think, done right, this should be a tiny patch :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants