Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement cpio in Elixir to remove dependency #55

Closed
fhunleth opened this issue Oct 27, 2020 · 0 comments · Fixed by #78
Closed

Implement cpio in Elixir to remove dependency #55

fhunleth opened this issue Oct 27, 2020 · 0 comments · Fixed by #78

Comments

@fhunleth
Copy link
Contributor

The use of cpio in bakeware is pretty simplistic and shelling out was done for expediency during the competition. Several people have reported issues with shelling out and it seems simpler just to avoid the issue.

Here's how we use cpio:

For each file and directory in the release do the following:
  Run stat to get the file/directory's type, permissions, etc.
  Write the CPIO header
  If a file, write its contents
When done, write the CPIO trailer

The CPIO header is a fixed length text string. You can see it at https://github.com/bake-bake-bake/bakeware/blob/main/src/cpio.c#L74. The hardest part, I think, is getting the padding correct. Many of the fields are ignored. Forcing those to 0 seems better than trying to get them right for deterministic builds and better compression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant