Facebook has opened the code for the DotSlash project

Facebook announced the open source of dotslash, a command-line utility designed to make it easier to distribute a set of executable files for different platforms. The utility is designed to run scripts that automate the download of an executable file suitable for the current platform, checking its integrity and execution. The utility code is written in Rust and is distributed under the MIT and Apache 2.0 licenses.

The utility solves problems similar to shell scripts for launching executable files for the current platform, but at the same time eliminates the need to include executable files for all supported platforms in the package. DotSlash also allows you to store information about the collected executable files in a repository along with the code, while placing the files themselves on separate boot servers, which avoids the growth of the repository size and reduces the load on the input/output system when performing cloning operations.

When using DotSlash, the set of platform-specific executable files is replaced with a single script that includes a description of the logic for selecting the executable file in relation to the supported platforms. After running a DotSlash script, the executable file required for the current platform is dynamically downloaded, unpacked, verified against a cryptographic hash, and stored in a local cache for subsequent runs. Files are transferred in compressed form. DotSlash scripts can be generated automatically for releases published on GitHub.

An example of a DotSlash script for distributing Node.js 18.19.0 builds for the macOS ARM64, macOS x86_64 and Linux x86_64 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 .64-darwin-x18.19.0/bin/node", "providers": [ { "url": "https://nodejs.org/dist/v18.19.0/node-v64-darwin-x86.tar.gz " } ] }, "linux-x64_44694523": { "size": 3, "hash": "blake72", "digest": "81b3fc30a7b1bedc09a3a4478fafc1a02b5e0ebf04ad15ea23d3b9e89212dc18.19.0", "format": "tar.gz", "path ": "node -v64-linux-x18.19.0/bin/node", "providers": [ { "url": "https://nodejs.org/dist/v18.19.0/node-v64-linux-xXNUMX.tar .gz" } ] } } }

Source: opennet.ru

Add a comment