Site icon DebugPoint NEWS

Meta Open Sources DotSlash: Executable Deployment Tool

Meta open sources the in-house Simplified executable deployment tool “DotSlash”.

Yet another Rust update for you. Meta has officially open-sourced DotSlash, a cutting-edge command-line utility designed to simplify the distribution of executable files across diverse platforms. DotSlash, written in the high-performance language Rust, addresses the challenge of managing large executables in source control, eliminating the need for including all supported platform files in a package.

DotSlash: Key Features

Avoiding I/O-heavy clone operations: DotSlash offers a solution by replacing a set of platform-specific executables with a single script containing descriptors for supported platforms. This approach significantly diminishes the impact on repository size, preventing sluggish and resource-intensive clone operations.

Efficient Handling of Executables: The utility transparently manages the fetching, decompressing, and verification of the appropriate remote artifact tailored to the current operating system and CPU. DotSlash automates these processes, ensuring a seamless experience for developers and reducing the potential for errors in manual handling.

Automation for Meta’s Workflow: At Meta, the majority of DotSlash files are generated and committed to source control through automation. Recognizing the value of this streamlined workflow, Meta is complementing the open-source release with a GitHub Action. This action enables developers outside of Meta to effortlessly assemble a comparable setup, promoting consistency and reliability in executable file management.

Cross-Platform Compatibility: DotSlash is written in Rust, a language known for its performance and safety features. This choice ensures that the utility is cross-platform, catering to the diverse needs of developers across different operating systems.

How DotSlash Works

DotSlash operates as a command-line utility, executing scripts that automate the download of an executable file suitable for the current platform, ensuring its integrity, and facilitating seamless execution. By storing information about collected executable files in a repository alongside the code, DotSlash separates the files themselves on dedicated servers. This innovative approach prevents repository size growth and alleviates the burden on input/output systems during cloning operations.

When utilizing DotSlash, developers benefit from a simplified workflow. The set of platform-specific executable files is replaced by a single script that contains the logic for selecting the appropriate executable based on supported platforms. Running a DotSlash script triggers the dynamic download, unpacking, verification against a cryptographic hash, and local caching of the required executable for subsequent runs.

Moreover, DotSlash scripts can be automatically generated for releases published on GitHub, providing an additional layer of convenience for developers.

Here’s an example of DotSlash script which distributes Node.js on macOS ARM, macOS x64 and Linux platforms:

#!/usr/bin/env dotslash

{
  "name": "node-v18.19.0",
  "platforms": {
    "macos-aarch64": {
      "size": 40660307,
      "hash": "blake3",
      "digest": "6e2ca33951e586e7670016dd9e503d028454bf9249d5ff556347c3d98c347c34",
      "format": "tar.gz",
      "path": "node-v18.19.0-darwin-arm64/bin/node",
      "providers": [
        {
          "url": "https://nodejs.org/dist/v18.19.0/node-v18.19.0-darwin-arm64.tar.gz"
        }
      ]
    },
   
    "macos-x86_64": {
      "size": 42202872,
      "hash": "blake3",
      "digest": "37521058114e7f71e0de3fe8042c8fa7908305e9115488c6c29b514f9cd2a24c",
      "format": "tar.gz",
      "path": "node-v18.19.0-darwin-x64/bin/node",
      "providers": [
        {
          "url": "https://nodejs.org/dist/v18.19.0/node-v18.19.0-darwin-x64.tar.gz"
        }
      ]
    },

    "linux-x86_64": {
      "size": 44694523,
      "hash": "blake3",
      "digest": "72b81fc3a30b7bedc1a09a3fafc4478a1b02e5ebf0ad04ea15d23b3e9dc89212",
      "format": "tar.gz",
      "path": "node-v18.19.0-linux-x64/bin/node",
      "providers": [
        {
          "url": "https://nodejs.org/dist/v18.19.0/node-v18.19.0-linux-x64.tar.gz"
        }
      ]
    }
  }
}

Open Source and Licensing

Facebook’s decision to open source DotSlash will encourage the collaboration and innovation within the developer community. DotSlash is distributed under the MIT and Apache 2.0 licenses, allowing developers to freely use, modify, and distribute the utility while maintaining a level of compatibility with existing open-source projects.

For more details, visit the Facebook engineering blog & GitHub repo for DotSlash.

Recent articles from DebugPoint.com

Loading...
Exit mobile version