Giter Site home page Giter Site logo

fossabot / bramble Goto Github PK

View Code? Open in Web Editor NEW

This project forked from maxmcd/bramble

0.0 0.0 0.0 9.36 MB

Purely functional package manager in Go with Starlark

License: MIT License

Go 90.52% Makefile 1.01% Dockerfile 0.68% Shell 0.90% C 0.03% Nix 0.11% Python 6.76%

bramble's Introduction

Bramble

FOSSA Status

Bramble is a functional build system inspired by nix.

Goals:

This codebase is in active development and is not stable, complete or secure, proceed with caution.

Overview

Bramble is a functional build system. You can use it to reliably build libraries and executables and run them on various systems.

Bramble uses starlark as its build language. Starlark's syntax is a subset of python.

Derivations

Bramble uses starlark as its configuration language.

Derivations are the core building block of Bramble. They describe how how to build a specific package. Here is a simple derivation that downloads a file:

seed = derivation(
    name="seed",
    builder="fetch_url",
    env={
        "decompress": True,
        "url": "https://github.com/maxmcd/bramble/releases/download/v0.0.1/linux-x86_64-seed.tar.gz",
        "hash": "111005a76fa66c148799a8fb67fb784ac47944fcba791efe7599128bbd5884ac",
    },
)

And here's a slightly more complicated one that compiles a simple c program:

load("../seed", "seed")

derivation(
    name="simple",
    env={"seed": seed},
    builder="%s/bin/sh" % seed,
    args=["./simple_builder.sh"],
    sources=["./simple.c", "simple_builder.sh"],
)

CLI

Run

# run the function "foo" in the file default.bramble
bramble run :foo

# run the function foo in the file main.bramble or ./main/default.bramble
bramble run main:foo

# download the package github.com/maxmcd/bramble and run the function "seed"
# in ./seed/default.bramble
bramble run github.com/maxmcd/bramble/seed:seed

Test

# runs rests in the current directory
bramble test

# run tests in the ./tests directory
bramble test ./tests

Store

Bramble stores build artifacts at $BRAMBLE_STORE or at $HOME/bramble. The path is padded out to a fixed length so that cached build outputs can be relocated to a different users home folder.

As an example, when I initialize Bramble on my computer the store path is at:

/home/maxm/bramble/bramble_store_padding/bramble_

If I set $BRAMBLE_PATH to /tmp/bramble it creates the following store path:

/tmp/bramble/bramble_store_padding/bramble_store_

Both are 49 characters long.

You can read more about Strategies for Binary Relocation In Functional Build Systems

License

FOSSA Status

bramble's People

Contributors

fossabot avatar maxmcd avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.