Skip to content

Cloning fails on Windows #218

Closed
Closed

Description

@Asbjoedt

Hi

I try to clone the project into Idea on Windows, but the cloning fails because four filenames are too long. I then try to clone on Linux and it succeeds without problems. I know Windows has a character limit on filenames.

Is it possible to get these four filenames shortened for Windows support?

Error log

Clone failed

Filename too long unable to create file generator/schema2template/src/test/resources/test-reference/odf/graphml/odf-schema-1.0/_text_page-count_text_paragraph-count_text_word-count_text_character-count_text_table-count_text_image-count_text_object-count.graphml

Filename too long unable to create file generator/schema2template/src/test/resources/test-reference/odf/graphml/odf-schema-1.1/_text_page-count_text_paragraph-count_text_word-count_text_character-count_text_table-count_text_image-count_text_object-count.graphml

Filename too long unable to create file generator/schema2template/src/test/resources/test-reference/odf/graphml/odf-schema-1.2/_text_page-count_text_paragraph-count_text_word-count_text_character-count_text_table-count_text_image-count_text_object-count.graphml

Filename too long unable to create file generator/schema2template/src/test/resources/test-reference/odf/graphml/odf-schema-1.3/_text_page-count_text_paragraph-count_text_word-count_text_character-count_text_table-count_text_image-count_text_object-count.graphml

Filename too long unable to checkout working tree warning

Activity

  1. mistmist commented on May 10, 2023

    @mistmist
    Contributor

    that's a surprising problem... only Svante (who is traveling currently) knows if these can be renamed but the "test-reference" indicates that it's something generated and to be compared with future results of the code generation...

    i tried it with git-for-windows and apparently it depends on the total length of the path:
    "git clone" inside "/c/cygwin/home/ms/lo" is successful
    "git clone" inside "/c/cygwin/home/ms/lo/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" fails with this error

    is it possible to configure Idea to store it in a shorter path?

  2. dennisroczek commented on May 10, 2023

    @dennisroczek

    that's a surprising problem...

    No, that's a known problem on Windows with filenames and folders (in combination) should not be longer than 255 characters... and this although NTFS is able to handle even more characters... 🙈

    is it possible to configure Idea to store it in a shorter path?

    subst G: c:\my\path\to\git\odftoolkit\

    might help to shorten the links to a minimum in my experience. (so creating another (virtual) partition linking to the git folder)

    Well, this subst'ing commands needs to be typed every startup as windows forgets such stuff sadly.

  3. svanteschubert commented on May 24, 2023

    @svanteschubert
    Contributor

    Interesting, I was not aware that such long file name exists (and as developers usually say - works on my laptop) ;-)

    But honestly, first this long path including the file name to a test reference file exists:
    https://github.com/tdf/odftoolkit/blob/master/generator/schema2template/src/test/resources/test-reference/odf/graphml/odf-schema-1.3/_text_page-count_text_paragraph-count_text_word-count_text_character-count_text_table-count_text_image-count_text_object-count.graphml

    this generated from a very special case of the RelaxNG XML Grammar, where a single element might have 7 different names:
    http://docs.oasis-open.org/office/OpenDocument/v1.3/os/schemas/OpenDocument-v1.3-schema-rng.html#8705

    If there is such choice of names for the same entitiy of element - same (sub)content - the unique name is equal to the concatenation of the choices, see
    https://github.com/tdf/odftoolkit/blob/master/generator/schema2template/src/main/java/schema2template/grammar/TinkerPopGraph.java#L75

    so far it seems quite correct and reasonable to me! :-)

    The complete path (including the default odftoolkit repo name counts 232 character but strangely my directory path counts 29 characters and no error for me!
    I even did a test with a loooong directory for cloning:
    135 character is the directory and the total path length of the above file 367 characters:
    E:\dev\012345789012345789012345789012345789012345789012345789012345789012345789012345789012345789012345789012345789012345789012345789\odftoolkit\generator\schema2template\src\test\resources\test-reference\odf\graphml\odf-schema-1.3_text_page-count_text_paragraph-count_text_word-count_text_character-count_text_table-count_text_image-count_text_object-count.graphml

    So I took a look and if you have a Windows docu:
    "Windows before Windows 10 version 1607, the maximum length for a path is MAX_PATH, which is defined as 260 characters.", see https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#maximum-path-length-limitation

    I suggest Dennis approach above use "subst" or a smaller director or a Windows update ;-)
    Guess there is no final fix available and the other changeable parts are more complex to change from my perspective!

    Nevertheless, thanks for pointing this out! Now we have a reference for this problem and work-around!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions