Skip to content

Commit aeaaa42

Browse files
committed
Merge branch '0.15-maintenance' into 0.16-maintenance
2 parents 438d23e + db8cbe9 commit aeaaa42

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1250
-432
lines changed

.editorconfig

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# EditorConfig configuration for PatchELF
2+
# http://EditorConfig.org
3+
4+
# Top-most EditorConfig file
5+
root = true
6+
7+
# Unix-style newlines with a newline ending every file, UTF-8 charset
8+
[*]
9+
end_of_line = lf
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
charset = utf-8
13+
14+
# Match Nix files, set indent to spaces with width of two
15+
[*.nix]
16+
indent_style = space
17+
indent_size = 2
18+
19+
# Match C++/C/shell, set indent to spaces with width of four
20+
[*.{hpp,cc,hh,c,h,sh}]
21+
indent_style = space
22+
indent_size = 4
23+
24+
# Match diffs, avoid to trim trailing whitespace
25+
[*.{diff,patch}]
26+
trim_trailing_whitespace = false

.git-blame-ignore-revs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Manual nixfmt run
2+
706478750fc8574ed816ef746d3ad3790b2ea66a

.github/workflows/ci.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
name: "CI"
22
on:
33
pull_request:
4+
merge_group:
45
push:
56
jobs:
7+
shellcheck:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- run: shellcheck tests/*.sh
612
nix:
713
runs-on: ubuntu-latest
814
steps:
9-
- uses: actions/checkout@v3
10-
- uses: cachix/install-nix-action@v18
15+
- uses: actions/checkout@v4
16+
- uses: cachix/install-nix-action@v31
1117
- run: nix-build -A hydraJobs.release
1218
ubuntu:
1319
runs-on: ubuntu-latest
1420
steps:
15-
- uses: actions/checkout@v3
21+
- uses: actions/checkout@v4
1622
- name: get toolchain version
1723
run: |
1824
c++ --version

.github/workflows/publish.yml

Lines changed: 64 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Publish
22
on:
33
pull_request:
4+
merge_group:
45
push:
56
branches:
67
- '*'
@@ -13,19 +14,54 @@ jobs:
1314
runs-on: ubuntu-latest
1415
steps:
1516
- name: Checkout
16-
uses: actions/checkout@v3
17-
- uses: cachix/install-nix-action@v18
17+
uses: actions/checkout@v4
18+
- uses: cachix/install-nix-action@v31
1819
- name: Build tarballs
1920
run: |
20-
nix-build -A hydraJobs.tarball
21+
nix build -L .#hydraJobs.tarball
2122
install -D ./result/tarballs/*.tar.bz2 ./dist/patchelf-$(cat version).tar.bz2
2223
install -D ./result/tarballs/*.tar.gz ./dist/patchelf-$(cat version).tar.gz
23-
- uses: actions/upload-artifact@v3
24+
- uses: actions/upload-artifact@v4
2425
with:
25-
name: patchelf
26+
name: patchelf-tarball
2627
path: dist/*
2728

28-
build_binaries:
29+
build_windows:
30+
name: Build windows executable
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@v4
35+
- uses: cachix/install-nix-action@v31
36+
- name: Build windows executable
37+
run: |
38+
nix build -L .#patchelf-win32 .#patchelf-win64
39+
install -D ./result/bin/patchelf.exe ./dist/patchelf-win32-$(cat version).exe
40+
install -D ./result-1/bin/patchelf.exe ./dist/patchelf-win64-$(cat version).exe
41+
- uses: actions/upload-artifact@v4
42+
with:
43+
name: patchelf-windows
44+
path: dist/*
45+
46+
test_windows:
47+
name: Test windows binaries
48+
needs: [build_windows]
49+
runs-on: windows-latest
50+
steps:
51+
- uses: actions/checkout@v4
52+
- uses: actions/download-artifact@v5
53+
with:
54+
name: patchelf-windows
55+
path: dist
56+
- name: Show binaries
57+
run: dir .\\dist
58+
- name: Test windows 64-bit binary
59+
run: .\\dist\\patchelf-win32-*.exe --version
60+
61+
- name: Test windows 32-bit binary
62+
run: .\\dist\\patchelf-win64-*.exe --version
63+
64+
build_musl:
2965
name: Build static musl binaries
3066
needs: [build_tarballs]
3167
runs-on: ubuntu-latest
@@ -36,11 +72,21 @@ jobs:
3672
steps:
3773
- name: Set up QEMU
3874
if: matrix.platform != 'amd64'
39-
uses: docker/setup-qemu-action@v2
75+
uses: docker/setup-qemu-action@v3
76+
77+
- name: Set docker arch
78+
run: |
79+
platform=${{ matrix.platform }}
80+
if [[ $platform == arm64v8 ]]; then
81+
platform=arm64
82+
elif [[ $platform == arm32v7 ]]; then
83+
platform=arm
84+
fi
85+
echo "DOCKER_PLATFORM=$platform" >> $GITHUB_ENV
4086
41-
- uses: actions/download-artifact@v3
87+
- uses: actions/download-artifact@v5
4288
with:
43-
name: patchelf
89+
name: patchelf-tarball
4490
path: dist
4591
- name: Build binaries
4692
env:
@@ -54,7 +100,7 @@ jobs:
54100
rm -f dist/*
55101
cd patchelf-*
56102
./configure --prefix /patchelf
57-
make check
103+
make check || (cat tests/test-suite.log; exit 1)
58104
make install-strip
59105
cd -
60106
tar -czf ./dist/patchelf-\$(cat patchelf-*/version)-\$(uname -m).tar.gz -C /patchelf .
@@ -65,7 +111,7 @@ jobs:
65111
else
66112
ENTRYPOINT=
67113
fi
68-
docker run -e CXXFLAGS -v $(pwd):/gha ${{ matrix.platform }}/alpine:edge ${ENTRYPOINT} sh -ec "cd /gha && sh ./build.sh"
114+
docker run --platform "$DOCKER_PLATFORM" -e CXXFLAGS -v $(pwd):/gha ${{ matrix.platform }}/alpine:edge ${ENTRYPOINT} sh -ec "cd /gha && sh ./build.sh"
69115
- name: Check binaries
70116
run: |
71117
cat <<EOF > check.sh
@@ -74,21 +120,22 @@ jobs:
74120
tar -xf ./dist/patchelf-*-*.tar.gz
75121
./bin/patchelf --version
76122
EOF
77-
docker run -v $(pwd):/gha ${{ matrix.platform }}/debian:unstable-slim sh -ec "cd /gha && sh ./check.sh"
78-
- uses: actions/upload-artifact@v3
123+
docker run --platform "$DOCKER_PLATFORM" -v $(pwd):/gha ${{ matrix.platform }}/debian:unstable-slim sh -ec "cd /gha && sh ./check.sh"
124+
- uses: actions/upload-artifact@v4
79125
with:
80-
name: patchelf
126+
name: patchelf-${{ matrix.platform }}
81127
path: dist/*
82128

83129
publish:
84130
name: Publish tarballs & binaries
85-
needs: [build_tarballs, build_binaries]
131+
needs: [build_tarballs, build_windows, build_musl]
86132
if: github.event_name == 'push' && github.repository == 'NixOS/patchelf' && startsWith(github.ref, 'refs/tags/')
87133
runs-on: ubuntu-latest
88134
steps:
89-
- uses: actions/download-artifact@v3
135+
- uses: actions/download-artifact@v5
90136
with:
91-
name: patchelf
137+
pattern: patchelf-*
138+
merge-multiple: true
92139
path: dist
93140
- name: Upload binaries to release
94141
uses: svenstaro/upload-release-action@v2

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Makefile
1818
.deps
1919
*.o
2020

21+
CMakeLists.txt.user
22+
2123
/tests/*.log
2224
/tests/*.trs
2325
/tests/no-rpath
@@ -32,6 +34,7 @@ Makefile
3234
/tests/libbig-dynstr.debug
3335
/tests/contiguous-note-sections
3436
/tests/simple-pie
37+
/tests/simple-execstack
3538

3639
.direnv/
3740
.vscode/

.mergify.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
queue_rules:
2+
- name: default
3+
merge_conditions:
4+
- check-success=Build static musl binaries (amd64)
5+
- check-success=Build static musl binaries (arm32v7)
6+
- check-success=Build static musl binaries (arm64v8)
7+
- check-success=Build static musl binaries (i386)
8+
- check-success=Build static musl binaries (ppc64le)
9+
- check-success=Build static musl binaries (riscv64)
10+
- check-success=Build static musl binaries (s390x)
11+
- check-success=Build tarballs
12+
- check-success=Build windows executable
13+
- check-success=Publish tarballs & binaries
14+
- check-success=Test windows binaries
15+
- check-success=nix
16+
- check-success=shellcheck
17+
- check-success=ubuntu
18+
merge_method: rebase
19+
batch_size: 5
20+
pull_request_rules:
21+
- name: merge using the merge queue
22+
conditions:
23+
- base=master
24+
- label~=merge-queue|dependencies
25+
actions:
26+
queue: {}

CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
cmake_minimum_required(VERSION 3.5)
2+
3+
project(patchelf)
4+
5+
file(READ version VERSION)
6+
7+
include(GNUInstallDirs)
8+
9+
add_subdirectory(src)
10+
# add_subdirectory(tests) # TODO
11+
12+
install(FILES patchelf.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
13+
14+
install(FILES README.md DESTINATION ${CMAKE_INSTALL_DOCDIR})

COPYING

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
GNU GENERAL PUBLIC LICENSE
22
Version 3, 29 June 2007
33

4-
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
4+
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
55
Everyone is permitted to copy and distribute verbatim copies
66
of this license document, but changing it is not allowed.
77

@@ -645,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found.
645645
GNU General Public License for more details.
646646

647647
You should have received a copy of the GNU General Public License
648-
along with this program. If not, see <http://www.gnu.org/licenses/>.
648+
along with this program. If not, see <https://www.gnu.org/licenses/>.
649649

650650
Also add information on how to contact you by electronic and paper mail.
651651

@@ -664,11 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
664664
You should also get your employer (if you work as a programmer) or school,
665665
if any, to sign a "copyright disclaimer" for the program, if necessary.
666666
For more information on this, and how to apply and follow the GNU GPL, see
667-
<http://www.gnu.org/licenses/>.
667+
<https://www.gnu.org/licenses/>.
668668

669669
The GNU General Public License does not permit incorporating your program
670670
into proprietary programs. If your program is a subroutine library, you
671671
may consider it more useful to permit linking proprietary applications with
672672
the library. If this is what you want to do, use the GNU Lesser General
673673
Public License instead of this License. But first, please read
674-
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
674+
<https://www.gnu.org/philosophy/why-not-lgpl.html>.

0 commit comments

Comments
 (0)