This repository was archived by the owner on Aug 20, 2026. It is now read-only.

Repository files navigation

Warp

dependabot

Build serverPlatformsBuild status
Github Actionslinux-latest, windows-latest, macos-latestBranch: develop warp
Github Actionslinux-latest, windows-latest, macos-latestBranch: master warp

This repository was forked fromdgiagio/warp because the original author stopped maintaining the project.

Warp lets you create self-contained single binary applications making it simpler and more ergonomic to deliver your application to your customers. A self-contained binary is specially convenient when the technology you use, such as Node.js, .NET Core, Java and others, contain many dependencies that must be shipped alongside your application.

Warp is written in Rust and is supported on Linux, Windows and macOS.

Table of Content

Quickstart with Node.js

Linux

Create the directory for the application

dgiagio@X1:~/Devel$ mkdir myapp
dgiagio@X1:~/Devel/myapp$ cd myapp

Create main application - app.js

varlodash=require('lodash');varoutput=lodash.without([1,2,3],1);console.log(output);

Download Node.js distribution

dgiagio@X1:~/Devel/myapp$ wget https://nodejs.org/dist/v8.12.0/node-v8.12.0-linux-x64.tar.xz
dgiagio@X1:~/Devel/myapp$ xz -dc node-v8.12.0-linux-x64.tar.xz | tar xvf -

Install dependencies

dgiagio@X1:~/Devel/myapp$ node-v8.12.0-linux-x64/bin/npm install lodash

Remove unneeded files

dgiagio@X1:~/Devel/myapp$ rm -r node-v8.12.0-linux-x64/include node-v8.12.0-linux-x64/share node-v8.12.0-linux-x64/lib
dgiagio@X1:~/Devel/myapp$ rm node-v8.12.0-linux-x64/bin/npm node-v8.12.0-linux-x64/bin/npx

Create launcher script - launch

#!/bin/sh
NODE_DIST=node-v8.12.0-linux-x64
APP_MAIN_JS=app.js
DIR="$(cd "$(dirname "$0")";pwd -P)"
NODE_EXE=$DIR/$NODE_DIST/bin/node
NODE_PATH=$DIR/node_modules
APP_MAIN_JS_PATH=$DIR/$APP_MAIN_JSexec$NODE_EXE$APP_MAIN_JS_PATH$@

Make the launcher script executable

dgiagio@X1:~/Devel/myapp$ chmod +x launch

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

dgiagio@X1:~/Devel/myapp$ cd ..
dgiagio@X1:~/Devel$ curl -Lo warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/linux-x64.warp-packer
dgiagio@X1:~/Devel$ chmod +x warp-packer

Create your self-contained application

dgiagio@X1:~/Devel$ ./warp-packer --arch linux-x64 --input_dir myapp --exec launch --output myapp.bin
dgiagio@X1:~/Devel$ chmod +x myapp.bin

Run your self-contained application

dgiagio@X1:~/Devel$ ./myapp.bin
[ 2, 3 ]
dgiagio@X1:~/Devel$

More information about your self-contained application

dgiagio@X1:~/Devel/myapp$ file myapp.bin
myapp.bin: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=aa53b01be2cde5e0b64450870b1af13b52d5cffb, with debug_info, not stripped
dgiagio@X1:~/Devel/myapp$ du -hs myapp.bin
17M myapp.bin

macOS

Create the directory for the application

Diegos-iMac:Devel dgiagio$ mkdir myapp
Diegos-iMac:Devel dgiagio$ cd myapp

Create main application - app.js

varlodash=require('lodash');varoutput=lodash.without([1,2,3],1);console.log(output);

Download Node.js distribution

Diegos-iMac:myapp dgiagio$ curl -Lo node-v8.12.0-darwin-x64.tar.gz https://nodejs.org/dist/v8.12.0/node-v8.12.0-darwin-x64.tar.gz
Diegos-iMac:myapp dgiagio$ tar xvfz node-v8.12.0-darwin-x64.tar.gz

Install dependencies

Diegos-iMac:myapp dgiagio$ PATH=node-v8.12.0-darwin-x64/bin npm install lodash

Remove unneeded files

Diegos-iMac:myapp dgiagio$ rm -r node-v8.12.0-darwin-x64/include node-v8.12.0-darwin-x64/share node-v8.12.0-darwin-x64/lib
Diegos-iMac:myapp dgiagio$ rm node-v8.12.0-darwin-x64/bin/npm node-v8.12.0-darwin-x64/bin/npx

Create launcher script* - launch

#!/bin/sh
NODE_DIST=node-v8.12.0-darwin-x64
APP_MAIN_JS=app.js
DIR="$(cd "$(dirname "$0")";pwd -P)"
NODE_EXE=$DIR/$NODE_DIST/bin/node
NODE_PATH=$DIR/node_modules
APP_MAIN_JS_PATH=$DIR/$APP_MAIN_JSexec"$NODE_EXE""$APP_MAIN_JS_PATH"$@

Make the launcher script executable

Diegos-iMac:myapp dgiagio$ chmod +x launch

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

Diegos-iMac:myapp dgiagio$ cd ..
Diegos-iMac:Devel dgiagio$ curl -Lo warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/macos-x64.warp-packer
Diegos-iMac:Devel dgiagio$ chmod +x warp-packer

Create your self-contained application

Diegos-iMac:Devel dgiagio$ ./warp-packer --arch macos-x64 --input_dir myapp --exec launch --output myapp.bin
Diegos-iMac:Devel dgiagio$ chmod +x myapp.bin

Run your self-contained application

Diegos-iMac:Devel dgiagio$ ./myapp.bin
[ 2, 3 ]
Diegos-iMac:Devel dgiagio$

More information about your self-contained application

Diegos-iMac:Devel dgiagio$ file myapp.bin
myapp.bin: Mach-O 64-bit executable x86_64
Diegos-iMac:Devel dgiagio$ du -hs myapp.bin
26M myapp.bin

Windows

Create the directory for the application

PS C:\Users\Diego\Devel> mkdir myapp
PS C:\Users\Diego\Devel> cd myapp

Create main application - app.js

varlodash=require('lodash');varoutput=lodash.without([1,2,3],1);console.log(output);

Download Node.js distribution

PS C:\Users\Diego\Devel\myapp> curl https://nodejs.org/dist/v8.12.0/node-v8.12.0-win-x64.zip -OutFile node-v8.12.0-win-x64.zip
PS C:\Users\Diego\Devel\myapp>Expand-Archive .\node-v8.12.0-win-x64.zip -DestinationPath .\

Install dependencies

PS C:\Users\Diego\Devel\myapp> .\node-v8.12.0-win-x64\npm install lodash

Remove unneeded files

PS C:\Users\Diego\Devel\myapp> rmdir -Recurse .\node-v8.12.0-win-x64\node_modules\npm

Create launcher script* - launch.cmd

@ECHOOFFSETLOCALSET"NODE_DIST=node-v8.12.0-win-x64"SET"APP_MAIN_JS=app.js"SET"NODE_EXE=%~dp0\%NODE_DIST%\node.exe"SET"NODE_PATH=%~dp0\%NODE_DIST%\node_modules"SET"APP_MAIN_JS_PATH=%~dp0\%APP_MAIN_JS%"CALL%NODE_EXE%%APP_MAIN_JS_PATH%%*EXIT /B %ERRORLEVEL%

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

PS C:\Users\Diego\Devel\myapp> cd ..
PS C:\Users\Diego\Devel> [Net.ServicePointManager]::SecurityProtocol ="tls12, tls11, tls" ; Invoke-WebRequest https://github.com/dgiagio/warp/releases/download/v0.3.0/windows-x64.warp-packer.exe-OutFile warp-packer.exe

Create your self-contained application

PS C:\Users\Diego\Devel> .\warp-packer --arch windows-x64 --input_dir .\myapp\ --exec launch.cmd--output myapp.exe

Run your self-contained application

PS C:\Users\Diego\Devel> .\myapp.exe
[ 2,3 ]
PS C:\Users\Diego\Devel>

More information about your self-contained application

PS C:\Users\Diego\Devel>"{0:N2} MB"-f ((Get-Itemmyapp.exe).Length /1MB)
9.15 MB

Quickstart with .NET Core

Linux

Create a simple console application

dgiagio@X1:~/Devel$ mkdir myapp
dgiagio@X1:~/Devel$ cd myapp
dgiagio@X1:~/Devel/myapp$ dotnet new console
dgiagio@X1:~/Devel/myapp$ dotnet run
Hello World!
dgiagio@X1:~/Devel/myapp$

Publish the application with native installer for linux-x64 runtime

dgiagio@X1:~/Devel/myapp$ dotnet publish -c Release -r linux-x64

The application should be published to bin/Release/netcoreapp2.1/linux-x64/publish/

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

dgiagio@X1:~/Devel/myapp$ curl -Lo warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/linux-x64.warp-packer
dgiagio@X1:~/Devel/myapp$ chmod +x warp-packer

Create your self-contained application

dgiagio@X1:~/Devel/myapp$ ./warp-packer --arch linux-x64 --input_dir bin/Release/netcoreapp2.1/linux-x64/publish --exec myapp --output myapp
dgiagio@X1:~/Devel/myapp$ chmod +x myapp

Run your self-contained application

dgiagio@X1:~/Devel/myapp$ ./myapp
Hello World!
dgiagio@X1:~/Devel/myapp$

More information about your self-contained application

dgiagio@X1:~/Devel/myapp$ file myapp
myapp: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, BuildID[sha1]=13b12e71a63ca1de8537ad7e90c83241f9f87f6c, with debug_info, not stripped
dgiagio@X1:~/Devel/myapp$ du -hs myapp
34M myapp

macOS

Create a simple console application

Diegos-iMac:Devel dgiagio$ mkdir myapp
Diegos-iMac:Devel dgiagio$ cd myapp
Diegos-iMac:myapp dgiagio$ dotnet new console
Diegos-iMac:myapp dgiagio$ dotnet run
Hello World!
Diegos-iMac:myapp dgiagio$

Publish the application with native installer for osx-x64 runtime

Diegos-iMac:myapp dgiagio$ dotnet publish -c Release -r osx-x64

The application should be published to bin/Release/netcoreapp2.1/osx-x64/publish/

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

Diegos-iMac:myapp dgiagio$ curl -Lo warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/macos-x64.warp-packer
Diegos-iMac:myapp dgiagio$ chmod +x warp-packer

Create your self-contained application

Diegos-iMac:myapp dgiagio$ ./warp-packer --arch macos-x64 --input_dir bin/Release/netcoreapp2.1/osx-x64/publish --exec myapp --output myapp
Diegos-iMac:myapp dgiagio$ chmod +x myapp

Run your self-contained application

Diegos-iMac:myapp dgiagio$ ./myapp
Hello World!
Diegos-iMac:myapp dgiagio$

More information about your self-contained application

Diegos-iMac:myapp dgiagio$ file myapp
myapp: Mach-O 64-bit executable x86_64
Diegos-iMac:myapp dgiagio$ du -hs myapp
27M myapp

Windows

Create a simple console application

PS C:\Users\Diego\Devel> mkdir myapp
PS C:\Users\Diego\Devel> cd myapp
PS C:\Users\Diego\Devel\myapp> dotnet new console
PS C:\Users\Diego\Devel\myapp> dotnet run
Hello World!
PS C:\Users\Diego\Devel\myapp>

Publish the application with native installer for win10-x64 runtime

PS C:\Users\Diego\Devel\myapp> dotnet publish -c Release -r win10-x64

The application should be published to bin/Release/netcoreapp2.1/win10-x64/publish/

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

PS C:\Users\Diego\Devel\myapp> [Net.ServicePointManager]::SecurityProtocol ="tls12, tls11, tls" ; Invoke-WebRequest https://github.com/dgiagio/warp/releases/download/v0.3.0/windows-x64.warp-packer.exe-OutFile warp-packer.exe

Create your self-contained application

PS C:\Users\Diego\Devel\myapp> .\warp-packer --arch windows-x64 --input_dir bin/Release/netcoreapp2.1/win10-x64/publish --exec myapp.exe--output myapp.exe

Run your self-contained application

PS C:\Users\Diego\Devel\myapp> .\myapp.exe
Hello World!
PS C:\Users\Diego\Devel\myapp>

More information about your self-contained application

PS C:\Users\Diego\Devel\myapp>"{0:N2} MB"-f ((Get-Itemmyapp.exe).Length /1MB)
28.51 MB

Quickstart with Java

Linux

Create a Hello World application

Create HelloWorld.java:

// HelloWorld.javapublicfinalclassHelloWorld {
publicstaticvoidmain(finalString[] args) {
System.out.println("Hello, world. ");
}
}

Test that it works:

$ javac HelloWorld.java
$ java HelloWorld
Hello, world.

We need to bundle this as a .jar:

$ jar cvfe app.jar HelloWorld HelloWorld.class
added manifest
adding: HelloWorld.class(in = 428) (out= 290)(deflated 32%)
$ java -jar app.jar
Hello, world.

Download a JRE

There are prebuilt JREs over on AdoptOpenJDK.

Here we use JRE 8:

wget -N https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u202-b08/OpenJDK8U-jre_x64_linux_hotspot_8u202b08.tar.gz

Unpack it:

tar -xvf OpenJDK8U-jre_x64_linux_hotspot_8u202b08.tar.gz

Create a bundle

We need to create a folder containing: our compiled code, the JRE and a launch script.

mkdir bundle
cp -r ./jdk8u202-b08-jre ./bundle/jre
cp app.jar ./bundle/app.jar
touch bundle/run.sh
chmod +x ./bundle/run.sh 

Finally, we to write run.sh. This script will run our .jar using the bundled JRE.

Here are the contents of ./bundle/run.sh:

