All Projects → tweag → clodl

tweag / clodl

Licence: other
Turn dynamically linked ELF binaries and libraries into self-contained closures.

Programming Languages

Starlark
911 projects
shell
77523 projects
c
50402 projects - #5 most used programming language
java
68154 projects - #9 most used programming language
Nix
1067 projects
C++
36643 projects - #6 most used programming language
haskell
3896 projects

Projects that are alternatives of or similar to clodl

jvm.js
A Java VM bytecode library written in ES6 for Node.js
Stars: ✭ 33 (-75.74%)
Mutual labels:  jvm, jar
Miraiandroid
QQ机器人 /(实验性)在Android上运行Mirai-console,支持插件
Stars: ✭ 188 (+38.24%)
Mutual labels:  jvm, jar
Capsule
Dead-Simple Packaging and Deployment for JVM Apps
Stars: ✭ 1,143 (+740.44%)
Mutual labels:  jvm, jar
eta-ffi
A command line tool to automate the generation of ffi import code for the bindings of various Java libraries.
Stars: ✭ 19 (-86.03%)
Mutual labels:  jvm, jar
lambda-string
Lambda-string (LS) is a helping java agent that inject configurable toString method into lambdas with some useful meta-information.
Stars: ✭ 34 (-75%)
Mutual labels:  jvm
mapneat
MapNeat is a JVM library written in Kotlin that provides an easy to use DSL (Domain Specific Language) for transforming JSON to JSON, XML to JSON, POJO to JSON in a declarative way.
Stars: ✭ 45 (-66.91%)
Mutual labels:  jvm
secrets.clj
A library designed to generate cryptographically strong random numbers.
Stars: ✭ 64 (-52.94%)
Mutual labels:  jvm
pakkero
Pakkero is a binary packer written in Go made for fun and educational purpose. Its main goal is to take in input a program file (elf binary, script, even appimage) and compress it, protect it from tampering and intrusion.
Stars: ✭ 143 (+5.15%)
Mutual labels:  elf
mutator
mutator is an experimental suite of tools aimed at analysis and automation of C/C++ code development
Stars: ✭ 62 (-54.41%)
Mutual labels:  elf
symbol-collector
Clients and Server to collect system symbols.
Stars: ✭ 20 (-85.29%)
Mutual labels:  elf
jvm
simple java virtual machine
Stars: ✭ 53 (-61.03%)
Mutual labels:  jvm
jaz
A JVM implementation in Zig!
Stars: ✭ 44 (-67.65%)
Mutual labels:  jvm
elfloader
load so file into current memory space and run function
Stars: ✭ 39 (-71.32%)
Mutual labels:  elf
dwex
DWARF Explorer - a GUI utility for navigating the DWARF debug information
Stars: ✭ 58 (-57.35%)
Mutual labels:  elf
yarrow
[yarrow] JVMCI based optimizing compiler for HotSpot VM
Stars: ✭ 21 (-84.56%)
Mutual labels:  jvm
go-jdk
Run JVM-based code in Go efficiently
Stars: ✭ 61 (-55.15%)
Mutual labels:  jvm
play-scala-secure-session-example
An example Play application showing encrypted session management
Stars: ✭ 54 (-60.29%)
Mutual labels:  jvm
lagom-samples
developer.lightbend.com/start/?group=lagom
Stars: ✭ 85 (-37.5%)
Mutual labels:  jvm
Automated-Malware-Analysis-List
My personal Automated Malware Analysis Sandboxes and Services
Stars: ✭ 20 (-85.29%)
Mutual labels:  elf
JNotes
Java 工程师必备的技术知识点,全力打造Java 程序员的技能体系知识库;主要体现在 Java 基础、算法、网络、后端框架、数据库、操作系统等方面知识整理。对于Java 初学者升中高级、以及Java后端开发人员的的面试者都有非常显著的帮助。个人博客:www.husycode.cn
Stars: ✭ 33 (-75.74%)
Mutual labels:  jvm

clodl: self-contained dynamic libraries

Build status Build status in Darwin

clodl computes the closure of a shared object. That is, given an executable or shared library, it returns a single self-contained file packing all dependencies. Think of the result as a poor man's container image. Compared to containers:

  • closures do not provide isolation (e.g. separate process, network, filesystem namespaces),
  • but closures do allow for deploying to other machines without concerns about missing dependencies.

Clodl can be used to build binary closures or library closures.

A binary closure is made from an executable or a shared library defining symbol main and can be executed. In practice, the binary closure is a zip file appended to a script that uncompresses the file to a temporary folder and has main invoked.

A library closure is a zip file containing the shared libraries in the closure, and provides one or more top-level libraries which depends on all of the others. When the closure is uncompressed, these top-level libraries can be loaded into the address space of an existing process.

Executing a closure in the address space of an existing process enables lightweight high-speed interop between the closure and the rest of the process. The closure can natively invoke any function in the process without marshalling/unmarshalling any arguments, and vice versa.

Example of binary closure

clodl is implemented as a set of Bazel build rules. It integrates with your Bazel build system, e.g. as follows:

cc_binary(
  name = "hello-cc",
  srcs = ["main.c"],
  deps = ...
)

binary_closure(
  name = "hello-closure-bin",
  src = "hello-cc",
)

With Haskell:

haskell_binary(
    name = "hello-hs",
    srcs = ["src/test/haskell/hello/Main.hs"],
	...
)

binary_closure(
  name = "hello-closure-bin",
  src = "hello-hs",
)

The BUILD file has complete examples.

Example of library closure

clodl is useful for "jarifying" native binaries. Provided shim Java code, closures can be packed inside a JAR and then loaded at runtime into the JVM. This makes JAR's an alternative packaging format to publish and deploy native binaries.

cc_binary(
  name = "libhello.so",
  srcs = ["main.c"],
  linkshared = 1,
  deps = ...
)

library_closure(
  name = "hello-closure",
  srcs = ["libhello.so"],
)

java_binary(
  name = "hello-jar",
  classpath_resources = [":hello-closure"],
  main_class = ...,
  srcs = ...,
  runtime_deps = ...,
)

Building it

Requirements:

  • The Bazel build tool;
  • the Nix package manager;
  • in Linux, the scanelf tool from the pax-utils package;
  • in OSX, otool and install_name_tool.

To build and test:

$ bazel build //...
$ bazel run hello-java

License

Copyright (c) 2015-2018 EURL Tweag.

All rights reserved.

clodl is free software, and may be redistributed under the terms specified in the LICENSE file.

About

clodl is maintained by Tweag I/O.

Have questions? Need help? Tweet at @tweagio.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].