Cargo Package Failure - validating tarball

I’ve been attempting to package crates (this has happened to two of them now), but I’m consistently getting the depicted error. I’ve validated the crate files by hand, and they do work properly by using the --no-verify flag, so… I have no idea how to troubleshoot this.

Happens on Windows 10 on latest Nightly and Stable, as well as from the Debian WSL.

Can you try it again with RUST_LOG set?

set RUST_LOG=debug
cargo package

Also, which version of cargo are you using?

That didn't change anything

I've tried with the most recent Stable and the most recent Nightly.

Hold it, apparently the envvar didn’t stick. Here:

What I’m reading is that Windows is returning a Code 22 on attempting to set the Modification Time?

Sorry, somehow I thought you were on windows, so I gave instructions for the Windows command prompt.

Might be a bug in cargo actually, looks like cargo calls tar to extract the package it just made, and tar fails.

Yeah, my next step is to create my own binary using that package, then compressing and decompressing the same set of files, see if that creates the same issue.

I think that’s windows subsystem for linux, and if so, perhaps tar is assuming it can use some linux commands that aren’t there, but then you’re getting exit code 22, which may be windows error code ERROR_BAD_COMMAND (maybe not though, it says “Invalid argument” on the error itself).

Anyway, tracing the error:

  1. tar uses filetime and fails here:
  2. set_file_times uses one of redox/unix/windows

because it’s (probably) windows subsystem, I’m not sure which it uses, but there’s a place to start hunting

It’s not the WSL

Thank you, though, for hunting down that bit. I’ll be continuing this tomorrow.

Well, I think I have the problem… Windows is being dumb with FAT drives. When this filetime crate attempts to set the times on a file on a FAT32 or exFAT drive, it gets an Invalid Arguments error. Not on NTFS, though.

Opened an issue after getting it confirmed on another Win 10 computer