mholt / mholt/archives

ar archive format support

Open
#12 2 comments 4 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
445
Forks
48
PR merge metrics
No merged PRs in 30d

Description

## Introduce the format you are requesting.
from https://en.wikipedia.org/wiki/Ar_(Unix)

The ar format has never been standardized; modern archives are based on a common format with two main variants, [BSD](https://en.wikipedia.org/wiki/BSD) and [System V](https://en.wikipedia.org/wiki/System_V) (initially known as [COFF](https://en.wikipedia.org/wiki/COFF), and used as well by [GNU](https://en.wikipedia.org/wiki/GNU), [ELF](https://en.wikipedia.org/wiki/Executable_and_Linkable_Format), and [Windows](https://en.wikipedia.org/wiki/Windows_API).)

Historically there have been other variants[[5]](https://en.wikipedia.org/wiki/Ar_(Unix)#cite_note-Levine99-5) including [V6](https://en.wikipedia.org/wiki/Version_6_Unix), [V7](https://en.wikipedia.org/wiki/Version_7_Unix), AIX (small and big), and Coherent, which all vary significantly from the common format.[[6]](https://en.wikipedia.org/wiki/Ar_(Unix)#cite_note-ar5-6)

[Debian](https://en.wikipedia.org/wiki/Debian) ".[deb](https://en.wikipedia.org/wiki/Deb_(file_format))" archives use the common format.

An ar file begins with a global [header](https://en.wikipedia.org/wiki/Header_(computing)), followed by a header and data section for each file stored within the ar file.

Each data section is 2 byte aligned. If it would end on an odd offset, a newline ('\n', 0x0A) is used as filler.

## What do YOU use this format for?
ar is generally used only to create and update static library files that the link editor or linker uses and for generating .deb packages for the Debian family; it can be used to create archives for any purpose.

## What is the format's conventional file extension(s)?
most common are:
- .a
- .deb

## Please link to the format's formal or official specification(s).
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/ar.html->

## Which Go libraries could be used to implement this format?
https://github.com/blakesmith/ar

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the repository's existing archive-format implementations and the linked github.com/blakesmith/ar library. Compare the requested common ar format, including BSD and System V variants, with the format's stated alignment and extension requirements. Done means the library can create or extract the intended ar archives and has coverage for the supported variants.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.