Skip to content

Stick to Windows-friendly filenames #4627

Closed

Description

@kmcallister

e.g. The question mark in hello_a?foo#bar.html is reported to cause problems. We also had issues with aux.rs in the past.

We should figure out the exact rules, then enforce them in tidy.py.

Activity

  1. added
    E-less-complex
    P-windows
    on Jan 14, 2015
  2. jdm commented on Jan 14, 2015

    @jdm
    Member

    Hmm. The question mark is useful because it allows for an automated test using a query string. Maybe we just need a test harness annotation instead.

  3. Dexterp37 commented on Feb 7, 2015

    @Dexterp37

    This makes git clone on Windows report the following error when checking out:

    error: Invalid path 'tests/ref/hello_a?foo#bar.html'

    The following article talks about allowed characters in Windows paths: link.

    To recap:

    • < > : " / \ | ? *
    • Integer value zero, sometimes referred to as the ASCII NUL character.
    • Characters whose integer representations are 1-31 (less than ASCII space)
    • Any other character that the target file system does not allow (leading and trailing periods or spaces)
    • Any of the DOS names: CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, LPT9 (and avoid AUX.txt, etc)
    • The file name is all periods

    Fixing this will also fix issue #3911.

  4. jdm commented on Feb 8, 2015

    @jdm
    Member

    I guess we should just take the "#bar" out of the filename and update the entry in basic.lit to match.

  5. Dexterp37 commented on Feb 8, 2015

    @Dexterp37

    Well, the whole "?foo#bar.html" needs to be taken out because of the question mark.

  6. jdm commented on Feb 8, 2015

    @jdm
    Member

    Ah right. I guess we don't get to have an automated test for #3340 :(

  7. Manishearth commented on Feb 8, 2015

    @Manishearth
    Member

    We can have mach create the file based on your OS :)

  8. Manishearth commented on Feb 8, 2015

    @Manishearth
    Member

    Wait, we'd still need special harness code to make that work. Hmm.

  9. Dexterp37 commented on Feb 8, 2015

    @Dexterp37

    I just noticed "%" is allowed on Windows. If that's possible on other platforms as well, maybe we could encode special characters like done with the URLs? Like %3F for "?"?

  10. Manishearth commented on Feb 8, 2015

    @Manishearth
    Member

    But the test is explicitly for testing the opening of a file with a ? in its name :)

  11. Dexterp37 commented on Feb 9, 2015

    @Dexterp37

    Ouch! Then I guess conditionally creating it depending on the OS is the best bet :)

  12. SimonSapin commented on Feb 9, 2015

    @SimonSapin
    Member

    Though it’s not great, I’d say it’s acceptable to remove ? and name the file hello_a#foo.html or something, as long as it includes #. Both ? and # are special in URLs, and this tests is about testing that a command line argument is not treated as an URL if it looks relative. So it’s unlikely we’d have this bug for one of the two characters but not both.

  13. frewsxcv commented on Mar 22, 2015

    @frewsxcv
    Contributor

    I don't know how the basic.list parsing works, but what about creating a way to have only certain tests run on unix or windows?

  14. Manishearth commented on Mar 22, 2015

    @Manishearth
    Member

    You could perhaps filter filenames for nowindows, but it still makes the repo uncloneable (? not sure)

  15. akavel commented on Apr 3, 2015

    @akavel

    Sorry, didn't explore thoroughly and don't know the test harness, but @Manishearth do you mean it would be hard to generate the file for a test only on nowindows OS? Could you possibly give some hints for a noob what work it could require and how to try starting to do it?

  16. jdm commented on Sep 12, 2015

    @jdm
    Member

    Fixed by #7610.

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

    A-infrastructureE-less-complexP-windows

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions