Skip to content

graphhopper.sh windows  #449

Closed
Closed

Description

@domi-nique

hi, i have problems with set up graphhopper on windows.
i've cloned the git repository but when i want to import the map i get a failure

$ ./graphhopper.sh import europe_germany_berlin.pbf
./graphhopper.sh: Zeile 2: $'\r': Kommando nicht gefunden.
./graphhopper.sh: Zeile 25: Syntaxfehler beim unerwarteten Wort $'{\r'' '/graphhopper.sh: Zeile 25:function printUsage {

do you have ideas what i have to do?

Activity

  1. karussell commented on Jun 18, 2015

    @karussell
    Member

    Did you follow the windows specific documentation and installed cygwin or similar?

  2. domi-nique commented on Jun 18, 2015

    @domi-nique
    Author

    yes, and i did it with cygwin :/

  3. mprins commented on Jun 18, 2015

    @mprins
    Contributor

    you may have cloned with a wrong line ending convention, causing git to do a conversion while getting the files

    check git config -l output

  4. karussell commented on Jun 18, 2015

    @karussell
    Member

    @mprins good idea. Do you know if our settings are wrong? https://github.com/graphhopper/graphhopper/blob/master/.gitattributes

    I would prefer if it works out of the box on every OS

  5. mprins commented on Jun 18, 2015

    @mprins
    Contributor

    I'm not sure, there might also be peculiarities between git clients eg. cygwin has a git client that behaves 'unix' but eg toirtoise or another win native client has windows behaviour.

    also none of them share the config afaik.
    Think it's a trial and error thing..

  6. devemux86 commented on Jun 18, 2015

    @devemux86
    Contributor

    An idea could be to download the GH repository zip from the main page and unzip (normally the OS can handle it better this way).

  7. mprins commented on Jun 18, 2015

    @mprins
    Contributor

    for a project I have building on the AppVeyor CI I do this:

      - git config --global core.autocrlf true
      - git config --global core.safecrlf true
    
  8. mprins commented on Jun 18, 2015

    @mprins
    Contributor

    looking at the .gitattributes i notice that ths .sh extension is not listed, so git will just guestimate the appropriate line ending convention to use, maybe adding a line *.sh text will just make it behave properly

  9. karussell commented on Jun 18, 2015

    @karussell
    Member

    oh, thanks - fixed!

    @domi-nique please drop the checked out repo and try again. If still not working you can also explicitly convert to windows format via the tool unix2dos I think

  10. karussell commented on Aug 10, 2015

    @karussell
    Member

    Closing here, if still not fixed - please reopen!

  11. karussell commented on Aug 25, 2015

    @karussell
    Member

    Maybe we should use editorconfig to fix this properly (?)

  12. devemux86 commented on Aug 25, 2015

    @devemux86
    Contributor

    Isn't that something that depends on various IDE / plugins support?
    From a quick look I see not all features (e.g. end_of_line) are supported completely everywhere.

  13. karussell commented on Aug 25, 2015

    @karussell
    Member

    Isn't that something that depends on various IDE / plugins support?

    See download - many IDEs have native support

    From a quick look I see not all features (e.g. end_of_line) are supported completely everywhere.

    What do you mean? The line ending could be additionally forced this way as it looks that the git-way fails sometimes.

  14. devemux86 commented on Aug 25, 2015

    @devemux86
    Contributor

    Well the majority works with plugins (Eclipse, NetBeans, etc).
    Even then, searching their supported properties sections, not all are there.
    Doesn't that mean that essentially we could have missing functionality?

  15. karussell commented on Aug 25, 2015

    @karussell
    Member

    I'm only speaking for the line ending ... but yes, the functionality for code formatting is kind of not existing for this

  16. karussell commented on Oct 28, 2015

    @karussell
    Member

    Still an user experienced this issue, and he needed to install a unix environment with unix line endings to fix this. Hmmh.

  17. devemux86 commented on Oct 28, 2015

    @devemux86
    Contributor

    We could use separate batch files (sh and bat), e.g. that's how Gradle wrapper [1] [2] in GH Android sample works.
    More to maintain and Windows users will not have to setup a Unix-like environment to run GH.

  18. karussell commented on Oct 28, 2015

    @karussell
    Member

    I wouldn't be able to maintain this.

  19. highsource commented on Aug 16, 2016

    @highsource
    Contributor

    dos2unix graphhopper.sh worked for me.

  20. zstadler commented on Oct 3, 2016

    @zstadler
    Contributor

    There is a maintenance-free solution, based on this stackoverflow answer.

    Adding this line just after the #! line:

    (set -o igncr) 2>/dev/null && set -o igncr; # this comment is required for handling Windows cr/lf

    Note that the comment is needed in order to ignore the CR in that line, which is read before the option takes effect.

  21. zstadler commented on Oct 3, 2016

    @zstadler
    Contributor

    Created PR #816

  22. added this to the 0.8 milestone on Oct 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions