Skip to content

Commit

Permalink
Add musl offsets
Browse files Browse the repository at this point in the history
Signed-off-by: Kemal Akkoyun <[email protected]>
  • Loading branch information
kakkoyun committed Feb 22, 2024
1 parent b5a0597 commit 480cf1e
Show file tree
Hide file tree
Showing 25 changed files with 949 additions and 9 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/generate-musl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Generate musl
on:
workflow_call:
push:
branches:
- main
- release
paths:
- ".github/workflows/generate-musl.yml"
- "pkg/libc/musl"
- "scripts"
- "Makefile"

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
generate-and-create-branch:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Check out the code
uses: actions/checkout@v4

- name: Install devbox
uses: jetpack-io/[email protected]
with:
enable-cache: true

- name: Setup devbox
run: devbox run -- echo "done!"

- name: Load devbox shellenv
uses: HatsuneMiku3939/direnv-action@v1
with:
direnvVersion: 2.32.3

- name: Set up Go tool cache
uses: actions/cache@v4
with:
path: ~/.devbox/go
key: devbox-go-tools.cache-${{ runner.os }}-${{ runner.arch }}

- name: Build
run: make build

- name: Set up cache for downloaded files
uses: actions/cache@v4
with:
path: workspace-musl
key: musl-downloaded-${{ runner.os }}-${{ matrix.arch }}
restore-keys: |
musl-downloaded-${{ runner.os }}-${{ matrix.arch }}
- name: Generate musl Offsets
run: |
TEMP_DIR=workspace-musl make generate/musl
# If there are no changes (i.e. no diff exists with the checked-out base branch),
# no pull request will be created and the action exits silently.
- name: Create a pull-request
if: github.event_name != 'pull_request'
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "chore: update musl layouts"
title: "chore: Update musl layouts"
branch: update-offsets-musl-${{ github.run_number }}
add-paths: pkg/libc/musl/layout
base: main
labels: chore
draft: false
delete-branch: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ tmp
/mergelayout
/debdownload
/debuginfofind
/apkdownload
/main
18 changes: 15 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,18 @@ mergelayout: cmd/mergelayout/mergelayout.go $(filter-out *_test.go,$(GO_SRC))
debdownload: cmd/debdownload/debdownload.go $(filter-out *_test.go,$(GO_SRC))
go build -o $@ $<

apkdownload: cmd/apkdownload/apkdownload.go $(filter-out *_test.go,$(GO_SRC))
go build -o $@ $<

debuginfofind: cmd/debuginfofind/debuginfofind.go $(filter-out *_test.go,$(GO_SRC))
go build -o $@ $<

.PHONY: build
build: structlayout mergelayout debdownload debuginfofind
build: structlayout mergelayout debdownload apkdownload debuginfofind
go build ./...

.PHONY: generate
generate: build generate/python generate/ruby generate/glibc
generate: build generate/python generate/ruby generate/glibc generate/musl

.PHONY: generate/python
generate/python:
Expand All @@ -42,6 +45,12 @@ generate/glibc:
./scripts/structlayout/glibc.sh
./scripts/mergelayout/glibc.sh

.PHONY: generate/musl
generate/musl:
./scripts/download/musl.sh
./scripts/structlayout/musl.sh
./scripts/mergelayout/musl.sh

.PHONY: clean
clean:
rm -rf target
Expand Down Expand Up @@ -97,10 +106,13 @@ $(TMPDIR)/mergelayout-help.txt: $(TMPDIR) ./cmd/mergelayout/mergelayout.go
$(TMPDIR)/debdownload-help.txt: $(TMPDIR) ./cmd/debdownload/debdownload.go
go run ./cmd/debdownload/debdownload.go -h > $@ 2>&1

$(TMPDIR)/apkdownload-help.txt: $(TMPDIR) ./cmd/apkdownload/apkdownload.go
go run ./cmd/apkdownload/apkdownload.go -h > $@ 2>&1

$(TMPDIR)/debuginfofind-help.txt: $(TMPDIR) ./cmd/debuginfofind/debuginfofind.go
go run ./cmd/debuginfofind/debuginfofind.go -h > $@ 2>&1

.PHONY: README.md
README.md: $(TMPDIR)/structlayout-help.txt $(TMPDIR)/mergelayout-help.txt $(TMPDIR)/debdownload-help.txt $(TMPDIR)/debuginfofind-help.txt
README.md: $(TMPDIR)/structlayout-help.txt $(TMPDIR)/mergelayout-help.txt $(TMPDIR)/debdownload-help.txt $(TMPDIR)/debuginfofind-help.txt $(TMPDIR)/apkdownload-help.txt
go run github.com/campoy/embedmd/v2@latest -w README.md
devbox generate readme CONTRIBUTING.md
Loading

0 comments on commit 480cf1e

Please sign in to comment.