Closed kkoomen closed 6 months ago
Okay rather than creating a new tar, I can make it work by appending to the tar:
Assuming this file strucure:
.
├── include
│ └── cs50.h
└── sysroot.tar
Then, run:
tar --append --file=sysroot.tar include/cs50.h
I found the problem.
https://github.com/binji/wasm-clang/blob/648c4a89997a351eef75cdaec3ef5b89d4937dec/shared.js#L617
The check here is incorrect. When I simply extract the tar and recreate it without any modifications, the this.readStr(8)
returns "ustar"
for me, not "ustar "
. A more relaxed constraint I personally use is this:
const format = this.readStr(8);
if (!/ustar/.test(format)) {
return null;
}
Hi, I'm trying to bundle
cs50.h
from the cs50 library into this project. I thought, perhaps I can just dotar -xvf syroot.tar
, executecp /usr/local/include/cs50.h include/
to copy thecs50.h
inside the include and dotar -cvf sysroot.tar include lib share
. Unfortunately, after creating a new tar, it can't find anything anymore.Output:
Now, even when I just do
tar -xvf sysroot.tar && rm sysroot.tar && tar -cvf sysroot.tar include lib share
to just extract and immediately create a new tar, I immediately run into this error. My main OS is macOS, I thought the issue might be on the system itself so I created a new tar on a fresh Ubuntu VPS and then copy that tar over to my mac, but then I get the same error.What's the tar command that was used to create the tar?