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

exec("nimgrab 'https:// -- some problems on windows #7275

Closed
StefanSalewski opened this issue Mar 1, 2018 · 7 comments
Closed

exec("nimgrab 'https:// -- some problems on windows #7275

StefanSalewski opened this issue Mar 1, 2018 · 7 comments

Comments

@StefanSalewski
Copy link

I have these code in https://github.com/StefanSalewski/gintro/blob/master/gintro.nimble

try:
    exec("wget 'https://raw.githubusercontent.com/StefanSalewski/oldgtk3/master/oldgtk3/gobject.nim' -O gobject.nim")
  except:
    try:
exec("nimgrab 'https://raw.githubusercontent.com/StefanSalewski/oldgtk3/master/oldgtk3/gobject.nim' gobject.nim")

Worked fine in Linux, both wget and nimgrab.

Now windows users reported that for nimgrab they have to remove the single quotes (StefanSalewski/gintro#24). It is a bit strange that command behaves differently on Linux and Windows, and error message is not really helpful. And question is: Is this the (without single quotes) the recommended form for all OS?

exec("nimgrab https://raw.githubusercontent.com/StefanSalewski/oldgtk3/master/oldgtk3/gobject.nim gobject.nim")

@Araq
Copy link
Member

Araq commented Mar 1, 2018

Command line parsing is OS specific, Windows does not use single quotes iirc. No bug here.

@StefanSalewski
Copy link
Author

OK no bug, but I would need a hint.

Is there a form for the exec string that should work for all OS, or do I have to test for OS and supply different command strings (with and without single quotes)

@dom96
Copy link
Contributor

dom96 commented Mar 1, 2018

Is nimgrab's purpose literally to allow nimscript to download things?

Are we going to implement Nim programs for each case where the FFI cannot be used?

@StefanSalewski
Copy link
Author

dom, the fact is that gintro needed 3 files from oldgtk3 package for compiling generator program. Only for this task, and generally users of gintro will not want to use and install full oldgtk3. So I was happy to get download of 3 single files working with wget. Araq told me then to use nimgrab instead for windows users.

Other ways would be:

  • make gintro depend on oldgtk3
  • do a full git clone of oldgtk3 only for install gintro
  • copy 3 files from oldgtk3 package to gintro

@Araq
Copy link
Member

Araq commented Mar 1, 2018

Is nimgrab's purpose literally to allow nimscript to download things?

No, it's used by the installer.

Are we going to implement Nim programs for each case where the FFI cannot be used?

Even if it were for nimscript, it would be wise for the download feature. I can remove 'nimgrab' and ensure my Nim bulid doesn't download things, for a .compileTime proc things are harder to review. Note that "download" is actually misleading in the context of security, a download starts with sending data to some server. The "download" could send critical information to the server.

@Araq
Copy link
Member

Araq commented Mar 1, 2018

Is there a form for the exec string that should work for all OS, or do I have to test for OS and supply different command strings (with and without single quotes)

The version without quotes should work for both Unix and Windows.

@StefanSalewski
Copy link
Author

OK, then I will remove the single quotes from the strings.

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

4 participants