Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ jobs:
target: 'x86_64-unknown-linux-musl'
profile: 'minimal'

- name: 'Login to Docker Hub'
uses: 'docker/login-action@v1'
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: 'Cache Rust Targets'
uses: 'actions/cache@v2'
with:
Expand Down Expand Up @@ -65,6 +59,12 @@ jobs:
runs-on: 'ubuntu-latest'
needs: 'build'
steps:
- name: 'Login to Docker Hub'
uses: 'docker/login-action@v1'
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- uses: 'actions/checkout@v2'
- name: 'Cache Rust Targets'
uses: 'actions/cache@v2'
Expand Down
29 changes: 22 additions & 7 deletions BUILD → .lal/BUILD
Original file line number Diff line number Diff line change
@@ -1,26 +1,41 @@
#!/bin/bash
set -e

export PKG_CONFIG_ALLOW_CROSS=1

main() {
# build in the currently available muslrust container
set -e
if [ ! -d ~/.cargo/registry ]; then
echo "Ensure you have created a cargo-cache docker volume to speed up subsequent builds"
echo "If this is your first build, this is normal"
echo "Otherwise, please 'docker volume create cargo-cache' and ensure it is specified in your lal config"
echo "Continuing from blank cache..."
fi
if [[ $1 == "lal" ]]; then
mkdir -p OUTPUT/{bin,share/lal/configs}
cp configs/*.json OUTPUT/share/lal/configs/
mkdir -p OUTPUT/{bin,share/lal}
cp lal.complete* OUTPUT/share/lal/
if [[ $2 == "slim" ]]; then
(set -x; cargo build --no-default-features --release --verbose)
(
set -x; cargo build \
--target x86_64-unknown-linux-musl \
--no-default-features \
--release \
--verbose
)
cp ./target/x86_64-unknown-linux-musl/release/lal OUTPUT/bin/
elif [[ $2 == "release" ]]; then
(set -x; cargo build --release --verbose)
(
set -x; cargo build \
--target x86_64-unknown-linux-musl \
--release \
--verbose
)
cp ./target/x86_64-unknown-linux-musl/release/lal OUTPUT/bin/
elif [[ $2 == "debug" ]]; then
(set -x; cargo build --verbose)
(
set -x; cargo build \
--target x86_64-unknown-linux-musl \
--verbose
)
cp ./target/x86_64-unknown-linux-musl/debug/lal OUTPUT/bin/
else
echo "No such configuration $2 found"
Expand Down
11 changes: 9 additions & 2 deletions manifest.json → .lal/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
{
"name": "lal",
"environment": "rust",
"supportedEnvironments": ["rust"],
"environment": "default",
"supportedEnvironments": ["default", "rust"],
"environments": {
"default": null,
"rust": {
"name": "clux/muslrust",
"tag": "latest"
}
},
"components": {
"lal": {
"defaultConfig": "release",
Expand Down
48 changes: 19 additions & 29 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ sha1 = "0.3.0"
tar = "0.4.26"
walkdir = "1.0.7"
dirs = "2.0.2"
tempdir = "0.3.7"
tempfile = "3"

[dependencies.indicatif]
optional = true
Expand Down
53 changes: 49 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,60 @@ lal configure cfg.json
These are built on [CI](https://github.com/lalbuild/lal/releases) via [muslrust](https://github.com/clux/muslrust). You can drop `sudo` if you own or `chown` your install prefix.

## Building
Clone, install from source with [rust](https://www.rust-lang.org/en-US/install.html), setup autocomplete, and select your site-config:
Clone, install from source with [rust](https://www.rust-lang.org/en-US/install.html), setup autocomplete, and site configuration.

The following sections assume you are working from a local git clone of the repository.

```sh
git clone git@github.com:lalbuild/lal.git && cd lal
cargo install
git clone git@github.com:lalbuild/lal.git
cd lal
echo "source $PWD/lal.complete.sh" >> ~/.bash_completion
lal configure configs/demo.json
```

### Native (with cargo)

If you don't have `lal` installed yet, you can install it using `cargo install` from git.
It doesn't use `docker` if you don't have it and it doesn't depend on having `lal` installed.

However, this is not the cleanest build method, and may dynamically link against your system libraries.
The compiled binary may break with future system updates.

```sh
cargo install

# Set the initial configuration from defaults
lal configure
```

### Native (with lal)

If you already have `lal` installed, you can build `lal` with `lal`.

```sh
lal build
cp -v ./OUTPUT/bin/lal ~/bin/lal

# Pick up configuration updates by reconfiguring with the new binary
lal configure
```
This is our preferred way to update lal from source.
It doesn't use `docker` if you don't have it, as it uses your local rustup toolchains.
The compiled binary is statically linked, using our configuration options by default.

### Docker (with muslrust)

If you have `docker` and `lal` installed, but don't have a rust compiler, you can use our shared toolchain.

```sh
# Set a temporary override to use a prepared `rust` environment.
lal env set rust

lal build
cp -v ./OUTPUT/bin/lal ~/bin/lal
lal configure
```
The compiled binary is statically linked, using our build toolchain for reproducibility.

## Usage

### Creating a new component
Expand Down
28 changes: 0 additions & 28 deletions configs/demo.json

This file was deleted.

47 changes: 0 additions & 47 deletions configs/edonus.json

This file was deleted.

Loading