#!/usr/bin/env bash
HERE=${BASH_SOURCE%/*}"$HERE/jre/bin/java" -jar "$HERE/app.jar""$@"

Test the bundle:

$ ./bundle/run.sh Hello, world. 

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

$ wget -O warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/linux-x64.warp-packer
$ chmod +x ./warp-packer

Create your self-contained application

$ ./warp-packer --arch linux-x64 --input_dir bundle --exec run.sh --output app.bin
$ chmod +x app.bin

Run your self-contained application

$ ./app.bin Hello, world. 

How it works

Warp is a multi-platform tool written in Rust and is comprised of two programs: warp-runner and warp-packer.

The final self-contained single binary application consists of two parts: 1) runner and 2) the compressed target application executable and dependencies.

warp-runner is a stub application that knows how to find the compressed payload within its own binary, perform extraction to a local cache and execute the target application.

The extraction process only happens the first time the application is ran, or when the self-contained application binary is updated.

warp-packer is a CLI application that's used to create the self-contained application binary by downloading the matching warp-runner for the chosen platform, compressing the target application and its dependencies, and generating the final self-contained binary.

Performance

The performance characteristics of the generated self-contained application is roughly the same of original application, except for the first time it's ran as the target application and its dependencies have to be decompressed to a local cache.

Packages cache location

  • Linux: $HOME/.local/share/warp/packages
  • macOS: $HOME/Library/Application Support/warp/packages
  • Windows: %LOCALAPPDATA%\warp\packages

Runners cache location

  • Linux: $HOME/.local/share/warp/runners
  • macOS: $HOME/Library/Application Support/warp/runners
  • Windows: %LOCALAPPDATA%\warp\runners

Authors

  • Diego Giagio <diego@giagio.com>
  • Finter Mobility As

Icons

License

This project is licensed under the MIT License - see the LICENSE file for details

Who is Using Warp?

About

Create self-contained single binary applications

Resources

Stars

20 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content
This repository was archived by the owner on Aug 20, 2026. It is now read-only.

Repository files navigation

Warp

dependabot

Build serverPlatformsBuild status
Github Actionslinux-latest, windows-latest, macos-latestBranch: develop warp
Github Actionslinux-latest, windows-latest, macos-latestBranch: master warp

This repository was forked fromdgiagio/warp because the original author stopped maintaining the project.

Warp lets you create self-contained single binary applications making it simpler and more ergonomic to deliver your application to your customers. A self-contained binary is specially convenient when the technology you use, such as Node.js, .NET Core, Java and others, contain many dependencies that must be shipped alongside your application.

Warp is written in Rust and is supported on Linux, Windows and macOS.

Table of Content

Quickstart with Node.js

Linux

Create the directory for the application

dgiagio@X1:~/Devel$ mkdir myapp
dgiagio@X1:~/Devel/myapp$ cd myapp

Create main application - app.js

varlodash=require('lodash');varoutput=lodash.without([1,2,3],1);console.log(output);

Download Node.js distribution

dgiagio@X1:~/Devel/myapp$ wget https://nodejs.org/dist/v8.12.0/node-v8.12.0-linux-x64.tar.xz
dgiagio@X1:~/Devel/myapp$ xz -dc node-v8.12.0-linux-x64.tar.xz | tar xvf -

Install dependencies

dgiagio@X1:~/Devel/myapp$ node-v8.12.0-linux-x64/bin/npm install lodash

Remove unneeded files

dgiagio@X1:~/Devel/myapp$ rm -r node-v8.12.0-linux-x64/include node-v8.12.0-linux-x64/share node-v8.12.0-linux-x64/lib
dgiagio@X1:~/Devel/myapp$ rm node-v8.12.0-linux-x64/bin/npm node-v8.12.0-linux-x64/bin/npx

Create launcher script - launch

#!/bin/sh
NODE_DIST=node-v8.12.0-linux-x64
APP_MAIN_JS=app.js
DIR="$(cd "$(dirname "$0")";pwd -P)"
NODE_EXE=$DIR/$NODE_DIST/bin/node
NODE_PATH=$DIR/node_modules
APP_MAIN_JS_PATH=$DIR/$APP_MAIN_JSexec$NODE_EXE$APP_MAIN_JS_PATH$@

Make the launcher script executable

dgiagio@X1:~/Devel/myapp$ chmod +x launch

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

dgiagio@X1:~/Devel/myapp$ cd ..
dgiagio@X1:~/Devel$ curl -Lo warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/linux-x64.warp-packer
dgiagio@X1:~/Devel$ chmod +x warp-packer

Create your self-contained application

dgiagio@X1:~/Devel$ ./warp-packer --arch linux-x64 --input_dir myapp --exec launch --output myapp.bin
dgiagio@X1:~/Devel$ chmod +x myapp.bin

Run your self-contained application

dgiagio@X1:~/Devel$ ./myapp.bin
[ 2, 3 ]
dgiagio@X1:~/Devel$

More information about your self-contained application

dgiagio@X1:~/Devel/myapp$ file myapp.bin
myapp.bin: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=aa53b01be2cde5e0b64450870b1af13b52d5cffb, with debug_info, not stripped
dgiagio@X1:~/Devel/myapp$ du -hs myapp.bin
17M myapp.bin

macOS

Create the directory for the application

Diegos-iMac:Devel dgiagio$ mkdir myapp
Diegos-iMac:Devel dgiagio$ cd myapp

Create main application - app.js

varlodash=require('lodash');varoutput=lodash.without([1,2,3],1);console.log(output);

Download Node.js distribution

Diegos-iMac:myapp dgiagio$ curl -Lo node-v8.12.0-darwin-x64.tar.gz https://nodejs.org/dist/v8.12.0/node-v8.12.0-darwin-x64.tar.gz
Diegos-iMac:myapp dgiagio$ tar xvfz node-v8.12.0-darwin-x64.tar.gz

Install dependencies

Diegos-iMac:myapp dgiagio$ PATH=node-v8.12.0-darwin-x64/bin npm install lodash

Remove unneeded files

Diegos-iMac:myapp dgiagio$ rm -r node-v8.12.0-darwin-x64/include node-v8.12.0-darwin-x64/share node-v8.12.0-darwin-x64/lib
Diegos-iMac:myapp dgiagio$ rm node-v8.12.0-darwin-x64/bin/npm node-v8.12.0-darwin-x64/bin/npx

Create launcher script* - launch

#!/bin/sh
NODE_DIST=node-v8.12.0-darwin-x64
APP_MAIN_JS=app.js
DIR="$(cd "$(dirname "$0")";pwd -P)"
NODE_EXE=$DIR/$NODE_DIST/bin/node
NODE_PATH=$DIR/node_modules
APP_MAIN_JS_PATH=$DIR/$APP_MAIN_JSexec"$NODE_EXE""$APP_MAIN_JS_PATH"$@

Make the launcher script executable

Diegos-iMac:myapp dgiagio$ chmod +x launch

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

Diegos-iMac:myapp dgiagio$ cd ..
Diegos-iMac:Devel dgiagio$ curl -Lo warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/macos-x64.warp-packer
Diegos-iMac:Devel dgiagio$ chmod +x warp-packer

Create your self-contained application

Diegos-iMac:Devel dgiagio$ ./warp-packer --arch macos-x64 --input_dir myapp --exec launch --output myapp.bin
Diegos-iMac:Devel dgiagio$ chmod +x myapp.bin

Run your self-contained application

Diegos-iMac:Devel dgiagio$ ./myapp.bin
[ 2, 3 ]
Diegos-iMac:Devel dgiagio$

More information about your self-contained application

Diegos-iMac:Devel dgiagio$ file myapp.bin
myapp.bin: Mach-O 64-bit executable x86_64
Diegos-iMac:Devel dgiagio$ du -hs myapp.bin
26M myapp.bin

Windows

Create the directory for the application

PS C:\Users\Diego\Devel> mkdir myapp
PS C:\Users\Diego\Devel> cd myapp

Create main application - app.js

varlodash=require('lodash');varoutput=lodash.without([1,2,3],1);console.log(output);

Download Node.js distribution

PS C:\Users\Diego\Devel\myapp> curl https://nodejs.org/dist/v8.12.0/node-v8.12.0-win-x64.zip -OutFile node-v8.12.0-win-x64.zip
PS C:\Users\Diego\Devel\myapp>Expand-Archive .\node-v8.12.0-win-x64.zip -DestinationPath .\

Install dependencies

PS C:\Users\Diego\Devel\myapp> .\node-v8.12.0-win-x64\npm install lodash

Remove unneeded files

PS C:\Users\Diego\Devel\myapp> rmdir -Recurse .\node-v8.12.0-win-x64\node_modules\npm

Create launcher script* - launch.cmd

@ECHOOFFSETLOCALSET"NODE_DIST=node-v8.12.0-win-x64"SET"APP_MAIN_JS=app.js"SET"NODE_EXE=%~dp0\%NODE_DIST%\node.exe"SET"NODE_PATH=%~dp0\%NODE_DIST%\node_modules"SET"APP_MAIN_JS_PATH=%~dp0\%APP_MAIN_JS%"CALL%NODE_EXE%%APP_MAIN_JS_PATH%%*EXIT /B %ERRORLEVEL%

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

PS C:\Users\Diego\Devel\myapp> cd ..
PS C:\Users\Diego\Devel> [Net.ServicePointManager]::SecurityProtocol ="tls12, tls11, tls" ; Invoke-WebRequest https://github.com/dgiagio/warp/releases/download/v0.3.0/windows-x64.warp-packer.exe-OutFile warp-packer.exe

Create your self-contained application

PS C:\Users\Diego\Devel> .\warp-packer --arch windows-x64 --input_dir .\myapp\ --exec launch.cmd--output myapp.exe

Run your self-contained application

PS C:\Users\Diego\Devel> .\myapp.exe
[ 2,3 ]
PS C:\Users\Diego\Devel>

More information about your self-contained application

PS C:\Users\Diego\Devel>"{0:N2} MB"-f ((Get-Itemmyapp.exe).Length /1MB)
9.15 MB

Quickstart with .NET Core

Linux

Create a simple console application

dgiagio@X1:~/Devel$ mkdir myapp
dgiagio@X1:~/Devel$ cd myapp
dgiagio@X1:~/Devel/myapp$ dotnet new console
dgiagio@X1:~/Devel/myapp$ dotnet run
Hello World!
dgiagio@X1:~/Devel/myapp$

Publish the application with native installer for linux-x64 runtime

dgiagio@X1:~/Devel/myapp$ dotnet publish -c Release -r linux-x64

The application should be published to bin/Release/netcoreapp2.1/linux-x64/publish/

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

dgiagio@X1:~/Devel/myapp$ curl -Lo warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/linux-x64.warp-packer
dgiagio@X1:~/Devel/myapp$ chmod +x warp-packer

Create your self-contained application

dgiagio@X1:~/Devel/myapp$ ./warp-packer --arch linux-x64 --input_dir bin/Release/netcoreapp2.1/linux-x64/publish --exec myapp --output myapp
dgiagio@X1:~/Devel/myapp$ chmod +x myapp

Run your self-contained application

dgiagio@X1:~/Devel/myapp$ ./myapp
Hello World!
dgiagio@X1:~/Devel/myapp$

More information about your self-contained application

dgiagio@X1:~/Devel/myapp$ file myapp
myapp: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, BuildID[sha1]=13b12e71a63ca1de8537ad7e90c83241f9f87f6c, with debug_info, not stripped
dgiagio@X1:~/Devel/myapp$ du -hs myapp
34M myapp

macOS

Create a simple console application

Diegos-iMac:Devel dgiagio$ mkdir myapp
Diegos-iMac:Devel dgiagio$ cd myapp
Diegos-iMac:myapp dgiagio$ dotnet new console
Diegos-iMac:myapp dgiagio$ dotnet run
Hello World!
Diegos-iMac:myapp dgiagio$

Publish the application with native installer for osx-x64 runtime

Diegos-iMac:myapp dgiagio$ dotnet publish -c Release -r osx-x64

The application should be published to bin/Release/netcoreapp2.1/osx-x64/publish/

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

Diegos-iMac:myapp dgiagio$ curl -Lo warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/macos-x64.warp-packer
Diegos-iMac:myapp dgiagio$ chmod +x warp-packer

Create your self-contained application

Diegos-iMac:myapp dgiagio$ ./warp-packer --arch macos-x64 --input_dir bin/Release/netcoreapp2.1/osx-x64/publish --exec myapp --output myapp
Diegos-iMac:myapp dgiagio$ chmod +x myapp

Run your self-contained application

Diegos-iMac:myapp dgiagio$ ./myapp
Hello World!
Diegos-iMac:myapp dgiagio$

More information about your self-contained application

Diegos-iMac:myapp dgiagio$ file myapp
myapp: Mach-O 64-bit executable x86_64
Diegos-iMac:myapp dgiagio$ du -hs myapp
27M myapp

Windows

Create a simple console application

PS C:\Users\Diego\Devel> mkdir myapp
PS C:\Users\Diego\Devel> cd myapp
PS C:\Users\Diego\Devel\myapp> dotnet new console
PS C:\Users\Diego\Devel\myapp> dotnet run
Hello World!
PS C:\Users\Diego\Devel\myapp>

Publish the application with native installer for win10-x64 runtime

PS C:\Users\Diego\Devel\myapp> dotnet publish -c Release -r win10-x64

The application should be published to bin/Release/netcoreapp2.1/win10-x64/publish/

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

PS C:\Users\Diego\Devel\myapp> [Net.ServicePointManager]::SecurityProtocol ="tls12, tls11, tls" ; Invoke-WebRequest https://github.com/dgiagio/warp/releases/download/v0.3.0/windows-x64.warp-packer.exe-OutFile warp-packer.exe

Create your self-contained application

PS C:\Users\Diego\Devel\myapp> .\warp-packer --arch windows-x64 --input_dir bin/Release/netcoreapp2.1/win10-x64/publish --exec myapp.exe--output myapp.exe

Run your self-contained application

PS C:\Users\Diego\Devel\myapp> .\myapp.exe
Hello World!
PS C:\Users\Diego\Devel\myapp>

More information about your self-contained application

PS C:\Users\Diego\Devel\myapp>"{0:N2} MB"-f ((Get-Itemmyapp.exe).Length /1MB)
28.51 MB

Quickstart with Java

Linux

Create a Hello World application

Create HelloWorld.java:

// HelloWorld.javapublicfinalclassHelloWorld {
publicstaticvoidmain(finalString[] args) {
System.out.println("Hello, world. ");
}
}

Test that it works:

$ javac HelloWorld.java
$ java HelloWorld
Hello, world.

We need to bundle this as a .jar:

$ jar cvfe app.jar HelloWorld HelloWorld.class
added manifest
adding: HelloWorld.class(in = 428) (out= 290)(deflated 32%)
$ java -jar app.jar
Hello, world.

Download a JRE

There are prebuilt JREs over on AdoptOpenJDK.

Here we use JRE 8:

wget -N https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u202-b08/OpenJDK8U-jre_x64_linux_hotspot_8u202b08.tar.gz

Unpack it:

tar -xvf OpenJDK8U-jre_x64_linux_hotspot_8u202b08.tar.gz

Create a bundle

We need to create a folder containing: our compiled code, the JRE and a launch script.

mkdir bundle
cp -r ./jdk8u202-b08-jre ./bundle/jre
cp app.jar ./bundle/app.jar
touch bundle/run.sh
chmod +x ./bundle/run.sh 

Finally, we to write run.sh. This script will run our .jar using the bundled JRE.

Here are the contents of ./bundle/run.sh:

#!/usr/bin/env bash
HERE=${BASH_SOURCE%/*}"$HERE/jre/bin/java" -jar "$HERE/app.jar""$@"

Test the bundle:

$ ./bundle/run.sh Hello, world. 

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

$ wget -O warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/linux-x64.warp-packer
$ chmod +x ./warp-packer

Create your self-contained application

$ ./warp-packer --arch linux-x64 --input_dir bundle --exec run.sh --output app.bin
$ chmod +x app.bin

Run your self-contained application

$ ./app.bin Hello, world. 

How it works

Warp is a multi-platform tool written in Rust and is comprised of two programs: warp-runner and warp-packer.

The final self-contained single binary application consists of two parts: 1) runner and 2) the compressed target application executable and dependencies.

warp-runner is a stub application that knows how to find the compressed payload within its own binary, perform extraction to a local cache and execute the target application.

The extraction process only happens the first time the application is ran, or when the self-contained application binary is updated.

warp-packer is a CLI application that's used to create the self-contained application binary by downloading the matching warp-runner for the chosen platform, compressing the target application and its dependencies, and generating the final self-contained binary.

Performance

The performance characteristics of the generated self-contained application is roughly the same of original application, except for the first time it's ran as the target application and its dependencies have to be decompressed to a local cache.

Packages cache location

  • Linux: $HOME/.local/share/warp/packages
  • macOS: $HOME/Library/Application Support/warp/packages
  • Windows: %LOCALAPPDATA%\warp\packages

Runners cache location

  • Linux: $HOME/.local/share/warp/runners
  • macOS: $HOME/Library/Application Support/warp/runners
  • Windows: %LOCALAPPDATA%\warp\runners

Authors

  • Diego Giagio <diego@giagio.com>
  • Finter Mobility As

Icons

License

This project is licensed under the MIT License - see the LICENSE file for details

Who is Using Warp?

About

Create self-contained single binary applications

Resources

Stars

20 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
This repository was archived by the owner on Aug 20, 2026. It is now read-only.

Repository files navigation

Warp

dependabot

Build serverPlatformsBuild status
Github Actionslinux-latest, windows-latest, macos-latestBranch: develop warp
Github Actionslinux-latest, windows-latest, macos-latestBranch: master warp

This repository was forked fromdgiagio/warp because the original author stopped maintaining the project.

Warp lets you create self-contained single binary applications making it simpler and more ergonomic to deliver your application to your customers. A self-contained binary is specially convenient when the technology you use, such as Node.js, .NET Core, Java and others, contain many dependencies that must be shipped alongside your application.

Warp is written in Rust and is supported on Linux, Windows and macOS.

Table of Content

Quickstart with Node.js

Linux

Create the directory for the application

dgiagio@X1:~/Devel$ mkdir myapp
dgiagio@X1:~/Devel/myapp$ cd myapp

Create main application - app.js

varlodash=require('lodash');varoutput=lodash.without([1,2,3],1);console.log(output);

Download Node.js distribution

dgiagio@X1:~/Devel/myapp$ wget https://nodejs.org/dist/v8.12.0/node-v8.12.0-linux-x64.tar.xz
dgiagio@X1:~/Devel/myapp$ xz -dc node-v8.12.0-linux-x64.tar.xz | tar xvf -

Install dependencies

dgiagio@X1:~/Devel/myapp$ node-v8.12.0-linux-x64/bin/npm install lodash

Remove unneeded files

dgiagio@X1:~/Devel/myapp$ rm -r node-v8.12.0-linux-x64/include node-v8.12.0-linux-x64/share node-v8.12.0-linux-x64/lib
dgiagio@X1:~/Devel/myapp$ rm node-v8.12.0-linux-x64/bin/npm node-v8.12.0-linux-x64/bin/npx

Create launcher script - launch

#!/bin/sh
NODE_DIST=node-v8.12.0-linux-x64
APP_MAIN_JS=app.js
DIR="$(cd "$(dirname "$0")";pwd -P)"
NODE_EXE=$DIR/$NODE_DIST/bin/node
NODE_PATH=$DIR/node_modules
APP_MAIN_JS_PATH=$DIR/$APP_MAIN_JSexec$NODE_EXE$APP_MAIN_JS_PATH$@

Make the launcher script executable

dgiagio@X1:~/Devel/myapp$ chmod +x launch

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

dgiagio@X1:~/Devel/myapp$ cd ..
dgiagio@X1:~/Devel$ curl -Lo warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/linux-x64.warp-packer
dgiagio@X1:~/Devel$ chmod +x warp-packer

Create your self-contained application

dgiagio@X1:~/Devel$ ./warp-packer --arch linux-x64 --input_dir myapp --exec launch --output myapp.bin
dgiagio@X1:~/Devel$ chmod +x myapp.bin

Run your self-contained application

dgiagio@X1:~/Devel$ ./myapp.bin
[ 2, 3 ]
dgiagio@X1:~/Devel$

More information about your self-contained application

dgiagio@X1:~/Devel/myapp$ file myapp.bin
myapp.bin: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=aa53b01be2cde5e0b64450870b1af13b52d5cffb, with debug_info, not stripped
dgiagio@X1:~/Devel/myapp$ du -hs myapp.bin
17M myapp.bin

macOS

Create the directory for the application

Diegos-iMac:Devel dgiagio$ mkdir myapp
Diegos-iMac:Devel dgiagio$ cd myapp

Create main application - app.js

varlodash=require('lodash');varoutput=lodash.without([1,2,3],1);console.log(output);

Download Node.js distribution

Diegos-iMac:myapp dgiagio$ curl -Lo node-v8.12.0-darwin-x64.tar.gz https://nodejs.org/dist/v8.12.0/node-v8.12.0-darwin-x64.tar.gz
Diegos-iMac:myapp dgiagio$ tar xvfz node-v8.12.0-darwin-x64.tar.gz

Install dependencies

Diegos-iMac:myapp dgiagio$ PATH=node-v8.12.0-darwin-x64/bin npm install lodash

Remove unneeded files

Diegos-iMac:myapp dgiagio$ rm -r node-v8.12.0-darwin-x64/include node-v8.12.0-darwin-x64/share node-v8.12.0-darwin-x64/lib
Diegos-iMac:myapp dgiagio$ rm node-v8.12.0-darwin-x64/bin/npm node-v8.12.0-darwin-x64/bin/npx

Create launcher script* - launch

#!/bin/sh
NODE_DIST=node-v8.12.0-darwin-x64
APP_MAIN_JS=app.js
DIR="$(cd "$(dirname "$0")";pwd -P)"
NODE_EXE=$DIR/$NODE_DIST/bin/node
NODE_PATH=$DIR/node_modules
APP_MAIN_JS_PATH=$DIR/$APP_MAIN_JSexec"$NODE_EXE""$APP_MAIN_JS_PATH"$@

Make the launcher script executable

Diegos-iMac:myapp dgiagio$ chmod +x launch

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

Diegos-iMac:myapp dgiagio$ cd ..
Diegos-iMac:Devel dgiagio$ curl -Lo warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/macos-x64.warp-packer
Diegos-iMac:Devel dgiagio$ chmod +x warp-packer

Create your self-contained application

Diegos-iMac:Devel dgiagio$ ./warp-packer --arch macos-x64 --input_dir myapp --exec launch --output myapp.bin
Diegos-iMac:Devel dgiagio$ chmod +x myapp.bin

Run your self-contained application

Diegos-iMac:Devel dgiagio$ ./myapp.bin
[ 2, 3 ]
Diegos-iMac:Devel dgiagio$

More information about your self-contained application

Diegos-iMac:Devel dgiagio$ file myapp.bin
myapp.bin: Mach-O 64-bit executable x86_64
Diegos-iMac:Devel dgiagio$ du -hs myapp.bin
26M myapp.bin

Windows

Create the directory for the application

PS C:\Users\Diego\Devel> mkdir myapp
PS C:\Users\Diego\Devel> cd myapp

Create main application - app.js

varlodash=require('lodash');varoutput=lodash.without([1,2,3],1);console.log(output);

Download Node.js distribution

PS C:\Users\Diego\Devel\myapp> curl https://nodejs.org/dist/v8.12.0/node-v8.12.0-win-x64.zip -OutFile node-v8.12.0-win-x64.zip
PS C:\Users\Diego\Devel\myapp>Expand-Archive .\node-v8.12.0-win-x64.zip -DestinationPath .\

Install dependencies

PS C:\Users\Diego\Devel\myapp> .\node-v8.12.0-win-x64\npm install lodash

Remove unneeded files

PS C:\Users\Diego\Devel\myapp> rmdir -Recurse .\node-v8.12.0-win-x64\node_modules\npm

Create launcher script* - launch.cmd

@ECHOOFFSETLOCALSET"NODE_DIST=node-v8.12.0-win-x64"SET"APP_MAIN_JS=app.js"SET"NODE_EXE=%~dp0\%NODE_DIST%\node.exe"SET"NODE_PATH=%~dp0\%NODE_DIST%\node_modules"SET"APP_MAIN_JS_PATH=%~dp0\%APP_MAIN_JS%"CALL%NODE_EXE%%APP_MAIN_JS_PATH%%*EXIT /B %ERRORLEVEL%

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

PS C:\Users\Diego\Devel\myapp> cd ..
PS C:\Users\Diego\Devel> [Net.ServicePointManager]::SecurityProtocol ="tls12, tls11, tls" ; Invoke-WebRequest https://github.com/dgiagio/warp/releases/download/v0.3.0/windows-x64.warp-packer.exe-OutFile warp-packer.exe

Create your self-contained application

PS C:\Users\Diego\Devel> .\warp-packer --arch windows-x64 --input_dir .\myapp\ --exec launch.cmd--output myapp.exe

Run your self-contained application

PS C:\Users\Diego\Devel> .\myapp.exe
[ 2,3 ]
PS C:\Users\Diego\Devel>

More information about your self-contained application

PS C:\Users\Diego\Devel>"{0:N2} MB"-f ((Get-Itemmyapp.exe).Length /1MB)
9.15 MB

Quickstart with .NET Core

Linux

Create a simple console application

dgiagio@X1:~/Devel$ mkdir myapp
dgiagio@X1:~/Devel$ cd myapp
dgiagio@X1:~/Devel/myapp$ dotnet new console
dgiagio@X1:~/Devel/myapp$ dotnet run
Hello World!
dgiagio@X1:~/Devel/myapp$

Publish the application with native installer for linux-x64 runtime

dgiagio@X1:~/Devel/myapp$ dotnet publish -c Release -r linux-x64

The application should be published to bin/Release/netcoreapp2.1/linux-x64/publish/

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

dgiagio@X1:~/Devel/myapp$ curl -Lo warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/linux-x64.warp-packer
dgiagio@X1:~/Devel/myapp$ chmod +x warp-packer

Create your self-contained application

dgiagio@X1:~/Devel/myapp$ ./warp-packer --arch linux-x64 --input_dir bin/Release/netcoreapp2.1/linux-x64/publish --exec myapp --output myapp
dgiagio@X1:~/Devel/myapp$ chmod +x myapp

Run your self-contained application

dgiagio@X1:~/Devel/myapp$ ./myapp
Hello World!
dgiagio@X1:~/Devel/myapp$

More information about your self-contained application

dgiagio@X1:~/Devel/myapp$ file myapp
myapp: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, BuildID[sha1]=13b12e71a63ca1de8537ad7e90c83241f9f87f6c, with debug_info, not stripped
dgiagio@X1:~/Devel/myapp$ du -hs myapp
34M myapp

macOS

Create a simple console application

Diegos-iMac:Devel dgiagio$ mkdir myapp
Diegos-iMac:Devel dgiagio$ cd myapp
Diegos-iMac:myapp dgiagio$ dotnet new console
Diegos-iMac:myapp dgiagio$ dotnet run
Hello World!
Diegos-iMac:myapp dgiagio$

Publish the application with native installer for osx-x64 runtime

Diegos-iMac:myapp dgiagio$ dotnet publish -c Release -r osx-x64

The application should be published to bin/Release/netcoreapp2.1/osx-x64/publish/

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

Diegos-iMac:myapp dgiagio$ curl -Lo warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/macos-x64.warp-packer
Diegos-iMac:myapp dgiagio$ chmod +x warp-packer

Create your self-contained application

Diegos-iMac:myapp dgiagio$ ./warp-packer --arch macos-x64 --input_dir bin/Release/netcoreapp2.1/osx-x64/publish --exec myapp --output myapp
Diegos-iMac:myapp dgiagio$ chmod +x myapp

Run your self-contained application

Diegos-iMac:myapp dgiagio$ ./myapp
Hello World!
Diegos-iMac:myapp dgiagio$

More information about your self-contained application

Diegos-iMac:myapp dgiagio$ file myapp
myapp: Mach-O 64-bit executable x86_64
Diegos-iMac:myapp dgiagio$ du -hs myapp
27M myapp

Windows

Create a simple console application

PS C:\Users\Diego\Devel> mkdir myapp
PS C:\Users\Diego\Devel> cd myapp
PS C:\Users\Diego\Devel\myapp> dotnet new console
PS C:\Users\Diego\Devel\myapp> dotnet run
Hello World!
PS C:\Users\Diego\Devel\myapp>

Publish the application with native installer for win10-x64 runtime

PS C:\Users\Diego\Devel\myapp> dotnet publish -c Release -r win10-x64

The application should be published to bin/Release/netcoreapp2.1/win10-x64/publish/

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

PS C:\Users\Diego\Devel\myapp> [Net.ServicePointManager]::SecurityProtocol ="tls12, tls11, tls" ; Invoke-WebRequest https://github.com/dgiagio/warp/releases/download/v0.3.0/windows-x64.warp-packer.exe-OutFile warp-packer.exe

Create your self-contained application

PS C:\Users\Diego\Devel\myapp> .\warp-packer --arch windows-x64 --input_dir bin/Release/netcoreapp2.1/win10-x64/publish --exec myapp.exe--output myapp.exe

Run your self-contained application

PS C:\Users\Diego\Devel\myapp> .\myapp.exe
Hello World!
PS C:\Users\Diego\Devel\myapp>

More information about your self-contained application

PS C:\Users\Diego\Devel\myapp>"{0:N2} MB"-f ((Get-Itemmyapp.exe).Length /1MB)
28.51 MB

Quickstart with Java

Linux

Create a Hello World application

Create HelloWorld.java:

// HelloWorld.javapublicfinalclassHelloWorld {
publicstaticvoidmain(finalString[] args) {
System.out.println("Hello, world. ");
}
}

Test that it works:

$ javac HelloWorld.java
$ java HelloWorld
Hello, world.

We need to bundle this as a .jar:

$ jar cvfe app.jar HelloWorld HelloWorld.class
added manifest
adding: HelloWorld.class(in = 428) (out= 290)(deflated 32%)
$ java -jar app.jar
Hello, world.

Download a JRE

There are prebuilt JREs over on AdoptOpenJDK.

Here we use JRE 8:

wget -N https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u202-b08/OpenJDK8U-jre_x64_linux_hotspot_8u202b08.tar.gz

Unpack it:

tar -xvf OpenJDK8U-jre_x64_linux_hotspot_8u202b08.tar.gz

Create a bundle

We need to create a folder containing: our compiled code, the JRE and a launch script.

mkdir bundle
cp -r ./jdk8u202-b08-jre ./bundle/jre
cp app.jar ./bundle/app.jar
touch bundle/run.sh
chmod +x ./bundle/run.sh 

Finally, we to write run.sh. This script will run our .jar using the bundled JRE.

Here are the contents of ./bundle/run.sh:

#!/usr/bin/env bash
HERE=${BASH_SOURCE%/*}"$HERE/jre/bin/java" -jar "$HERE/app.jar""$@"

Test the bundle:

$ ./bundle/run.sh Hello, world. 

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

$ wget -O warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/linux-x64.warp-packer
$ chmod +x ./warp-packer

Create your self-contained application

$ ./warp-packer --arch linux-x64 --input_dir bundle --exec run.sh --output app.bin
$ chmod +x app.bin

Run your self-contained application

$ ./app.bin Hello, world. 

How it works

Warp is a multi-platform tool written in Rust and is comprised of two programs: warp-runner and warp-packer.

The final self-contained single binary application consists of two parts: 1) runner and 2) the compressed target application executable and dependencies.

warp-runner is a stub application that knows how to find the compressed payload within its own binary, perform extraction to a local cache and execute the target application.

The extraction process only happens the first time the application is ran, or when the self-contained application binary is updated.

warp-packer is a CLI application that's used to create the self-contained application binary by downloading the matching warp-runner for the chosen platform, compressing the target application and its dependencies, and generating the final self-contained binary.

Performance

The performance characteristics of the generated self-contained application is roughly the same of original application, except for the first time it's ran as the target application and its dependencies have to be decompressed to a local cache.

Packages cache location

  • Linux: $HOME/.local/share/warp/packages
  • macOS: $HOME/Library/Application Support/warp/packages
  • Windows: %LOCALAPPDATA%\warp\packages

Runners cache location

  • Linux: $HOME/.local/share/warp/runners
  • macOS: $HOME/Library/Application Support/warp/runners
  • Windows: %LOCALAPPDATA%\warp\runners

Authors

  • Diego Giagio <diego@giagio.com>
  • Finter Mobility As

Icons

License

This project is licensed under the MIT License - see the LICENSE file for details

Who is Using Warp?

About

Create self-contained single binary applications

Resources

Stars

20 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
This repository was archived by the owner on Aug 20, 2026. It is now read-only.

Repository files navigation

Warp

dependabot

Build serverPlatformsBuild status
Github Actionslinux-latest, windows-latest, macos-latestBranch: develop warp
Github Actionslinux-latest, windows-latest, macos-latestBranch: master warp

This repository was forked fromdgiagio/warp because the original author stopped maintaining the project.

Warp lets you create self-contained single binary applications making it simpler and more ergonomic to deliver your application to your customers. A self-contained binary is specially convenient when the technology you use, such as Node.js, .NET Core, Java and others, contain many dependencies that must be shipped alongside your application.

Warp is written in Rust and is supported on Linux, Windows and macOS.

Table of Content

Quickstart with Node.js

Linux

Create the directory for the application

dgiagio@X1:~/Devel$ mkdir myapp
dgiagio@X1:~/Devel/myapp$ cd myapp

Create main application - app.js

varlodash=require('lodash');varoutput=lodash.without([1,2,3],1);console.log(output);

Download Node.js distribution

dgiagio@X1:~/Devel/myapp$ wget https://nodejs.org/dist/v8.12.0/node-v8.12.0-linux-x64.tar.xz
dgiagio@X1:~/Devel/myapp$ xz -dc node-v8.12.0-linux-x64.tar.xz | tar xvf -

Install dependencies

dgiagio@X1:~/Devel/myapp$ node-v8.12.0-linux-x64/bin/npm install lodash

Remove unneeded files

dgiagio@X1:~/Devel/myapp$ rm -r node-v8.12.0-linux-x64/include node-v8.12.0-linux-x64/share node-v8.12.0-linux-x64/lib
dgiagio@X1:~/Devel/myapp$ rm node-v8.12.0-linux-x64/bin/npm node-v8.12.0-linux-x64/bin/npx

Create launcher script - launch

#!/bin/sh
NODE_DIST=node-v8.12.0-linux-x64
APP_MAIN_JS=app.js
DIR="$(cd "$(dirname "$0")";pwd -P)"
NODE_EXE=$DIR/$NODE_DIST/bin/node
NODE_PATH=$DIR/node_modules
APP_MAIN_JS_PATH=$DIR/$APP_MAIN_JSexec$NODE_EXE$APP_MAIN_JS_PATH$@

Make the launcher script executable

dgiagio@X1:~/Devel/myapp$ chmod +x launch

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

dgiagio@X1:~/Devel/myapp$ cd ..
dgiagio@X1:~/Devel$ curl -Lo warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/linux-x64.warp-packer
dgiagio@X1:~/Devel$ chmod +x warp-packer

Create your self-contained application

dgiagio@X1:~/Devel$ ./warp-packer --arch linux-x64 --input_dir myapp --exec launch --output myapp.bin
dgiagio@X1:~/Devel$ chmod +x myapp.bin

Run your self-contained application

dgiagio@X1:~/Devel$ ./myapp.bin
[ 2, 3 ]
dgiagio@X1:~/Devel$

More information about your self-contained application

dgiagio@X1:~/Devel/myapp$ file myapp.bin
myapp.bin: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=aa53b01be2cde5e0b64450870b1af13b52d5cffb, with debug_info, not stripped
dgiagio@X1:~/Devel/myapp$ du -hs myapp.bin
17M myapp.bin

macOS

Create the directory for the application

Diegos-iMac:Devel dgiagio$ mkdir myapp
Diegos-iMac:Devel dgiagio$ cd myapp

Create main application - app.js

varlodash=require('lodash');varoutput=lodash.without([1,2,3],1);console.log(output);

Download Node.js distribution

Diegos-iMac:myapp dgiagio$ curl -Lo node-v8.12.0-darwin-x64.tar.gz https://nodejs.org/dist/v8.12.0/node-v8.12.0-darwin-x64.tar.gz
Diegos-iMac:myapp dgiagio$ tar xvfz node-v8.12.0-darwin-x64.tar.gz

Install dependencies

Diegos-iMac:myapp dgiagio$ PATH=node-v8.12.0-darwin-x64/bin npm install lodash

Remove unneeded files

Diegos-iMac:myapp dgiagio$ rm -r node-v8.12.0-darwin-x64/include node-v8.12.0-darwin-x64/share node-v8.12.0-darwin-x64/lib
Diegos-iMac:myapp dgiagio$ rm node-v8.12.0-darwin-x64/bin/npm node-v8.12.0-darwin-x64/bin/npx

Create launcher script* - launch

#!/bin/sh
NODE_DIST=node-v8.12.0-darwin-x64
APP_MAIN_JS=app.js
DIR="$(cd "$(dirname "$0")";pwd -P)"
NODE_EXE=$DIR/$NODE_DIST/bin/node
NODE_PATH=$DIR/node_modules
APP_MAIN_JS_PATH=$DIR/$APP_MAIN_JSexec"$NODE_EXE""$APP_MAIN_JS_PATH"$@

Make the launcher script executable

Diegos-iMac:myapp dgiagio$ chmod +x launch

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

Diegos-iMac:myapp dgiagio$ cd ..
Diegos-iMac:Devel dgiagio$ curl -Lo warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/macos-x64.warp-packer
Diegos-iMac:Devel dgiagio$ chmod +x warp-packer

Create your self-contained application

Diegos-iMac:Devel dgiagio$ ./warp-packer --arch macos-x64 --input_dir myapp --exec launch --output myapp.bin
Diegos-iMac:Devel dgiagio$ chmod +x myapp.bin

Run your self-contained application

Diegos-iMac:Devel dgiagio$ ./myapp.bin
[ 2, 3 ]
Diegos-iMac:Devel dgiagio$

More information about your self-contained application

Diegos-iMac:Devel dgiagio$ file myapp.bin
myapp.bin: Mach-O 64-bit executable x86_64
Diegos-iMac:Devel dgiagio$ du -hs myapp.bin
26M myapp.bin

Windows

Create the directory for the application

PS C:\Users\Diego\Devel> mkdir myapp
PS C:\Users\Diego\Devel> cd myapp

Create main application - app.js

varlodash=require('lodash');varoutput=lodash.without([1,2,3],1);console.log(output);

Download Node.js distribution

PS C:\Users\Diego\Devel\myapp> curl https://nodejs.org/dist/v8.12.0/node-v8.12.0-win-x64.zip -OutFile node-v8.12.0-win-x64.zip
PS C:\Users\Diego\Devel\myapp>Expand-Archive .\node-v8.12.0-win-x64.zip -DestinationPath .\

Install dependencies

PS C:\Users\Diego\Devel\myapp> .\node-v8.12.0-win-x64\npm install lodash

Remove unneeded files

PS C:\Users\Diego\Devel\myapp> rmdir -Recurse .\node-v8.12.0-win-x64\node_modules\npm

Create launcher script* - launch.cmd

@ECHOOFFSETLOCALSET"NODE_DIST=node-v8.12.0-win-x64"SET"APP_MAIN_JS=app.js"SET"NODE_EXE=%~dp0\%NODE_DIST%\node.exe"SET"NODE_PATH=%~dp0\%NODE_DIST%\node_modules"SET"APP_MAIN_JS_PATH=%~dp0\%APP_MAIN_JS%"CALL%NODE_EXE%%APP_MAIN_JS_PATH%%*EXIT /B %ERRORLEVEL%

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

PS C:\Users\Diego\Devel\myapp> cd ..
PS C:\Users\Diego\Devel> [Net.ServicePointManager]::SecurityProtocol ="tls12, tls11, tls" ; Invoke-WebRequest https://github.com/dgiagio/warp/releases/download/v0.3.0/windows-x64.warp-packer.exe-OutFile warp-packer.exe

Create your self-contained application

PS C:\Users\Diego\Devel> .\warp-packer --arch windows-x64 --input_dir .\myapp\ --exec launch.cmd--output myapp.exe

Run your self-contained application

PS C:\Users\Diego\Devel> .\myapp.exe
[ 2,3 ]
PS C:\Users\Diego\Devel>

More information about your self-contained application

PS C:\Users\Diego\Devel>"{0:N2} MB"-f ((Get-Itemmyapp.exe).Length /1MB)
9.15 MB

Quickstart with .NET Core

Linux

Create a simple console application

dgiagio@X1:~/Devel$ mkdir myapp
dgiagio@X1:~/Devel$ cd myapp
dgiagio@X1:~/Devel/myapp$ dotnet new console
dgiagio@X1:~/Devel/myapp$ dotnet run
Hello World!
dgiagio@X1:~/Devel/myapp$

Publish the application with native installer for linux-x64 runtime

dgiagio@X1:~/Devel/myapp$ dotnet publish -c Release -r linux-x64

The application should be published to bin/Release/netcoreapp2.1/linux-x64/publish/

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

dgiagio@X1:~/Devel/myapp$ curl -Lo warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/linux-x64.warp-packer
dgiagio@X1:~/Devel/myapp$ chmod +x warp-packer

Create your self-contained application

dgiagio@X1:~/Devel/myapp$ ./warp-packer --arch linux-x64 --input_dir bin/Release/netcoreapp2.1/linux-x64/publish --exec myapp --output myapp
dgiagio@X1:~/Devel/myapp$ chmod +x myapp

Run your self-contained application

dgiagio@X1:~/Devel/myapp$ ./myapp
Hello World!
dgiagio@X1:~/Devel/myapp$

More information about your self-contained application

dgiagio@X1:~/Devel/myapp$ file myapp
myapp: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, BuildID[sha1]=13b12e71a63ca1de8537ad7e90c83241f9f87f6c, with debug_info, not stripped
dgiagio@X1:~/Devel/myapp$ du -hs myapp
34M myapp

macOS

Create a simple console application

Diegos-iMac:Devel dgiagio$ mkdir myapp
Diegos-iMac:Devel dgiagio$ cd myapp
Diegos-iMac:myapp dgiagio$ dotnet new console
Diegos-iMac:myapp dgiagio$ dotnet run
Hello World!
Diegos-iMac:myapp dgiagio$

Publish the application with native installer for osx-x64 runtime

Diegos-iMac:myapp dgiagio$ dotnet publish -c Release -r osx-x64

The application should be published to bin/Release/netcoreapp2.1/osx-x64/publish/

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

Diegos-iMac:myapp dgiagio$ curl -Lo warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/macos-x64.warp-packer
Diegos-iMac:myapp dgiagio$ chmod +x warp-packer

Create your self-contained application

Diegos-iMac:myapp dgiagio$ ./warp-packer --arch macos-x64 --input_dir bin/Release/netcoreapp2.1/osx-x64/publish --exec myapp --output myapp
Diegos-iMac:myapp dgiagio$ chmod +x myapp

Run your self-contained application

Diegos-iMac:myapp dgiagio$ ./myapp
Hello World!
Diegos-iMac:myapp dgiagio$

More information about your self-contained application

Diegos-iMac:myapp dgiagio$ file myapp
myapp: Mach-O 64-bit executable x86_64
Diegos-iMac:myapp dgiagio$ du -hs myapp
27M myapp

Windows

Create a simple console application

PS C:\Users\Diego\Devel> mkdir myapp
PS C:\Users\Diego\Devel> cd myapp
PS C:\Users\Diego\Devel\myapp> dotnet new console
PS C:\Users\Diego\Devel\myapp> dotnet run
Hello World!
PS C:\Users\Diego\Devel\myapp>

Publish the application with native installer for win10-x64 runtime

PS C:\Users\Diego\Devel\myapp> dotnet publish -c Release -r win10-x64

The application should be published to bin/Release/netcoreapp2.1/win10-x64/publish/

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

PS C:\Users\Diego\Devel\myapp> [Net.ServicePointManager]::SecurityProtocol ="tls12, tls11, tls" ; Invoke-WebRequest https://github.com/dgiagio/warp/releases/download/v0.3.0/windows-x64.warp-packer.exe-OutFile warp-packer.exe

Create your self-contained application

PS C:\Users\Diego\Devel\myapp> .\warp-packer --arch windows-x64 --input_dir bin/Release/netcoreapp2.1/win10-x64/publish --exec myapp.exe--output myapp.exe

Run your self-contained application

PS C:\Users\Diego\Devel\myapp> .\myapp.exe
Hello World!
PS C:\Users\Diego\Devel\myapp>

More information about your self-contained application

PS C:\Users\Diego\Devel\myapp>"{0:N2} MB"-f ((Get-Itemmyapp.exe).Length /1MB)
28.51 MB

Quickstart with Java

Linux

Create a Hello World application

Create HelloWorld.java:

// HelloWorld.javapublicfinalclassHelloWorld {
publicstaticvoidmain(finalString[] args) {
System.out.println("Hello, world. ");
}
}

Test that it works:

$ javac HelloWorld.java
$ java HelloWorld
Hello, world.

We need to bundle this as a .jar:

$ jar cvfe app.jar HelloWorld HelloWorld.class
added manifest
adding: HelloWorld.class(in = 428) (out= 290)(deflated 32%)
$ java -jar app.jar
Hello, world.

Download a JRE

There are prebuilt JREs over on AdoptOpenJDK.

Here we use JRE 8:

wget -N https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u202-b08/OpenJDK8U-jre_x64_linux_hotspot_8u202b08.tar.gz

Unpack it:

tar -xvf OpenJDK8U-jre_x64_linux_hotspot_8u202b08.tar.gz

Create a bundle

We need to create a folder containing: our compiled code, the JRE and a launch script.

mkdir bundle
cp -r ./jdk8u202-b08-jre ./bundle/jre
cp app.jar ./bundle/app.jar
touch bundle/run.sh
chmod +x ./bundle/run.sh 

Finally, we to write run.sh. This script will run our .jar using the bundled JRE.

Here are the contents of ./bundle/run.sh:

#!/usr/bin/env bash
HERE=${BASH_SOURCE%/*}"$HERE/jre/bin/java" -jar "$HERE/app.jar""$@"

Test the bundle:

$ ./bundle/run.sh Hello, world. 

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

$ wget -O warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/linux-x64.warp-packer
$ chmod +x ./warp-packer

Create your self-contained application

$ ./warp-packer --arch linux-x64 --input_dir bundle --exec run.sh --output app.bin
$ chmod +x app.bin

Run your self-contained application

$ ./app.bin Hello, world. 

How it works

Warp is a multi-platform tool written in Rust and is comprised of two programs: warp-runner and warp-packer.

The final self-contained single binary application consists of two parts: 1) runner and 2) the compressed target application executable and dependencies.

warp-runner is a stub application that knows how to find the compressed payload within its own binary, perform extraction to a local cache and execute the target application.

The extraction process only happens the first time the application is ran, or when the self-contained application binary is updated.

warp-packer is a CLI application that's used to create the self-contained application binary by downloading the matching warp-runner for the chosen platform, compressing the target application and its dependencies, and generating the final self-contained binary.

Performance

The performance characteristics of the generated self-contained application is roughly the same of original application, except for the first time it's ran as the target application and its dependencies have to be decompressed to a local cache.

Packages cache location

  • Linux: $HOME/.local/share/warp/packages
  • macOS: $HOME/Library/Application Support/warp/packages
  • Windows: %LOCALAPPDATA%\warp\packages

Runners cache location

  • Linux: $HOME/.local/share/warp/runners
  • macOS: $HOME/Library/Application Support/warp/runners
  • Windows: %LOCALAPPDATA%\warp\runners

Authors

  • Diego Giagio <diego@giagio.com>
  • Finter Mobility As

Icons

License

This project is licensed under the MIT License - see the LICENSE file for details

Who is Using Warp?

About

Create self-contained single binary applications

Resources

Stars

20 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content
This repository was archived by the owner on Aug 20, 2026. It is now read-only.

Repository files navigation

Warp

dependabot

Build serverPlatformsBuild status
Github Actionslinux-latest, windows-latest, macos-latestBranch: develop warp
Github Actionslinux-latest, windows-latest, macos-latestBranch: master warp

This repository was forked fromdgiagio/warp because the original author stopped maintaining the project.

Warp lets you create self-contained single binary applications making it simpler and more ergonomic to deliver your application to your customers. A self-contained binary is specially convenient when the technology you use, such as Node.js, .NET Core, Java and others, contain many dependencies that must be shipped alongside your application.

Warp is written in Rust and is supported on Linux, Windows and macOS.

Table of Content

Quickstart with Node.js

Linux

Create the directory for the application

dgiagio@X1:~/Devel$ mkdir myapp
dgiagio@X1:~/Devel/myapp$ cd myapp

Create main application - app.js

varlodash=require('lodash');varoutput=lodash.without([1,2,3],1);console.log(output);

Download Node.js distribution

dgiagio@X1:~/Devel/myapp$ wget https://nodejs.org/dist/v8.12.0/node-v8.12.0-linux-x64.tar.xz
dgiagio@X1:~/Devel/myapp$ xz -dc node-v8.12.0-linux-x64.tar.xz | tar xvf -

Install dependencies

dgiagio@X1:~/Devel/myapp$ node-v8.12.0-linux-x64/bin/npm install lodash

Remove unneeded files

dgiagio@X1:~/Devel/myapp$ rm -r node-v8.12.0-linux-x64/include node-v8.12.0-linux-x64/share node-v8.12.0-linux-x64/lib
dgiagio@X1:~/Devel/myapp$ rm node-v8.12.0-linux-x64/bin/npm node-v8.12.0-linux-x64/bin/npx

Create launcher script - launch

#!/bin/sh
NODE_DIST=node-v8.12.0-linux-x64
APP_MAIN_JS=app.js
DIR="$(cd "$(dirname "$0")";pwd -P)"
NODE_EXE=$DIR/$NODE_DIST/bin/node
NODE_PATH=$DIR/node_modules
APP_MAIN_JS_PATH=$DIR/$APP_MAIN_JSexec$NODE_EXE$APP_MAIN_JS_PATH$@

Make the launcher script executable

dgiagio@X1:~/Devel/myapp$ chmod +x launch

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

dgiagio@X1:~/Devel/myapp$ cd ..
dgiagio@X1:~/Devel$ curl -Lo warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/linux-x64.warp-packer
dgiagio@X1:~/Devel$ chmod +x warp-packer

Create your self-contained application

dgiagio@X1:~/Devel$ ./warp-packer --arch linux-x64 --input_dir myapp --exec launch --output myapp.bin
dgiagio@X1:~/Devel$ chmod +x myapp.bin

Run your self-contained application

dgiagio@X1:~/Devel$ ./myapp.bin
[ 2, 3 ]
dgiagio@X1:~/Devel$

More information about your self-contained application

dgiagio@X1:~/Devel/myapp$ file myapp.bin
myapp.bin: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=aa53b01be2cde5e0b64450870b1af13b52d5cffb, with debug_info, not stripped
dgiagio@X1:~/Devel/myapp$ du -hs myapp.bin
17M myapp.bin

macOS

Create the directory for the application

Diegos-iMac:Devel dgiagio$ mkdir myapp
Diegos-iMac:Devel dgiagio$ cd myapp

Create main application - app.js

varlodash=require('lodash');varoutput=lodash.without([1,2,3],1);console.log(output);

Download Node.js distribution

Diegos-iMac:myapp dgiagio$ curl -Lo node-v8.12.0-darwin-x64.tar.gz https://nodejs.org/dist/v8.12.0/node-v8.12.0-darwin-x64.tar.gz
Diegos-iMac:myapp dgiagio$ tar xvfz node-v8.12.0-darwin-x64.tar.gz

Install dependencies

Diegos-iMac:myapp dgiagio$ PATH=node-v8.12.0-darwin-x64/bin npm install lodash

Remove unneeded files

Diegos-iMac:myapp dgiagio$ rm -r node-v8.12.0-darwin-x64/include node-v8.12.0-darwin-x64/share node-v8.12.0-darwin-x64/lib
Diegos-iMac:myapp dgiagio$ rm node-v8.12.0-darwin-x64/bin/npm node-v8.12.0-darwin-x64/bin/npx

Create launcher script* - launch

#!/bin/sh
NODE_DIST=node-v8.12.0-darwin-x64
APP_MAIN_JS=app.js
DIR="$(cd "$(dirname "$0")";pwd -P)"
NODE_EXE=$DIR/$NODE_DIST/bin/node
NODE_PATH=$DIR/node_modules
APP_MAIN_JS_PATH=$DIR/$APP_MAIN_JSexec"$NODE_EXE""$APP_MAIN_JS_PATH"$@

Make the launcher script executable

Diegos-iMac:myapp dgiagio$ chmod +x launch

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

Diegos-iMac:myapp dgiagio$ cd ..
Diegos-iMac:Devel dgiagio$ curl -Lo warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/macos-x64.warp-packer
Diegos-iMac:Devel dgiagio$ chmod +x warp-packer

Create your self-contained application

Diegos-iMac:Devel dgiagio$ ./warp-packer --arch macos-x64 --input_dir myapp --exec launch --output myapp.bin
Diegos-iMac:Devel dgiagio$ chmod +x myapp.bin

Run your self-contained application

Diegos-iMac:Devel dgiagio$ ./myapp.bin
[ 2, 3 ]
Diegos-iMac:Devel dgiagio$

More information about your self-contained application

Diegos-iMac:Devel dgiagio$ file myapp.bin
myapp.bin: Mach-O 64-bit executable x86_64
Diegos-iMac:Devel dgiagio$ du -hs myapp.bin
26M myapp.bin

Windows

Create the directory for the application

PS C:\Users\Diego\Devel> mkdir myapp
PS C:\Users\Diego\Devel> cd myapp

Create main application - app.js

varlodash=require('lodash');varoutput=lodash.without([1,2,3],1);console.log(output);

Download Node.js distribution

PS C:\Users\Diego\Devel\myapp> curl https://nodejs.org/dist/v8.12.0/node-v8.12.0-win-x64.zip -OutFile node-v8.12.0-win-x64.zip
PS C:\Users\Diego\Devel\myapp>Expand-Archive .\node-v8.12.0-win-x64.zip -DestinationPath .\

Install dependencies

PS C:\Users\Diego\Devel\myapp> .\node-v8.12.0-win-x64\npm install lodash

Remove unneeded files

PS C:\Users\Diego\Devel\myapp> rmdir -Recurse .\node-v8.12.0-win-x64\node_modules\npm

Create launcher script* - launch.cmd

@ECHOOFFSETLOCALSET"NODE_DIST=node-v8.12.0-win-x64"SET"APP_MAIN_JS=app.js"SET"NODE_EXE=%~dp0\%NODE_DIST%\node.exe"SET"NODE_PATH=%~dp0\%NODE_DIST%\node_modules"SET"APP_MAIN_JS_PATH=%~dp0\%APP_MAIN_JS%"CALL%NODE_EXE%%APP_MAIN_JS_PATH%%*EXIT /B %ERRORLEVEL%

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

PS C:\Users\Diego\Devel\myapp> cd ..
PS C:\Users\Diego\Devel> [Net.ServicePointManager]::SecurityProtocol ="tls12, tls11, tls" ; Invoke-WebRequest https://github.com/dgiagio/warp/releases/download/v0.3.0/windows-x64.warp-packer.exe-OutFile warp-packer.exe

Create your self-contained application

PS C:\Users\Diego\Devel> .\warp-packer --arch windows-x64 --input_dir .\myapp\ --exec launch.cmd--output myapp.exe

Run your self-contained application

PS C:\Users\Diego\Devel> .\myapp.exe
[ 2,3 ]
PS C:\Users\Diego\Devel>

More information about your self-contained application

PS C:\Users\Diego\Devel>"{0:N2} MB"-f ((Get-Itemmyapp.exe).Length /1MB)
9.15 MB

Quickstart with .NET Core

Linux

Create a simple console application

dgiagio@X1:~/Devel$ mkdir myapp
dgiagio@X1:~/Devel$ cd myapp
dgiagio@X1:~/Devel/myapp$ dotnet new console
dgiagio@X1:~/Devel/myapp$ dotnet run
Hello World!
dgiagio@X1:~/Devel/myapp$

Publish the application with native installer for linux-x64 runtime

dgiagio@X1:~/Devel/myapp$ dotnet publish -c Release -r linux-x64

The application should be published to bin/Release/netcoreapp2.1/linux-x64/publish/

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

dgiagio@X1:~/Devel/myapp$ curl -Lo warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/linux-x64.warp-packer
dgiagio@X1:~/Devel/myapp$ chmod +x warp-packer

Create your self-contained application

dgiagio@X1:~/Devel/myapp$ ./warp-packer --arch linux-x64 --input_dir bin/Release/netcoreapp2.1/linux-x64/publish --exec myapp --output myapp
dgiagio@X1:~/Devel/myapp$ chmod +x myapp

Run your self-contained application

dgiagio@X1:~/Devel/myapp$ ./myapp
Hello World!
dgiagio@X1:~/Devel/myapp$

More information about your self-contained application

dgiagio@X1:~/Devel/myapp$ file myapp
myapp: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, BuildID[sha1]=13b12e71a63ca1de8537ad7e90c83241f9f87f6c, with debug_info, not stripped
dgiagio@X1:~/Devel/myapp$ du -hs myapp
34M myapp

macOS

Create a simple console application

Diegos-iMac:Devel dgiagio$ mkdir myapp
Diegos-iMac:Devel dgiagio$ cd myapp
Diegos-iMac:myapp dgiagio$ dotnet new console
Diegos-iMac:myapp dgiagio$ dotnet run
Hello World!
Diegos-iMac:myapp dgiagio$

Publish the application with native installer for osx-x64 runtime

Diegos-iMac:myapp dgiagio$ dotnet publish -c Release -r osx-x64

The application should be published to bin/Release/netcoreapp2.1/osx-x64/publish/

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

Diegos-iMac:myapp dgiagio$ curl -Lo warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/macos-x64.warp-packer
Diegos-iMac:myapp dgiagio$ chmod +x warp-packer

Create your self-contained application

Diegos-iMac:myapp dgiagio$ ./warp-packer --arch macos-x64 --input_dir bin/Release/netcoreapp2.1/osx-x64/publish --exec myapp --output myapp
Diegos-iMac:myapp dgiagio$ chmod +x myapp

Run your self-contained application

Diegos-iMac:myapp dgiagio$ ./myapp
Hello World!
Diegos-iMac:myapp dgiagio$

More information about your self-contained application

Diegos-iMac:myapp dgiagio$ file myapp
myapp: Mach-O 64-bit executable x86_64
Diegos-iMac:myapp dgiagio$ du -hs myapp
27M myapp

Windows

Create a simple console application

PS C:\Users\Diego\Devel> mkdir myapp
PS C:\Users\Diego\Devel> cd myapp
PS C:\Users\Diego\Devel\myapp> dotnet new console
PS C:\Users\Diego\Devel\myapp> dotnet run
Hello World!
PS C:\Users\Diego\Devel\myapp>

Publish the application with native installer for win10-x64 runtime

PS C:\Users\Diego\Devel\myapp> dotnet publish -c Release -r win10-x64

The application should be published to bin/Release/netcoreapp2.1/win10-x64/publish/

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

PS C:\Users\Diego\Devel\myapp> [Net.ServicePointManager]::SecurityProtocol ="tls12, tls11, tls" ; Invoke-WebRequest https://github.com/dgiagio/warp/releases/download/v0.3.0/windows-x64.warp-packer.exe-OutFile warp-packer.exe

Create your self-contained application

PS C:\Users\Diego\Devel\myapp> .\warp-packer --arch windows-x64 --input_dir bin/Release/netcoreapp2.1/win10-x64/publish --exec myapp.exe--output myapp.exe

Run your self-contained application

PS C:\Users\Diego\Devel\myapp> .\myapp.exe
Hello World!
PS C:\Users\Diego\Devel\myapp>

More information about your self-contained application

PS C:\Users\Diego\Devel\myapp>"{0:N2} MB"-f ((Get-Itemmyapp.exe).Length /1MB)
28.51 MB

Quickstart with Java

Linux

Create a Hello World application

Create HelloWorld.java:

// HelloWorld.javapublicfinalclassHelloWorld {
publicstaticvoidmain(finalString[] args) {
System.out.println("Hello, world. ");
}
}

Test that it works:

$ javac HelloWorld.java
$ java HelloWorld
Hello, world.

We need to bundle this as a .jar:

$ jar cvfe app.jar HelloWorld HelloWorld.class
added manifest
adding: HelloWorld.class(in = 428) (out= 290)(deflated 32%)
$ java -jar app.jar
Hello, world.

Download a JRE

There are prebuilt JREs over on AdoptOpenJDK.

Here we use JRE 8:

wget -N https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u202-b08/OpenJDK8U-jre_x64_linux_hotspot_8u202b08.tar.gz

Unpack it:

tar -xvf OpenJDK8U-jre_x64_linux_hotspot_8u202b08.tar.gz

Create a bundle

We need to create a folder containing: our compiled code, the JRE and a launch script.

mkdir bundle
cp -r ./jdk8u202-b08-jre ./bundle/jre
cp app.jar ./bundle/app.jar
touch bundle/run.sh
chmod +x ./bundle/run.sh 

Finally, we to write run.sh. This script will run our .jar using the bundled JRE.

Here are the contents of ./bundle/run.sh:

#!/usr/bin/env bash
HERE=${BASH_SOURCE%/*}"$HERE/jre/bin/java" -jar "$HERE/app.jar""$@"

Test the bundle:

$ ./bundle/run.sh Hello, world. 

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

$ wget -O warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/linux-x64.warp-packer
$ chmod +x ./warp-packer

Create your self-contained application

$ ./warp-packer --arch linux-x64 --input_dir bundle --exec run.sh --output app.bin
$ chmod +x app.bin

Run your self-contained application

$ ./app.bin Hello, world. 

How it works

Warp is a multi-platform tool written in Rust and is comprised of two programs: warp-runner and warp-packer.

The final self-contained single binary application consists of two parts: 1) runner and 2) the compressed target application executable and dependencies.

warp-runner is a stub application that knows how to find the compressed payload within its own binary, perform extraction to a local cache and execute the target application.

The extraction process only happens the first time the application is ran, or when the self-contained application binary is updated.

warp-packer is a CLI application that's used to create the self-contained application binary by downloading the matching warp-runner for the chosen platform, compressing the target application and its dependencies, and generating the final self-contained binary.

Performance

The performance characteristics of the generated self-contained application is roughly the same of original application, except for the first time it's ran as the target application and its dependencies have to be decompressed to a local cache.

Packages cache location

  • Linux: $HOME/.local/share/warp/packages
  • macOS: $HOME/Library/Application Support/warp/packages
  • Windows: %LOCALAPPDATA%\warp\packages

Runners cache location

  • Linux: $HOME/.local/share/warp/runners
  • macOS: $HOME/Library/Application Support/warp/runners
  • Windows: %LOCALAPPDATA%\warp\runners

Authors

  • Diego Giagio <diego@giagio.com>
  • Finter Mobility As

Icons

License

This project is licensed under the MIT License - see the LICENSE file for details

Who is Using Warp?

About

Create self-contained single binary applications

Resources

Stars

20 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
This repository was archived by the owner on Aug 20, 2026. It is now read-only.

Repository files navigation

Warp

dependabot

Build serverPlatformsBuild status
Github Actionslinux-latest, windows-latest, macos-latestBranch: develop warp
Github Actionslinux-latest, windows-latest, macos-latestBranch: master warp

This repository was forked fromdgiagio/warp because the original author stopped maintaining the project.

Warp lets you create self-contained single binary applications making it simpler and more ergonomic to deliver your application to your customers. A self-contained binary is specially convenient when the technology you use, such as Node.js, .NET Core, Java and others, contain many dependencies that must be shipped alongside your application.

Warp is written in Rust and is supported on Linux, Windows and macOS.

Table of Content

Quickstart with Node.js

Linux

Create the directory for the application

dgiagio@X1:~/Devel$ mkdir myapp
dgiagio@X1:~/Devel/myapp$ cd myapp

Create main application - app.js

varlodash=require('lodash');varoutput=lodash.without([1,2,3],1);console.log(output);

Download Node.js distribution

dgiagio@X1:~/Devel/myapp$ wget https://nodejs.org/dist/v8.12.0/node-v8.12.0-linux-x64.tar.xz
dgiagio@X1:~/Devel/myapp$ xz -dc node-v8.12.0-linux-x64.tar.xz | tar xvf -

Install dependencies

dgiagio@X1:~/Devel/myapp$ node-v8.12.0-linux-x64/bin/npm install lodash

Remove unneeded files

dgiagio@X1:~/Devel/myapp$ rm -r node-v8.12.0-linux-x64/include node-v8.12.0-linux-x64/share node-v8.12.0-linux-x64/lib
dgiagio@X1:~/Devel/myapp$ rm node-v8.12.0-linux-x64/bin/npm node-v8.12.0-linux-x64/bin/npx

Create launcher script - launch

#!/bin/sh
NODE_DIST=node-v8.12.0-linux-x64
APP_MAIN_JS=app.js
DIR="$(cd "$(dirname "$0")";pwd -P)"
NODE_EXE=$DIR/$NODE_DIST/bin/node
NODE_PATH=$DIR/node_modules
APP_MAIN_JS_PATH=$DIR/$APP_MAIN_JSexec$NODE_EXE$APP_MAIN_JS_PATH$@

Make the launcher script executable

dgiagio@X1:~/Devel/myapp$ chmod +x launch

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

dgiagio@X1:~/Devel/myapp$ cd ..
dgiagio@X1:~/Devel$ curl -Lo warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/linux-x64.warp-packer
dgiagio@X1:~/Devel$ chmod +x warp-packer

Create your self-contained application

dgiagio@X1:~/Devel$ ./warp-packer --arch linux-x64 --input_dir myapp --exec launch --output myapp.bin
dgiagio@X1:~/Devel$ chmod +x myapp.bin

Run your self-contained application

dgiagio@X1:~/Devel$ ./myapp.bin
[ 2, 3 ]
dgiagio@X1:~/Devel$

More information about your self-contained application

dgiagio@X1:~/Devel/myapp$ file myapp.bin
myapp.bin: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=aa53b01be2cde5e0b64450870b1af13b52d5cffb, with debug_info, not stripped
dgiagio@X1:~/Devel/myapp$ du -hs myapp.bin
17M myapp.bin

macOS

Create the directory for the application

Diegos-iMac:Devel dgiagio$ mkdir myapp
Diegos-iMac:Devel dgiagio$ cd myapp

Create main application - app.js

varlodash=require('lodash');varoutput=lodash.without([1,2,3],1);console.log(output);

Download Node.js distribution

Diegos-iMac:myapp dgiagio$ curl -Lo node-v8.12.0-darwin-x64.tar.gz https://nodejs.org/dist/v8.12.0/node-v8.12.0-darwin-x64.tar.gz
Diegos-iMac:myapp dgiagio$ tar xvfz node-v8.12.0-darwin-x64.tar.gz

Install dependencies

Diegos-iMac:myapp dgiagio$ PATH=node-v8.12.0-darwin-x64/bin npm install lodash

Remove unneeded files

Diegos-iMac:myapp dgiagio$ rm -r node-v8.12.0-darwin-x64/include node-v8.12.0-darwin-x64/share node-v8.12.0-darwin-x64/lib
Diegos-iMac:myapp dgiagio$ rm node-v8.12.0-darwin-x64/bin/npm node-v8.12.0-darwin-x64/bin/npx

Create launcher script* - launch

#!/bin/sh
NODE_DIST=node-v8.12.0-darwin-x64
APP_MAIN_JS=app.js
DIR="$(cd "$(dirname "$0")";pwd -P)"
NODE_EXE=$DIR/$NODE_DIST/bin/node
NODE_PATH=$DIR/node_modules
APP_MAIN_JS_PATH=$DIR/$APP_MAIN_JSexec"$NODE_EXE""$APP_MAIN_JS_PATH"$@

Make the launcher script executable

Diegos-iMac:myapp dgiagio$ chmod +x launch

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

Diegos-iMac:myapp dgiagio$ cd ..
Diegos-iMac:Devel dgiagio$ curl -Lo warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/macos-x64.warp-packer
Diegos-iMac:Devel dgiagio$ chmod +x warp-packer

Create your self-contained application

Diegos-iMac:Devel dgiagio$ ./warp-packer --arch macos-x64 --input_dir myapp --exec launch --output myapp.bin
Diegos-iMac:Devel dgiagio$ chmod +x myapp.bin

Run your self-contained application

Diegos-iMac:Devel dgiagio$ ./myapp.bin
[ 2, 3 ]
Diegos-iMac:Devel dgiagio$

More information about your self-contained application

Diegos-iMac:Devel dgiagio$ file myapp.bin
myapp.bin: Mach-O 64-bit executable x86_64
Diegos-iMac:Devel dgiagio$ du -hs myapp.bin
26M myapp.bin

Windows

Create the directory for the application

PS C:\Users\Diego\Devel> mkdir myapp
PS C:\Users\Diego\Devel> cd myapp

Create main application - app.js

varlodash=require('lodash');varoutput=lodash.without([1,2,3],1);console.log(output);

Download Node.js distribution

PS C:\Users\Diego\Devel\myapp> curl https://nodejs.org/dist/v8.12.0/node-v8.12.0-win-x64.zip -OutFile node-v8.12.0-win-x64.zip
PS C:\Users\Diego\Devel\myapp>Expand-Archive .\node-v8.12.0-win-x64.zip -DestinationPath .\

Install dependencies

PS C:\Users\Diego\Devel\myapp> .\node-v8.12.0-win-x64\npm install lodash

Remove unneeded files

PS C:\Users\Diego\Devel\myapp> rmdir -Recurse .\node-v8.12.0-win-x64\node_modules\npm

Create launcher script* - launch.cmd

@ECHOOFFSETLOCALSET"NODE_DIST=node-v8.12.0-win-x64"SET"APP_MAIN_JS=app.js"SET"NODE_EXE=%~dp0\%NODE_DIST%\node.exe"SET"NODE_PATH=%~dp0\%NODE_DIST%\node_modules"SET"APP_MAIN_JS_PATH=%~dp0\%APP_MAIN_JS%"CALL%NODE_EXE%%APP_MAIN_JS_PATH%%*EXIT /B %ERRORLEVEL%

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

PS C:\Users\Diego\Devel\myapp> cd ..
PS C:\Users\Diego\Devel> [Net.ServicePointManager]::SecurityProtocol ="tls12, tls11, tls" ; Invoke-WebRequest https://github.com/dgiagio/warp/releases/download/v0.3.0/windows-x64.warp-packer.exe-OutFile warp-packer.exe

Create your self-contained application

PS C:\Users\Diego\Devel> .\warp-packer --arch windows-x64 --input_dir .\myapp\ --exec launch.cmd--output myapp.exe

Run your self-contained application

PS C:\Users\Diego\Devel> .\myapp.exe
[ 2,3 ]
PS C:\Users\Diego\Devel>

More information about your self-contained application

PS C:\Users\Diego\Devel>"{0:N2} MB"-f ((Get-Itemmyapp.exe).Length /1MB)
9.15 MB

Quickstart with .NET Core

Linux

Create a simple console application

dgiagio@X1:~/Devel$ mkdir myapp
dgiagio@X1:~/Devel$ cd myapp
dgiagio@X1:~/Devel/myapp$ dotnet new console
dgiagio@X1:~/Devel/myapp$ dotnet run
Hello World!
dgiagio@X1:~/Devel/myapp$

Publish the application with native installer for linux-x64 runtime

dgiagio@X1:~/Devel/myapp$ dotnet publish -c Release -r linux-x64

The application should be published to bin/Release/netcoreapp2.1/linux-x64/publish/

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

dgiagio@X1:~/Devel/myapp$ curl -Lo warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/linux-x64.warp-packer
dgiagio@X1:~/Devel/myapp$ chmod +x warp-packer

Create your self-contained application

dgiagio@X1:~/Devel/myapp$ ./warp-packer --arch linux-x64 --input_dir bin/Release/netcoreapp2.1/linux-x64/publish --exec myapp --output myapp
dgiagio@X1:~/Devel/myapp$ chmod +x myapp

Run your self-contained application

dgiagio@X1:~/Devel/myapp$ ./myapp
Hello World!
dgiagio@X1:~/Devel/myapp$

More information about your self-contained application

dgiagio@X1:~/Devel/myapp$ file myapp
myapp: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, BuildID[sha1]=13b12e71a63ca1de8537ad7e90c83241f9f87f6c, with debug_info, not stripped
dgiagio@X1:~/Devel/myapp$ du -hs myapp
34M myapp

macOS

Create a simple console application

Diegos-iMac:Devel dgiagio$ mkdir myapp
Diegos-iMac:Devel dgiagio$ cd myapp
Diegos-iMac:myapp dgiagio$ dotnet new console
Diegos-iMac:myapp dgiagio$ dotnet run
Hello World!
Diegos-iMac:myapp dgiagio$

Publish the application with native installer for osx-x64 runtime

Diegos-iMac:myapp dgiagio$ dotnet publish -c Release -r osx-x64

The application should be published to bin/Release/netcoreapp2.1/osx-x64/publish/

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

Diegos-iMac:myapp dgiagio$ curl -Lo warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/macos-x64.warp-packer
Diegos-iMac:myapp dgiagio$ chmod +x warp-packer

Create your self-contained application

Diegos-iMac:myapp dgiagio$ ./warp-packer --arch macos-x64 --input_dir bin/Release/netcoreapp2.1/osx-x64/publish --exec myapp --output myapp
Diegos-iMac:myapp dgiagio$ chmod +x myapp

Run your self-contained application

Diegos-iMac:myapp dgiagio$ ./myapp
Hello World!
Diegos-iMac:myapp dgiagio$

More information about your self-contained application

Diegos-iMac:myapp dgiagio$ file myapp
myapp: Mach-O 64-bit executable x86_64
Diegos-iMac:myapp dgiagio$ du -hs myapp
27M myapp

Windows

Create a simple console application

PS C:\Users\Diego\Devel> mkdir myapp
PS C:\Users\Diego\Devel> cd myapp
PS C:\Users\Diego\Devel\myapp> dotnet new console
PS C:\Users\Diego\Devel\myapp> dotnet run
Hello World!
PS C:\Users\Diego\Devel\myapp>

Publish the application with native installer for win10-x64 runtime

PS C:\Users\Diego\Devel\myapp> dotnet publish -c Release -r win10-x64

The application should be published to bin/Release/netcoreapp2.1/win10-x64/publish/

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

PS C:\Users\Diego\Devel\myapp> [Net.ServicePointManager]::SecurityProtocol ="tls12, tls11, tls" ; Invoke-WebRequest https://github.com/dgiagio/warp/releases/download/v0.3.0/windows-x64.warp-packer.exe-OutFile warp-packer.exe

Create your self-contained application

PS C:\Users\Diego\Devel\myapp> .\warp-packer --arch windows-x64 --input_dir bin/Release/netcoreapp2.1/win10-x64/publish --exec myapp.exe--output myapp.exe

Run your self-contained application

PS C:\Users\Diego\Devel\myapp> .\myapp.exe
Hello World!
PS C:\Users\Diego\Devel\myapp>

More information about your self-contained application

PS C:\Users\Diego\Devel\myapp>"{0:N2} MB"-f ((Get-Itemmyapp.exe).Length /1MB)
28.51 MB

Quickstart with Java

Linux

Create a Hello World application

Create HelloWorld.java:

// HelloWorld.javapublicfinalclassHelloWorld {
publicstaticvoidmain(finalString[] args) {
System.out.println("Hello, world. ");
}
}

Test that it works:

$ javac HelloWorld.java
$ java HelloWorld
Hello, world.

We need to bundle this as a .jar:

$ jar cvfe app.jar HelloWorld HelloWorld.class
added manifest
adding: HelloWorld.class(in = 428) (out= 290)(deflated 32%)
$ java -jar app.jar
Hello, world.

Download a JRE

There are prebuilt JREs over on AdoptOpenJDK.

Here we use JRE 8:

wget -N https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u202-b08/OpenJDK8U-jre_x64_linux_hotspot_8u202b08.tar.gz

Unpack it:

tar -xvf OpenJDK8U-jre_x64_linux_hotspot_8u202b08.tar.gz

Create a bundle

We need to create a folder containing: our compiled code, the JRE and a launch script.

mkdir bundle
cp -r ./jdk8u202-b08-jre ./bundle/jre
cp app.jar ./bundle/app.jar
touch bundle/run.sh
chmod +x ./bundle/run.sh 

Finally, we to write run.sh. This script will run our .jar using the bundled JRE.

Here are the contents of ./bundle/run.sh:

#!/usr/bin/env bash
HERE=${BASH_SOURCE%/*}"$HERE/jre/bin/java" -jar "$HERE/app.jar""$@"

Test the bundle:

$ ./bundle/run.sh Hello, world. 

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

$ wget -O warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/linux-x64.warp-packer
$ chmod +x ./warp-packer

Create your self-contained application

$ ./warp-packer --arch linux-x64 --input_dir bundle --exec run.sh --output app.bin
$ chmod +x app.bin

Run your self-contained application

$ ./app.bin Hello, world. 

How it works

Warp is a multi-platform tool written in Rust and is comprised of two programs: warp-runner and warp-packer.

The final self-contained single binary application consists of two parts: 1) runner and 2) the compressed target application executable and dependencies.

warp-runner is a stub application that knows how to find the compressed payload within its own binary, perform extraction to a local cache and execute the target application.

The extraction process only happens the first time the application is ran, or when the self-contained application binary is updated.

warp-packer is a CLI application that's used to create the self-contained application binary by downloading the matching warp-runner for the chosen platform, compressing the target application and its dependencies, and generating the final self-contained binary.

Performance

The performance characteristics of the generated self-contained application is roughly the same of original application, except for the first time it's ran as the target application and its dependencies have to be decompressed to a local cache.

Packages cache location

  • Linux: $HOME/.local/share/warp/packages
  • macOS: $HOME/Library/Application Support/warp/packages
  • Windows: %LOCALAPPDATA%\warp\packages

Runners cache location

  • Linux: $HOME/.local/share/warp/runners
  • macOS: $HOME/Library/Application Support/warp/runners
  • Windows: %LOCALAPPDATA%\warp\runners

Authors

  • Diego Giagio <diego@giagio.com>
  • Finter Mobility As

Icons

License

This project is licensed under the MIT License - see the LICENSE file for details

Who is Using Warp?

About

Create self-contained single binary applications

Resources

Stars

20 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
This repository was archived by the owner on Aug 20, 2026. It is now read-only.

Repository files navigation

Warp

dependabot

Build serverPlatformsBuild status
Github Actionslinux-latest, windows-latest, macos-latestBranch: develop warp
Github Actionslinux-latest, windows-latest, macos-latestBranch: master warp

This repository was forked fromdgiagio/warp because the original author stopped maintaining the project.

Warp lets you create self-contained single binary applications making it simpler and more ergonomic to deliver your application to your customers. A self-contained binary is specially convenient when the technology you use, such as Node.js, .NET Core, Java and others, contain many dependencies that must be shipped alongside your application.

Warp is written in Rust and is supported on Linux, Windows and macOS.

Table of Content

Quickstart with Node.js

Linux

Create the directory for the application

dgiagio@X1:~/Devel$ mkdir myapp
dgiagio@X1:~/Devel/myapp$ cd myapp

Create main application - app.js

varlodash=require('lodash');varoutput=lodash.without([1,2,3],1);console.log(output);

Download Node.js distribution

dgiagio@X1:~/Devel/myapp$ wget https://nodejs.org/dist/v8.12.0/node-v8.12.0-linux-x64.tar.xz
dgiagio@X1:~/Devel/myapp$ xz -dc node-v8.12.0-linux-x64.tar.xz | tar xvf -

Install dependencies

dgiagio@X1:~/Devel/myapp$ node-v8.12.0-linux-x64/bin/npm install lodash

Remove unneeded files

dgiagio@X1:~/Devel/myapp$ rm -r node-v8.12.0-linux-x64/include node-v8.12.0-linux-x64/share node-v8.12.0-linux-x64/lib
dgiagio@X1:~/Devel/myapp$ rm node-v8.12.0-linux-x64/bin/npm node-v8.12.0-linux-x64/bin/npx

Create launcher script - launch

#!/bin/sh
NODE_DIST=node-v8.12.0-linux-x64
APP_MAIN_JS=app.js
DIR="$(cd "$(dirname "$0")";pwd -P)"
NODE_EXE=$DIR/$NODE_DIST/bin/node
NODE_PATH=$DIR/node_modules
APP_MAIN_JS_PATH=$DIR/$APP_MAIN_JSexec$NODE_EXE$APP_MAIN_JS_PATH$@

Make the launcher script executable

dgiagio@X1:~/Devel/myapp$ chmod +x launch

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

dgiagio@X1:~/Devel/myapp$ cd ..
dgiagio@X1:~/Devel$ curl -Lo warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/linux-x64.warp-packer
dgiagio@X1:~/Devel$ chmod +x warp-packer

Create your self-contained application

dgiagio@X1:~/Devel$ ./warp-packer --arch linux-x64 --input_dir myapp --exec launch --output myapp.bin
dgiagio@X1:~/Devel$ chmod +x myapp.bin

Run your self-contained application

dgiagio@X1:~/Devel$ ./myapp.bin
[ 2, 3 ]
dgiagio@X1:~/Devel$

More information about your self-contained application

dgiagio@X1:~/Devel/myapp$ file myapp.bin
myapp.bin: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=aa53b01be2cde5e0b64450870b1af13b52d5cffb, with debug_info, not stripped
dgiagio@X1:~/Devel/myapp$ du -hs myapp.bin
17M myapp.bin

macOS

Create the directory for the application

Diegos-iMac:Devel dgiagio$ mkdir myapp
Diegos-iMac:Devel dgiagio$ cd myapp

Create main application - app.js

varlodash=require('lodash');varoutput=lodash.without([1,2,3],1);console.log(output);

Download Node.js distribution

Diegos-iMac:myapp dgiagio$ curl -Lo node-v8.12.0-darwin-x64.tar.gz https://nodejs.org/dist/v8.12.0/node-v8.12.0-darwin-x64.tar.gz
Diegos-iMac:myapp dgiagio$ tar xvfz node-v8.12.0-darwin-x64.tar.gz

Install dependencies

Diegos-iMac:myapp dgiagio$ PATH=node-v8.12.0-darwin-x64/bin npm install lodash

Remove unneeded files

Diegos-iMac:myapp dgiagio$ rm -r node-v8.12.0-darwin-x64/include node-v8.12.0-darwin-x64/share node-v8.12.0-darwin-x64/lib
Diegos-iMac:myapp dgiagio$ rm node-v8.12.0-darwin-x64/bin/npm node-v8.12.0-darwin-x64/bin/npx

Create launcher script* - launch

#!/bin/sh
NODE_DIST=node-v8.12.0-darwin-x64
APP_MAIN_JS=app.js
DIR="$(cd "$(dirname "$0")";pwd -P)"
NODE_EXE=$DIR/$NODE_DIST/bin/node
NODE_PATH=$DIR/node_modules
APP_MAIN_JS_PATH=$DIR/$APP_MAIN_JSexec"$NODE_EXE""$APP_MAIN_JS_PATH"$@

Make the launcher script executable

Diegos-iMac:myapp dgiagio$ chmod +x launch

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

Diegos-iMac:myapp dgiagio$ cd ..
Diegos-iMac:Devel dgiagio$ curl -Lo warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/macos-x64.warp-packer
Diegos-iMac:Devel dgiagio$ chmod +x warp-packer

Create your self-contained application

Diegos-iMac:Devel dgiagio$ ./warp-packer --arch macos-x64 --input_dir myapp --exec launch --output myapp.bin
Diegos-iMac:Devel dgiagio$ chmod +x myapp.bin

Run your self-contained application

Diegos-iMac:Devel dgiagio$ ./myapp.bin
[ 2, 3 ]
Diegos-iMac:Devel dgiagio$

More information about your self-contained application

Diegos-iMac:Devel dgiagio$ file myapp.bin
myapp.bin: Mach-O 64-bit executable x86_64
Diegos-iMac:Devel dgiagio$ du -hs myapp.bin
26M myapp.bin

Windows

Create the directory for the application

PS C:\Users\Diego\Devel> mkdir myapp
PS C:\Users\Diego\Devel> cd myapp

Create main application - app.js

varlodash=require('lodash');varoutput=lodash.without([1,2,3],1);console.log(output);

Download Node.js distribution

PS C:\Users\Diego\Devel\myapp> curl https://nodejs.org/dist/v8.12.0/node-v8.12.0-win-x64.zip -OutFile node-v8.12.0-win-x64.zip
PS C:\Users\Diego\Devel\myapp>Expand-Archive .\node-v8.12.0-win-x64.zip -DestinationPath .\

Install dependencies

PS C:\Users\Diego\Devel\myapp> .\node-v8.12.0-win-x64\npm install lodash

Remove unneeded files

PS C:\Users\Diego\Devel\myapp> rmdir -Recurse .\node-v8.12.0-win-x64\node_modules\npm

Create launcher script* - launch.cmd

@ECHOOFFSETLOCALSET"NODE_DIST=node-v8.12.0-win-x64"SET"APP_MAIN_JS=app.js"SET"NODE_EXE=%~dp0\%NODE_DIST%\node.exe"SET"NODE_PATH=%~dp0\%NODE_DIST%\node_modules"SET"APP_MAIN_JS_PATH=%~dp0\%APP_MAIN_JS%"CALL%NODE_EXE%%APP_MAIN_JS_PATH%%*EXIT /B %ERRORLEVEL%

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

PS C:\Users\Diego\Devel\myapp> cd ..
PS C:\Users\Diego\Devel> [Net.ServicePointManager]::SecurityProtocol ="tls12, tls11, tls" ; Invoke-WebRequest https://github.com/dgiagio/warp/releases/download/v0.3.0/windows-x64.warp-packer.exe-OutFile warp-packer.exe

Create your self-contained application

PS C:\Users\Diego\Devel> .\warp-packer --arch windows-x64 --input_dir .\myapp\ --exec launch.cmd--output myapp.exe

Run your self-contained application

PS C:\Users\Diego\Devel> .\myapp.exe
[ 2,3 ]
PS C:\Users\Diego\Devel>

More information about your self-contained application

PS C:\Users\Diego\Devel>"{0:N2} MB"-f ((Get-Itemmyapp.exe).Length /1MB)
9.15 MB

Quickstart with .NET Core

Linux

Create a simple console application

dgiagio@X1:~/Devel$ mkdir myapp
dgiagio@X1:~/Devel$ cd myapp
dgiagio@X1:~/Devel/myapp$ dotnet new console
dgiagio@X1:~/Devel/myapp$ dotnet run
Hello World!
dgiagio@X1:~/Devel/myapp$

Publish the application with native installer for linux-x64 runtime

dgiagio@X1:~/Devel/myapp$ dotnet publish -c Release -r linux-x64

The application should be published to bin/Release/netcoreapp2.1/linux-x64/publish/

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

dgiagio@X1:~/Devel/myapp$ curl -Lo warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/linux-x64.warp-packer
dgiagio@X1:~/Devel/myapp$ chmod +x warp-packer

Create your self-contained application

dgiagio@X1:~/Devel/myapp$ ./warp-packer --arch linux-x64 --input_dir bin/Release/netcoreapp2.1/linux-x64/publish --exec myapp --output myapp
dgiagio@X1:~/Devel/myapp$ chmod +x myapp

Run your self-contained application

dgiagio@X1:~/Devel/myapp$ ./myapp
Hello World!
dgiagio@X1:~/Devel/myapp$

More information about your self-contained application

dgiagio@X1:~/Devel/myapp$ file myapp
myapp: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, BuildID[sha1]=13b12e71a63ca1de8537ad7e90c83241f9f87f6c, with debug_info, not stripped
dgiagio@X1:~/Devel/myapp$ du -hs myapp
34M myapp

macOS

Create a simple console application

Diegos-iMac:Devel dgiagio$ mkdir myapp
Diegos-iMac:Devel dgiagio$ cd myapp
Diegos-iMac:myapp dgiagio$ dotnet new console
Diegos-iMac:myapp dgiagio$ dotnet run
Hello World!
Diegos-iMac:myapp dgiagio$

Publish the application with native installer for osx-x64 runtime

Diegos-iMac:myapp dgiagio$ dotnet publish -c Release -r osx-x64

The application should be published to bin/Release/netcoreapp2.1/osx-x64/publish/

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

Diegos-iMac:myapp dgiagio$ curl -Lo warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/macos-x64.warp-packer
Diegos-iMac:myapp dgiagio$ chmod +x warp-packer

Create your self-contained application

Diegos-iMac:myapp dgiagio$ ./warp-packer --arch macos-x64 --input_dir bin/Release/netcoreapp2.1/osx-x64/publish --exec myapp --output myapp
Diegos-iMac:myapp dgiagio$ chmod +x myapp

Run your self-contained application

Diegos-iMac:myapp dgiagio$ ./myapp
Hello World!
Diegos-iMac:myapp dgiagio$

More information about your self-contained application

Diegos-iMac:myapp dgiagio$ file myapp
myapp: Mach-O 64-bit executable x86_64
Diegos-iMac:myapp dgiagio$ du -hs myapp
27M myapp

Windows

Create a simple console application

PS C:\Users\Diego\Devel> mkdir myapp
PS C:\Users\Diego\Devel> cd myapp
PS C:\Users\Diego\Devel\myapp> dotnet new console
PS C:\Users\Diego\Devel\myapp> dotnet run
Hello World!
PS C:\Users\Diego\Devel\myapp>

Publish the application with native installer for win10-x64 runtime

PS C:\Users\Diego\Devel\myapp> dotnet publish -c Release -r win10-x64

The application should be published to bin/Release/netcoreapp2.1/win10-x64/publish/

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

PS C:\Users\Diego\Devel\myapp> [Net.ServicePointManager]::SecurityProtocol ="tls12, tls11, tls" ; Invoke-WebRequest https://github.com/dgiagio/warp/releases/download/v0.3.0/windows-x64.warp-packer.exe-OutFile warp-packer.exe

Create your self-contained application

PS C:\Users\Diego\Devel\myapp> .\warp-packer --arch windows-x64 --input_dir bin/Release/netcoreapp2.1/win10-x64/publish --exec myapp.exe--output myapp.exe

Run your self-contained application

PS C:\Users\Diego\Devel\myapp> .\myapp.exe
Hello World!
PS C:\Users\Diego\Devel\myapp>

More information about your self-contained application

PS C:\Users\Diego\Devel\myapp>"{0:N2} MB"-f ((Get-Itemmyapp.exe).Length /1MB)
28.51 MB

Quickstart with Java

Linux

Create a Hello World application

Create HelloWorld.java:

// HelloWorld.javapublicfinalclassHelloWorld {
publicstaticvoidmain(finalString[] args) {
System.out.println("Hello, world. ");
}
}

Test that it works:

$ javac HelloWorld.java
$ java HelloWorld
Hello, world.

We need to bundle this as a .jar:

$ jar cvfe app.jar HelloWorld HelloWorld.class
added manifest
adding: HelloWorld.class(in = 428) (out= 290)(deflated 32%)
$ java -jar app.jar
Hello, world.

Download a JRE

There are prebuilt JREs over on AdoptOpenJDK.

Here we use JRE 8:

wget -N https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u202-b08/OpenJDK8U-jre_x64_linux_hotspot_8u202b08.tar.gz

Unpack it:

tar -xvf OpenJDK8U-jre_x64_linux_hotspot_8u202b08.tar.gz

Create a bundle

We need to create a folder containing: our compiled code, the JRE and a launch script.

mkdir bundle
cp -r ./jdk8u202-b08-jre ./bundle/jre
cp app.jar ./bundle/app.jar
touch bundle/run.sh
chmod +x ./bundle/run.sh 

Finally, we to write run.sh. This script will run our .jar using the bundled JRE.

Here are the contents of ./bundle/run.sh:

#!/usr/bin/env bash
HERE=${BASH_SOURCE%/*}"$HERE/jre/bin/java" -jar "$HERE/app.jar""$@"

Test the bundle:

$ ./bundle/run.sh Hello, world. 

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

$ wget -O warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/linux-x64.warp-packer
$ chmod +x ./warp-packer

Create your self-contained application

$ ./warp-packer --arch linux-x64 --input_dir bundle --exec run.sh --output app.bin
$ chmod +x app.bin

Run your self-contained application

$ ./app.bin Hello, world. 

How it works

Warp is a multi-platform tool written in Rust and is comprised of two programs: warp-runner and warp-packer.

The final self-contained single binary application consists of two parts: 1) runner and 2) the compressed target application executable and dependencies.

warp-runner is a stub application that knows how to find the compressed payload within its own binary, perform extraction to a local cache and execute the target application.

The extraction process only happens the first time the application is ran, or when the self-contained application binary is updated.

warp-packer is a CLI application that's used to create the self-contained application binary by downloading the matching warp-runner for the chosen platform, compressing the target application and its dependencies, and generating the final self-contained binary.

Performance

The performance characteristics of the generated self-contained application is roughly the same of original application, except for the first time it's ran as the target application and its dependencies have to be decompressed to a local cache.

Packages cache location

  • Linux: $HOME/.local/share/warp/packages
  • macOS: $HOME/Library/Application Support/warp/packages
  • Windows: %LOCALAPPDATA%\warp\packages

Runners cache location

  • Linux: $HOME/.local/share/warp/runners
  • macOS: $HOME/Library/Application Support/warp/runners
  • Windows: %LOCALAPPDATA%\warp\runners

Authors

  • Diego Giagio <diego@giagio.com>
  • Finter Mobility As

Icons

License

This project is licensed under the MIT License - see the LICENSE file for details

Who is Using Warp?

About

Create self-contained single binary applications

Resources

Stars

20 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content
This repository was archived by the owner on Aug 20, 2026. It is now read-only.

Repository files navigation

Warp

dependabot

Build serverPlatformsBuild status
Github Actionslinux-latest, windows-latest, macos-latestBranch: develop warp
Github Actionslinux-latest, windows-latest, macos-latestBranch: master warp

This repository was forked fromdgiagio/warp because the original author stopped maintaining the project.

Warp lets you create self-contained single binary applications making it simpler and more ergonomic to deliver your application to your customers. A self-contained binary is specially convenient when the technology you use, such as Node.js, .NET Core, Java and others, contain many dependencies that must be shipped alongside your application.

Warp is written in Rust and is supported on Linux, Windows and macOS.

Table of Content

Quickstart with Node.js

Linux

Create the directory for the application

dgiagio@X1:~/Devel$ mkdir myapp
dgiagio@X1:~/Devel/myapp$ cd myapp

Create main application - app.js

varlodash=require('lodash');varoutput=lodash.without([1,2,3],1);console.log(output);

Download Node.js distribution

dgiagio@X1:~/Devel/myapp$ wget https://nodejs.org/dist/v8.12.0/node-v8.12.0-linux-x64.tar.xz
dgiagio@X1:~/Devel/myapp$ xz -dc node-v8.12.0-linux-x64.tar.xz | tar xvf -

Install dependencies

dgiagio@X1:~/Devel/myapp$ node-v8.12.0-linux-x64/bin/npm install lodash

Remove unneeded files

dgiagio@X1:~/Devel/myapp$ rm -r node-v8.12.0-linux-x64/include node-v8.12.0-linux-x64/share node-v8.12.0-linux-x64/lib
dgiagio@X1:~/Devel/myapp$ rm node-v8.12.0-linux-x64/bin/npm node-v8.12.0-linux-x64/bin/npx

Create launcher script - launch

#!/bin/sh
NODE_DIST=node-v8.12.0-linux-x64
APP_MAIN_JS=app.js
DIR="$(cd "$(dirname "$0")";pwd -P)"
NODE_EXE=$DIR/$NODE_DIST/bin/node
NODE_PATH=$DIR/node_modules
APP_MAIN_JS_PATH=$DIR/$APP_MAIN_JSexec$NODE_EXE$APP_MAIN_JS_PATH$@

Make the launcher script executable

dgiagio@X1:~/Devel/myapp$ chmod +x launch

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

dgiagio@X1:~/Devel/myapp$ cd ..
dgiagio@X1:~/Devel$ curl -Lo warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/linux-x64.warp-packer
dgiagio@X1:~/Devel$ chmod +x warp-packer

Create your self-contained application

dgiagio@X1:~/Devel$ ./warp-packer --arch linux-x64 --input_dir myapp --exec launch --output myapp.bin
dgiagio@X1:~/Devel$ chmod +x myapp.bin

Run your self-contained application

dgiagio@X1:~/Devel$ ./myapp.bin
[ 2, 3 ]
dgiagio@X1:~/Devel$

More information about your self-contained application

dgiagio@X1:~/Devel/myapp$ file myapp.bin
myapp.bin: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=aa53b01be2cde5e0b64450870b1af13b52d5cffb, with debug_info, not stripped
dgiagio@X1:~/Devel/myapp$ du -hs myapp.bin
17M myapp.bin

macOS

Create the directory for the application

Diegos-iMac:Devel dgiagio$ mkdir myapp
Diegos-iMac:Devel dgiagio$ cd myapp

Create main application - app.js

varlodash=require('lodash');varoutput=lodash.without([1,2,3],1);console.log(output);

Download Node.js distribution

Diegos-iMac:myapp dgiagio$ curl -Lo node-v8.12.0-darwin-x64.tar.gz https://nodejs.org/dist/v8.12.0/node-v8.12.0-darwin-x64.tar.gz
Diegos-iMac:myapp dgiagio$ tar xvfz node-v8.12.0-darwin-x64.tar.gz

Install dependencies

Diegos-iMac:myapp dgiagio$ PATH=node-v8.12.0-darwin-x64/bin npm install lodash

Remove unneeded files

Diegos-iMac:myapp dgiagio$ rm -r node-v8.12.0-darwin-x64/include node-v8.12.0-darwin-x64/share node-v8.12.0-darwin-x64/lib
Diegos-iMac:myapp dgiagio$ rm node-v8.12.0-darwin-x64/bin/npm node-v8.12.0-darwin-x64/bin/npx

Create launcher script* - launch

#!/bin/sh
NODE_DIST=node-v8.12.0-darwin-x64
APP_MAIN_JS=app.js
DIR="$(cd "$(dirname "$0")";pwd -P)"
NODE_EXE=$DIR/$NODE_DIST/bin/node
NODE_PATH=$DIR/node_modules
APP_MAIN_JS_PATH=$DIR/$APP_MAIN_JSexec"$NODE_EXE""$APP_MAIN_JS_PATH"$@

Make the launcher script executable

Diegos-iMac:myapp dgiagio$ chmod +x launch

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

Diegos-iMac:myapp dgiagio$ cd ..
Diegos-iMac:Devel dgiagio$ curl -Lo warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/macos-x64.warp-packer
Diegos-iMac:Devel dgiagio$ chmod +x warp-packer

Create your self-contained application

Diegos-iMac:Devel dgiagio$ ./warp-packer --arch macos-x64 --input_dir myapp --exec launch --output myapp.bin
Diegos-iMac:Devel dgiagio$ chmod +x myapp.bin

Run your self-contained application

Diegos-iMac:Devel dgiagio$ ./myapp.bin
[ 2, 3 ]
Diegos-iMac:Devel dgiagio$

More information about your self-contained application

Diegos-iMac:Devel dgiagio$ file myapp.bin
myapp.bin: Mach-O 64-bit executable x86_64
Diegos-iMac:Devel dgiagio$ du -hs myapp.bin
26M myapp.bin

Windows

Create the directory for the application

PS C:\Users\Diego\Devel> mkdir myapp
PS C:\Users\Diego\Devel> cd myapp

Create main application - app.js

varlodash=require('lodash');varoutput=lodash.without([1,2,3],1);console.log(output);

Download Node.js distribution

PS C:\Users\Diego\Devel\myapp> curl https://nodejs.org/dist/v8.12.0/node-v8.12.0-win-x64.zip -OutFile node-v8.12.0-win-x64.zip
PS C:\Users\Diego\Devel\myapp>Expand-Archive .\node-v8.12.0-win-x64.zip -DestinationPath .\

Install dependencies

PS C:\Users\Diego\Devel\myapp> .\node-v8.12.0-win-x64\npm install lodash

Remove unneeded files

PS C:\Users\Diego\Devel\myapp> rmdir -Recurse .\node-v8.12.0-win-x64\node_modules\npm

Create launcher script* - launch.cmd

@ECHOOFFSETLOCALSET"NODE_DIST=node-v8.12.0-win-x64"SET"APP_MAIN_JS=app.js"SET"NODE_EXE=%~dp0\%NODE_DIST%\node.exe"SET"NODE_PATH=%~dp0\%NODE_DIST%\node_modules"SET"APP_MAIN_JS_PATH=%~dp0\%APP_MAIN_JS%"CALL%NODE_EXE%%APP_MAIN_JS_PATH%%*EXIT /B %ERRORLEVEL%

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

PS C:\Users\Diego\Devel\myapp> cd ..
PS C:\Users\Diego\Devel> [Net.ServicePointManager]::SecurityProtocol ="tls12, tls11, tls" ; Invoke-WebRequest https://github.com/dgiagio/warp/releases/download/v0.3.0/windows-x64.warp-packer.exe-OutFile warp-packer.exe

Create your self-contained application

PS C:\Users\Diego\Devel> .\warp-packer --arch windows-x64 --input_dir .\myapp\ --exec launch.cmd--output myapp.exe

Run your self-contained application

PS C:\Users\Diego\Devel> .\myapp.exe
[ 2,3 ]
PS C:\Users\Diego\Devel>

More information about your self-contained application

PS C:\Users\Diego\Devel>"{0:N2} MB"-f ((Get-Itemmyapp.exe).Length /1MB)
9.15 MB

Quickstart with .NET Core

Linux

Create a simple console application

dgiagio@X1:~/Devel$ mkdir myapp
dgiagio@X1:~/Devel$ cd myapp
dgiagio@X1:~/Devel/myapp$ dotnet new console
dgiagio@X1:~/Devel/myapp$ dotnet run
Hello World!
dgiagio@X1:~/Devel/myapp$

Publish the application with native installer for linux-x64 runtime

dgiagio@X1:~/Devel/myapp$ dotnet publish -c Release -r linux-x64

The application should be published to bin/Release/netcoreapp2.1/linux-x64/publish/

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

dgiagio@X1:~/Devel/myapp$ curl -Lo warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/linux-x64.warp-packer
dgiagio@X1:~/Devel/myapp$ chmod +x warp-packer

Create your self-contained application

dgiagio@X1:~/Devel/myapp$ ./warp-packer --arch linux-x64 --input_dir bin/Release/netcoreapp2.1/linux-x64/publish --exec myapp --output myapp
dgiagio@X1:~/Devel/myapp$ chmod +x myapp

Run your self-contained application

dgiagio@X1:~/Devel/myapp$ ./myapp
Hello World!
dgiagio@X1:~/Devel/myapp$

More information about your self-contained application

dgiagio@X1:~/Devel/myapp$ file myapp
myapp: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, BuildID[sha1]=13b12e71a63ca1de8537ad7e90c83241f9f87f6c, with debug_info, not stripped
dgiagio@X1:~/Devel/myapp$ du -hs myapp
34M myapp

macOS

Create a simple console application

Diegos-iMac:Devel dgiagio$ mkdir myapp
Diegos-iMac:Devel dgiagio$ cd myapp
Diegos-iMac:myapp dgiagio$ dotnet new console
Diegos-iMac:myapp dgiagio$ dotnet run
Hello World!
Diegos-iMac:myapp dgiagio$

Publish the application with native installer for osx-x64 runtime

Diegos-iMac:myapp dgiagio$ dotnet publish -c Release -r osx-x64

The application should be published to bin/Release/netcoreapp2.1/osx-x64/publish/

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

Diegos-iMac:myapp dgiagio$ curl -Lo warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/macos-x64.warp-packer
Diegos-iMac:myapp dgiagio$ chmod +x warp-packer

Create your self-contained application

Diegos-iMac:myapp dgiagio$ ./warp-packer --arch macos-x64 --input_dir bin/Release/netcoreapp2.1/osx-x64/publish --exec myapp --output myapp
Diegos-iMac:myapp dgiagio$ chmod +x myapp

Run your self-contained application

Diegos-iMac:myapp dgiagio$ ./myapp
Hello World!
Diegos-iMac:myapp dgiagio$

More information about your self-contained application

Diegos-iMac:myapp dgiagio$ file myapp
myapp: Mach-O 64-bit executable x86_64
Diegos-iMac:myapp dgiagio$ du -hs myapp
27M myapp

Windows

Create a simple console application

PS C:\Users\Diego\Devel> mkdir myapp
PS C:\Users\Diego\Devel> cd myapp
PS C:\Users\Diego\Devel\myapp> dotnet new console
PS C:\Users\Diego\Devel\myapp> dotnet run
Hello World!
PS C:\Users\Diego\Devel\myapp>

Publish the application with native installer for win10-x64 runtime

PS C:\Users\Diego\Devel\myapp> dotnet publish -c Release -r win10-x64

The application should be published to bin/Release/netcoreapp2.1/win10-x64/publish/

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

PS C:\Users\Diego\Devel\myapp> [Net.ServicePointManager]::SecurityProtocol ="tls12, tls11, tls" ; Invoke-WebRequest https://github.com/dgiagio/warp/releases/download/v0.3.0/windows-x64.warp-packer.exe-OutFile warp-packer.exe

Create your self-contained application

PS C:\Users\Diego\Devel\myapp> .\warp-packer --arch windows-x64 --input_dir bin/Release/netcoreapp2.1/win10-x64/publish --exec myapp.exe--output myapp.exe

Run your self-contained application

PS C:\Users\Diego\Devel\myapp> .\myapp.exe
Hello World!
PS C:\Users\Diego\Devel\myapp>

More information about your self-contained application

PS C:\Users\Diego\Devel\myapp>"{0:N2} MB"-f ((Get-Itemmyapp.exe).Length /1MB)
28.51 MB

Quickstart with Java

Linux

Create a Hello World application

Create HelloWorld.java:

// HelloWorld.javapublicfinalclassHelloWorld {
publicstaticvoidmain(finalString[] args) {
System.out.println("Hello, world. ");
}
}

Test that it works:

$ javac HelloWorld.java
$ java HelloWorld
Hello, world.

We need to bundle this as a .jar:

$ jar cvfe app.jar HelloWorld HelloWorld.class
added manifest
adding: HelloWorld.class(in = 428) (out= 290)(deflated 32%)
$ java -jar app.jar
Hello, world.

Download a JRE

There are prebuilt JREs over on AdoptOpenJDK.

Here we use JRE 8:

wget -N https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u202-b08/OpenJDK8U-jre_x64_linux_hotspot_8u202b08.tar.gz

Unpack it:

tar -xvf OpenJDK8U-jre_x64_linux_hotspot_8u202b08.tar.gz

Create a bundle

We need to create a folder containing: our compiled code, the JRE and a launch script.

mkdir bundle
cp -r ./jdk8u202-b08-jre ./bundle/jre
cp app.jar ./bundle/app.jar
touch bundle/run.sh
chmod +x ./bundle/run.sh 

Finally, we to write run.sh. This script will run our .jar using the bundled JRE.

Here are the contents of ./bundle/run.sh:

#!/usr/bin/env bash
HERE=${BASH_SOURCE%/*}"$HERE/jre/bin/java" -jar "$HERE/app.jar""$@"

Test the bundle:

$ ./bundle/run.sh Hello, world. 

Download warp-packer

If you save warp-packer in a directory in your PATH, you only need to download it once.

$ wget -O warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/linux-x64.warp-packer
$ chmod +x ./warp-packer

Create your self-contained application

$ ./warp-packer --arch linux-x64 --input_dir bundle --exec run.sh --output app.bin
$ chmod +x app.bin

Run your self-contained application

$ ./app.bin Hello, world. 

How it works

Warp is a multi-platform tool written in Rust and is comprised of two programs: warp-runner and warp-packer.

The final self-contained single binary application consists of two parts: 1) runner and 2) the compressed target application executable and dependencies.

warp-runner is a stub application that knows how to find the compressed payload within its own binary, perform extraction to a local cache and execute the target application.

The extraction process only happens the first time the application is ran, or when the self-contained application binary is updated.

warp-packer is a CLI application that's used to create the self-contained application binary by downloading the matching warp-runner for the chosen platform, compressing the target application and its dependencies, and generating the final self-contained binary.

Performance

The performance characteristics of the generated self-contained application is roughly the same of original application, except for the first time it's ran as the target application and its dependencies have to be decompressed to a local cache.

Packages cache location

  • Linux: $HOME/.local/share/warp/packages
  • macOS: $HOME/Library/Application Support/warp/packages
  • Windows: %LOCALAPPDATA%\warp\packages

Runners cache location

  • Linux: $HOME/.local/share/warp/runners
  • macOS: $HOME/Library/Application Support/warp/runners
  • Windows: %LOCALAPPDATA%\warp\runners

Authors

  • Diego Giagio <diego@giagio.com>
  • Finter Mobility As

Icons

License

This project is licensed under the MIT License - see the LICENSE file for details

Who is Using Warp?

About

Create self-contained single binary applications

Resources

Stars

20 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages