Skip to content

Commit

Permalink
Update action
Browse files Browse the repository at this point in the history
- Should create reproducible builds now
- Temporarily pin random seed for compiler
  • Loading branch information
maweil committed Oct 12, 2024
1 parent 0b3a521 commit fd929d0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 32 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ on:
jobs:
build:
runs-on: ubuntu-latest
container: registry.fedoraproject.org/fedora:37
container: registry.fedoraproject.org/fedora:40
steps:
- name: Install Dependencies
run: dnf install -y -q mingw64-gcc make wget tar

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Download make release tar.gz file
run: wget "https://ftpmirror.gnu.org/make/$(cat build_version.sha256sum | cut -d ' ' -f3)"
Expand All @@ -26,7 +26,7 @@ jobs:
- name: Hash the built binaries
run: sha256sum make-*/dist/*

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: make-bin-win64
path: ./make-*/dist/
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
FROM registry.fedoraproject.org/fedora:37
RUN dnf install -y mingw64-gcc wine-core
FROM registry.fedoraproject.org/fedora:40
RUN dnf install -y mingw64-gcc make wine-core
31 changes: 4 additions & 27 deletions cross_build_w64.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,5 @@
#!/usr/bin/bash
set -e
copy_dependent_dlls(){
local parent_exe_or_dll="$1"
local dll_source_dir="/usr/$host_triplet"
local all_dlls=($(x86_64-w64-mingw32-objdump -p "$parent_exe_or_dll" | grep 'DLL Name:' | sed -e "s/\t*DLL Name: //g"))
for dll_name in ${all_dlls[@]}
do
echo "Searching $dll_name" in $dll_source_dir
find "$dll_source_dir" -name "$dll_name" -exec cp "{}" ./dist \;
dist_dll_path="./dist/$dll_name"
if [[ -f "$dist_dll_path" ]]
then
copy_dependent_dlls "$dist_dll_path"
fi
done
}



# Verify tarball integrity first
echo "##############################"
Expand All @@ -40,19 +23,13 @@ mkdir -p install_target
echo "##########################################"
echo "Building $make_version for $host_triplet"
echo "##########################################"
# By default, --export-dynamic is used which is not supported for PE binaries.
# Therefore override the LDFLAGS accordingly
LDFLAGS='-Wl,--export-all-symbols -fstack-protector -lssp' mingw64-configure --without-guile
mingw64-configure --without-guile LDFLAGS='-Wl,--no-insert-timestamp' CFLAGS='-frandom-seed=123456789'
mingw64-make && mv make.exe ./dist

if [[ $? -eq 0 ]]
then
echo "#######################################"
echo "Copying needed shared libraries to dist"
echo "#######################################"

copy_dependent_dlls ./dist/make.exe

echo "################################"
echo "Build complete. Result in ./dist"
echo "Build complete. Result in ./$make_version/dist"
echo "SHA256 hash of the built binary: $(sha256sum ./dist/make.exe)"
echo "################################"
fi

0 comments on commit fd929d0

Please sign in to comment.