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

Command line too long #7

Open
gares opened this issue Jun 2, 2015 · 7 comments
Open

Command line too long #7

gares opened this issue Jun 2, 2015 · 7 comments

Comments

@gares
Copy link

gares commented Jun 2, 2015

I'm using cygwin, the mingw64 toolchain and I get the error.
It comes from Reloc.cygpath, that in turns calls get_output with use_bash:false.
The quick hack was to force it to use bash, but what could be done (in the non use_bash case) is to use Unix.create_process instead of Sys.command, since the former does not use a shell (no cmd.exe, so more than 8k for argv). See for example sys_command in https://github.com/coq/coq/blob/trunk/lib/cUnix.ml

Best,

@alainfrisch
Copy link
Collaborator

It was initially planned that flexdll should not depend on Unix, to make it easier to integrate it directly in OCaml's bootstrap cycle, but since this is not going to happen, there is no reason not to use it.

I won't have much time to work on that soon, so if you feel like suggesting a patch, I'll happily include it.

@gasche
Copy link
Member

gasche commented Nov 20, 2015

@gares , I opened an issue in the OCaml bugtracker #7050 to be able to pass command-line arguments for the OCaml compiler in a file, to avoid argv size limitations. The two issues seem independent, but are in fact related if the command that is called in the present PR is an invocation of the OCaml compiler (or a tool distributed in the OCaml compiler distribution). Is it?

@dra27
Copy link
Member

dra27 commented Dec 17, 2016

Update for 2016: FlexDLL is now an optional part of OCaml's bootstrap cycle, so a hard dependency on Unix would be upsetting (for at least two developers...!). However, it sounds as though this could be done in a way which could be easily disabled at build time in the bootstrap (similarly to the shims already in place for building with OCaml < 4.03.0)

@bschommer
Copy link
Contributor

I also will submit a PR in the next few days which allows flexdll to parse responsefiles produced by the new ocaml functions write_arg and write_arg0. But I'm not that familiar with the bootstrap mechanism to add a check if the flexdll support this..

@dra27
Copy link
Member

dra27 commented Dec 21, 2016

The FlexDLL bootstrap in OCaml is only normally something you have to worry about if you're altering the OCaml side - feel free to cc me when you submit the PR and I'll happily test it. If you want to have a go, it's an easy enough procedure: from a git clone of OCaml (you can do it from a tarball of the sources, but it's easier to use a clone):

  • git submodule update --init
  • cd flexdll
  • git remote add -f bschommer https://github.com/bschommer/flexdll.git
  • git checkout bschommer/your-new-flexdll-branch [-b your-new-flexdll-branch]
  • cd ..
  • configure OCaml
  • make -f Makefile.nt flexdll world.opt

Step one initialises the flexdll directory of the OCaml source tree, clones this repo and checks out the 0.35 commit (assuming you are on trunk or 4.04). The flexdll directory itself is then to all intents and purposes a separate git clone, so you can add your remote and checkout your branch - you can use -b your-new-flexdll-branch if you want to work on the clone within that directory and you can also push back to your GitHub repo from it but it's also OK (and commonplace with submodules) to work with a "detached HEAD".

Note that OCaml will show that the 'flexdll' file has changed if you do git status from there which is correct - but you should not try to commit that change (if you say git submodule update then git will checkout the 0.35 commit in the flexdll directory again).

Hope that helps - but as I said, I'm quite happy to test and comment on that side too!

@bschommer
Copy link
Contributor

I think the PR on the flexdll side should not be that complicated, I will only have to copy the read_arg and read_arg0 function from the arg module for compatibility. My problem is more how on the ocaml side one could notice that the flexdll version is new enough to allow this.

@dra27
Copy link
Member

dra27 commented Dec 21, 2016

You don't have to worry on the OCaml side - for bootstrapping, when FlexDLL 0.36 is released (with it), we update the SHA stored for the submodule in the OCaml repo. For users pre-installing FlexDLL, we change the README to state the new minimum version.

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

No branches or pull requests

5 participants