Skip to content

Commit 446eb16

Browse files
committed
Update Windows build workflow for static linking and remove process termination in SFX test
1 parent be610c1 commit 446eb16

File tree

3 files changed

+3
-11
lines changed

3 files changed

+3
-11
lines changed

.github/workflows/go_build_linux_386.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,4 @@ jobs:
5151
go build -trimpath -tags yara_static -a -ldflags '-s -w -extldflags "-static"' -o fastfinder-386 .
5252
ls -l fastfinder-386
5353
sudo chmod +x fastfinder-386
54+
sudo ./fastfinder-amd64 -h

.github/workflows/go_build_windows_386.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
cd /tmp && unzip yara.zip
3636
cd /tmp/yara-4.5.5
3737
./bootstrap.sh
38-
./configure --prefix=/mingw32 --host=i686-w64-mingw32
38+
./configure --prefix=/mingw32 --host=i686-w64-mingw32 --disable-crypto --enable-static --disable-shared
3939
make -j$(nproc)
4040
make install
4141
@@ -56,7 +56,7 @@ jobs:
5656
export GOOS=windows
5757
export GOARCH=386
5858
# Force static linking for MinGW-w64
59-
export CGO_LDFLAGS="-L/mingw32/lib -lyara -lssl -lcrypto -lws2_32 -limagehlp -static"
59+
export CGO_LDFLAGS="-L/mingw32/lib -lyara -lws2_32 -limagehlp -static"
6060
6161
go build -v -ldflags "-s -w -extldflags '-static'" -tags yara_static,yara_no_pkg_config -o fastfinder-386.exe .
6262
ls -l fastfinder-386.exe

sfx_integration_test.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,6 @@ output:
107107
}
108108
t.Log("SFX created.")
109109

110-
// Cleanup previous potential collisions in system temp (since SFX extracts there)
111-
// The SFX stub is configured (in utils_windows.go/utils_linux.go) to extract to %TEMP% or /tmp.
112-
// We try to remove 'fastfinder' or 'fastfinder.exe' from there to avoid "Cannot create output files" if locked.
113-
// Force kill any lingering fastfinder process that might hold the file lock
114-
if runtime.GOOS == "windows" {
115-
_ = exec.Command("taskkill", "/F", "/IM", "fastfinder.exe").Run()
116-
} else {
117-
_ = exec.Command("pkill", "-x", "fastfinder").Run()
118-
}
119110
// Give OS time to release handle
120111
time.Sleep(500 * time.Millisecond)
121112

0 commit comments

Comments
 (0)