udoprog/genco

Doesn't seem to unpack on Windows

Closed this issue · 5 comments

I was trying to build reproto on Windows, and cargo failed in a way I haven't seen before:

image

I tried deleting the cached copies of genco from cargo, that way it would download it again and try to extract it, but the same issue occurred again. So, I went into the WSL/Bash and reproto compiles just fine under Linux.

The code generating the error is here. I'm not sure what would cause this failure.

...It just hit me. Over the years, I've historically only used Unix-like OSes, but I try to stay familiar with Windows, since it helps me stay a well-rounded developer.

Let me introduce you to this fun article. Relevant quote:

Do not use the following reserved names for the name of a file:
CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9. Also avoid these names followed immediately by an extension; for example, NUL.txt is not recommended.

You have a file named con.rs. The extension doesn't matter -- this is a holdover from the DOS days, when folders didn't even exist, and these reserved files were reserved with no regard for the 3 digit extension on the "8.3" format. CON is the console input/output "file". So, when tar-rs tries to unpack a file named CON, it just gets printed to the console, as we can see above, and then setting mtime fails, of course, since you can't set the modified time on the console.

I only made this connection when I tried to git clone this repository directly and the file was printed the console output there as well, with the file missing from the hierarchy.

So, to resolve this issue for Windows... the only option is to remove or rename con.rs. 😞

Thank you!

I saw that error before but didn't have the time to figure out what was going on. You just saved me a ton of effort :).

Renaming the file to con_.rs should work (goto approach when dealing with reserved words). Maybe name the tour something better eventually.

I've shipped an updated version of genco (0.1.11) which uses con_.
Please try a cargo update and rebuild reproto. Tell me if anything else pops up.

Thank you again!

This issue is now fixed. Now I'm just dealing with trying to get the onig-sys library to compile... I wish syntect just used some native-Rust regex library, but it doesn't.

@coder543 Thanks! Moving this to reproto/reproto#12