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
78 changes: 78 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Release
on: workflow_dispatch
jobs:
create-release:
runs-on: ubuntu-latest
outputs:
release_id: ${{ steps.create.outputs.id }}
release_url: ${{ steps.create.outputs.upload_url }}
steps:
- name: create release
id: create
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: latest
release_name: latest
draft: true
prerelease: false
build:
needs: create-release
runs-on: ubuntu-latest
strategy:
matrix:
platform: ["amd64", "arm64/v8"]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't "arm64" suffice?

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
- name: build docker environment
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/${{ matrix.platform }}
push: false
tags: instrew-env
- name: build instrew
run: docker run --rm -v "$PWD"/:/instrew/ instrew-env
- name: generate artifact name
uses: mad9000/actions-find-and-replace-string@5
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above how this might not be needed, but anyway I'd like to keep things rather simple/dumb, i.e. prefer a few shell commands over dependencies from some random people.

id: artifact-name
with:
source: instrew-${{ matrix.platform }}.tar.gz
find: '/'
replace: ''
- name: bundle instrew
run: mv install instrew && tar -czf ${{ steps.artifact-name.outputs.value }} instrew
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But.. only a single file (bin/instrew) should be needed?

- name: upload release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.release_url }}
asset_path: ./${{ steps.artifact-name.outputs.value }}
asset_name: ${{ steps.artifact-name.outputs.value }}
asset_content_type: application/gzip
publish-release:
needs:
- create-release
- build
runs-on: ubuntu-latest
steps:
- name: delete-previous-release
uses: dev-drprasad/delete-older-releases@v0.2.0
with:
keep_latest: 0
delete_tags: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: publish release
uses: eregon/publish-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ needs.create-release.outputs.release_id }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/*.sublime-*
/build*
/build/*
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, this breaks my workflow. I have multiple build folders for different LLVM versions, compilers, and debug/release. 😅

/install
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# build this docker image for a clean environemnt to build instrew
FROM ubuntu:24.04
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debian > Ubuntu. I'd rather build on an older distribution (e.g. Debian stable)?


# install dependencies
RUN apt update \
&& apt install -y gnupg wget meson cmake pkg-config libssl-dev clang

# install LLVM
RUN wget --no-check-certificate -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -\
&& echo 'deb http://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-17 main' >> /etc/apt/sources.list \
&& apt update \
&& apt install -y llvm-17 \
&& update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-17 17
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use LLVM from standard repositories -- I don't see a benefit of not doing so. Simple is better.


# create mount point for project
RUN mkdir /instrew/

# build and test project
WORKDIR /instrew/
CMD /instrew/build.sh
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ Instrew is a performance-targeted transparent dynamic binary translator(/instrum
After cloning and checking out submodules, compile Instrew as follows:

```
mkdir build
meson build -Dbuildtype=release
ninja -C build
# optionally, run tests
ninja -C build test
./build.sh
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, no. I'm not going down the build.sh path. Anyone who wants to build this software should be able to type those four, fairly standard, commands, which also show how to modify the build.

```

If your build has dependency issues, consider using the provided dockerfile
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. I'm not using containers that much, so I'm not likely to catch breakage... I'd probably prefer to explicitly list dependencies here rather than referencing some Dockerfile I'm not going to use myself.

```
docker build . --tag instrew-env # run once
docker run --rm -v "$PWD"/:/instrew instrew-env # run to build instrew
```

Afterwards, you can run an application with Instrew. Statically linked applications often have a significantly lower translation time. New glibc versions often tend to use recent syscalls that are not yet supported, therefore warnings about missing system calls can sometimes be ignored.
Expand Down
7 changes: 7 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

mkdir -p build
meson build -Dprefix="$PWD"/install -Dbuildtype=release
ninja -C build
ninja -C build test
ninja -C build install