maxmcd / bramble Goto Github PK
View Code? Open in Web Editor NEWPurely functional build system and package manager
Home Page: https://bramble.run/
License: MIT License
Purely functional build system and package manager
Home Page: https://bramble.run/
License: MIT License
do we need to fix these things? will they cause problems?
I would like to start an open-ended discussion about one of the difficulties I see with 'in-the-wild' nix configurations, so folks can share their thoughts and experiences without necessarily 'solutioning an issue'. If you see issues as reasonable for open-ended discussion, I'll close this and open a new one with the specific concerns I have in mind.
Complete the functionality that would allow bramble to use starlark as a build script. Once this issue is complete we should be able to build this derivation:
def run_busybox():
bb = busybox()
# whoami is now available to run
bb.cmd("whoami").print()
def busybox():
# download the executable, this is the only way you are allowed
# to use the network during builds
download = derivation(
name="busybox_download",
builder="fetch_url",
env={
"url": "https://brmbl.s3.amazonaws.com/busybox-x86_64.tar.gz",
"hash": "2ae410370b8e9113968ffa6e52f38eea7f17df5f436bd6a69cc41c6ca01541a1",
},
)
return derivation(
name="busybox",
builder=build_busybox,
deps=[download],
)
def build_busybox():
os.mkdir("$out/bin") # using the builtin os module
# move the busybox executable into the output for this build
cmd("$busybox_download/busybox-x86_64",
"cp",
"$busybox-x86_64 $out/bin/busybox").wait()
commands = []
commands_started = False
# run the busybox help text to extract supported commands
for line in cmd("$out/bin/busybox").output:
if commands_started:
for name in line.strip().split(","):
commands.push(name.strip())
if "Currently defined functions" in line:# the builtin os module
commands_started = True
# move into the output directory so that symlinks are relative
os.cd("$out/bin")
cmd("./busybox ln -s busybox ln").wait()
# link each command
for cmd in commands:
cmd("./ln -s busybox %s" % cmd).wait()
So that previous versions can be pulled and run as needed
Most of the desired initial features are now complete, but there are a lot of gnarly edges. Seems it would make sense to do a cleanup and stability sprint. Things to cover:
I wonder what are the (dis)advantages of Bramble compared to nix (which is itself mentioned in the readme but not elaborated).
+ ln -s /home/maxm/bramble/bramble_store_padding/bramble_/bramble_build_directory538874739/zig /home/maxm/bramble/bramble_store_padding/bramble_/bramble_build_directory538874739/bin/zig
+ ls -lah /home/maxm/bramble/bramble_store_padding/bramble_/bramble_build_directory538874739/bin
total 12K
drwxrwxrwx 2 1000 100 4.0K Mar 11 17:29 .
drwxrwxrwx 5 1000 100 4.0K Mar 11 17:29 ..
lrwxrwxrwx 1 1000 100 86 Mar 11 17:29 zig -> /home/maxm/bramble/bramble_store_padding/bramble_/bramble_build_directory538874739/zig
error building 33rp7api5v46zbucpfenntifbjcfieom-.drv: hash and move build outputs: reading file in tar archive: archive/tar: invalid tar header
reading file in tar archive: archive/tar: invalid tar header
Parsing will just result in derivations to build and then other derivations that could have been built along the way. Instead of using the single Bramble
struct for everything, decouple the functionality so that code is parsed and then json/derivations are outputted.
Now that they're derivations that project/build boundary makes this tricky.
It's currently possible to build things and then visit the build output directory to run software, but it's not really possible to do much else. There used to be functionality to do this, but because Bramble expects to allow people to trivially run software pulled from remote repositories it feels important to create an opinionated default way to run things that won't allow these programs to do dangerous things to the host machine.
Some open questions:
The nested docker containers are a performance hit. Seems like we could have a similar level of isolation using a single docker container and a more careful use of linux permissions.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.