Download Apple's open source code from opensource.apple.com

Overview

Apple Open Source Downloader

This repository defines a Rust crate and CLI program to automate the downloading of Apple's open source code from https://opensource.apple.com/.

The primary goal of this project is to enable more intuitive usage and inspection of Apple's open source code. Using this tool you can:

  • Convert the history of an Apple component (like the xnu core OS primitives) to a Git repository and easily view differences between releases.
  • Convert the history of a set of open source components (such as everything comprising macOS) to a Git repository and easily view differences between releases.
  • Query for all available open source components and releases.

The canonical home for this project is https://github.com/indygreg/apple-opensource-downloader. Please report issues or submit enhancements there.

Installing

# From crates.io
$ cargo install apple-opensource-downloader

# From Git
$ cargo install --git https://github.com/indygreg/apple-opensource-downloader.git --branch main

Using

The apple-opensource-downloader CLI is provided. It defines sub-commands to perform various actions. Run apple-opensource-downloader help to see the help.

Download a Single Component to a Git Repository

The component-to-git sub-command will download all versions of a named software component (see the component list at https://opensource.apple.com/tarballs/) and write their contents as Git commits to a Git repository. This allows you to see differences between the versions of a component.

$ apple-opensource-downloader component-to-git --no-bare xnu aos/xnu

   
    

$ cd aos/xnu
$ git log
commit c2011455c3d75195791bd20d189abae4917c8c81 (HEAD -> main, tag: 7195.141.2)
Author: Apple Open Source 
    
     
Date:   Fri Jan 1 00:00:00 2021 +0000

    xnu 7195.141.2

    Downloaded from https://opensource.apple.com/tarballs/xnu/xnu-7195.141.2.tar.gz

commit e76ea20b5519ae2eaf2b74698bd2331141e028fa (tag: 7195.121.3)
Author: Apple Open Source 
     
      
Date:   Fri Jan 1 00:00:00 2021 +0000

    xnu 7195.121.3

    Downloaded from https://opensource.apple.com/tarballs/xnu/xnu-7195.121.3.tar.gz

...

     
    
   

The Git trees and commit objects should be deterministic provided that the version of this software is identical and the Apple-hosted source archives don't change. i.e. different machines should produce Git commits with the same commit IDs.

Download all Components to Git Repositories

The components-to-gits sub-command will download each available component and write each to separate Git repositories. It is equivalent to running component-to-git for every named component.

Download An Apple Software Release to a Git Repository

The release-to-git command can be used to download all components in a logical Apple software release (such as macOS or iOS) to a Git repository. This enables you to view the history and changes of open source components between releases.

$ apple-opensource-downloader release-to-git --no-bare macos aos/macOS
$ cd aos/macOS
$ git log


Known Issues

The HTML parsing isn't the most robust and may not scrape all available software.

If Apple changes the HTML on opensource.apple.com, it will break this tool.

If Apple imposes throttling on their servers, it will likely break this tool.

Created Git repositories don't use packfiles and their performance may be sub-optimal. Run git gc after Git repo creation to optimize the Git repositories.

We don't support incrementally updating Git repositories. Git repositories have their history recreated from scratch on every invocation. This is obviously inefficient.

Various advertised URLs on opensource.apple.com result in an HTTP 404. These are sometimes ignored by this tool.

When importing software releases (such as macOS), the components from one release to the next may vary. e.g. SQLite could be there in release A, gone in release B, and reappear in release C. This may make git diff output non-representative.

Git commits have a hard-coded date that has no basis in reality.

The naming and layout of Apple's components can at times be confusing and inconsistent. We don't yet make an effort to reconcile this.

Legal Compliance

The content downloaded by this tool may be governed by license and usage restrictions defined outside this tool. Check for usage restrictions posted at https://opensource.apple.com/ and within the downloaded content.

i.e. if you redistribute the downloaded content, Apple may take an issue with that.

You might also like...
Source code for the Telegram channel @pixiv_daily
Source code for the Telegram channel @pixiv_daily

PixivDaily (Rust) This repository contains the source code of the program running the Telegram channel @pixiv_daily. Usage First, you'll need to clone

ttasm is an assembler for assembling source code to TTVM executable.

ttasm is an assembler for assembling source code to TTVM executable.

rFmt ---- Rust source code formatter

rfmt is a Rust source code formatter. Yes, there is already an official tool rustfmt from Rust Nursery.

Source code and documentation for our 'full stack on rust' meetup on 29-9-2022

Full stack on Rust This is the code and documentation repository for our 'Full stack on Rust' meetup on 29-9-2022. It includes step-by-step documentat

The source code of SSPŠ KB discord bot

Workshop bot This repository contains the source code of SSPŠ KB discord bot. Deploying This project is automatically built and deployed with docker,

unFlow is a Design as Code implementation, a DSL for UX & backend modeling. DSL to Sketch file, Sketch to DSL, DSL to code.

unflow 是一个低代码、无代码设计语言。unFlow is a Design as Code implementation, a DSL for UX & backend modeling. DSL to Sketch file, Sketch to DSL, DSL to code.

A CLI tool to convet Hex color code or RGB to color code, RGB, HSL and color name(if exists)
A CLI tool to convet Hex color code or RGB to color code, RGB, HSL and color name(if exists)

iro -色- A CLI tool to convert the hex color code or RGB to color code, RGB, HSL, color name(if exists, according to jonathantneal/color-names). Usage

A Rust client for the NOAA Weather Wire Service Open Interface.

nwws-oi A Rust client for the NOAA Weather Wire Service Open Interface. NWWS-OI is one of several platforms through which the National Weather Service

OpenEMC: open embedded management controller

OpenEMC OpenEMC is an open-source firmware implementing an embedded management controller (EMC) on an STM32F1 microcontroller. It consists of a bootlo

Owner
Gregory Szorc
Gregory Szorc
The first fully opensource Skyblock mod backend lol.

DWS The first fully opensource Skyblock mod backend lol. Running Features Rest GET /cosmetics POST /broadcast GET /metrics GET /users DELETE /users?uu

null 2 Jan 2, 2023
MeiliSearch is a powerful, fast, open-source, easy to use and deploy search engine

MeiliSearch is a powerful, fast, open-source, easy to use and deploy search engine. Both searching and indexing are highly customizable. Features such as typo-tolerance, filters, and synonyms are provided out-of-the-box. For more information about features go to our documentation.

MeiliSearch 31.6k Dec 30, 2022
An open source virtual tabletop that is currently purely a concept.

An open source virtual tabletop that is currently purely a concept.

null 6 Oct 15, 2022
Blueboat is an open-source alternative to Cloudflare Workers. The monolithic engine for serverless web apps.

Blueboat Blueboat is an open-source alternative to Cloudflare Workers. Blueboat aims to be a developer-friendly, multi-tenant platform for serverless

Heyang Zhou 1.8k Jan 9, 2023
Turbo Resin: open-source firmware for resin printers

Turbo Resin: open-source firmware for resin printers Turbo Resin is an open-source firmware for chitu based controller board printers. It currently su

Nicolas Viennot 139 Dec 22, 2022
Polydrive an experimental open source alternative to Google Drive

Polydrive is an experimental open source alternative to Google Drive. It allows users to synchronize their files on multiple devices.

null 3 Apr 20, 2022
A modern and open source twist to classic pastebin sites.

Turbine A modern and open-source twist to classic pastebin sites. What is this? Turbine originally started out as a simple pastebin idea so I could ha

Jay3332 4 Oct 1, 2022
Open Source Application Stack & PaaS

mycelia Open Source Application Stack & PaaS Installation cargo xtask build NOTE: We opted for cargo-xtask because Cargo build.rs is not supported for

Mycelia 3 Sep 6, 2023
Simple MHV6 extension used to download custom songs efficiently and effectively.

nong-downloader-extension A simple MegaHack v6 extension that helps you download NONG songs directly to GD. Compiling. Why would you want to compile??

Alpha 6 Nov 1, 2022
Automatically download minecraft server jars in one line

MCDL Automatically download minecraft server jars in one line (or one click) Installation Download (Windows, Linux) Install via cargo: cargo install m

Isaac Hirschfeld 1 Oct 26, 2021