-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates for patch files and minor build script tweaks
- Loading branch information
1 parent
81dcf97
commit 2eba319
Showing
15 changed files
with
472 additions
and
448 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ env: | |
|
||
jobs: | ||
build: | ||
name: ${{ inputs.BuildPkg == 'script' && 'Run Script' || 'Build Package' }} | ||
name: ${{ inputs.BuildPkg == 'script' && 'Run Script' || 'Build Package' }} - ${{matrix.Configuration}} | ||
runs-on: windows-2022 | ||
environment: main | ||
outputs: | ||
|
@@ -45,7 +45,7 @@ jobs: | |
#BuildPkg: [grep] | ||
# BuildPkg: [which,patch,zstd,pcre2,gzip,tar,zlib,findutils,libpsl,coreutils,grep] | ||
BaseImage: [windows-latest] | ||
Configuration: [Debug] | ||
Configuration: [Debug, Release] #right now the deps downloader always downloads release versions, we could use our debug libs for debug builds | ||
Arch: [x64] | ||
#BaseImage: [windows-latest, ubuntu-latest] | ||
#Configuration: [Debug, Release] | ||
|
@@ -63,6 +63,7 @@ jobs: | |
env: | ||
BUILD_PKG: ${{inputs.BuildPkg}} | ||
SCRIPT: ${{inputs.Script}} | ||
Configuration: ${{matrix.Configuration}} | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
|
@@ -73,6 +74,9 @@ jobs: | |
$dir=$dir.replace("\","/") | ||
echo "WLB_SCRIPT_FOLDER=$dir" >> $env:GITHUB_ENV | ||
mkdir $env:WLB_BASE_FOLDER | ||
if ($env:Configuration -eq "Debug"){ | ||
echo "BLD_CONFIG_BUILD_DEBUG=1" >> $env:GITHUB_ENV | ||
} | ||
# - uses: actions/[email protected] | ||
# with: | ||
|
@@ -139,7 +143,7 @@ jobs: | |
if: ${{ inputs.BuildPkg != 'script' }} | ||
shell: powershell | ||
working-directory: ${{env.WLB_BASE_FOLDER}} | ||
run: ${{env.WLB_SCRIPT_FOLDER}}/vs_msys_shell_launch.ps1 "${{env.WLB_SCRIPT_FOLDER}}/build/f_$($env:BUILD_PKG)_build.sh" | ||
run: ${{env.WLB_SCRIPT_FOLDER}}/vs_msys_shell_launch.ps1 "${{env.WLB_SCRIPT_FOLDER}}/build/f_$($env:BUILD_PKG)_build.sh" log_raw_build #raw build gets us a .bat file for compiling, without msys but runs make -j 1 so is much slower than without | ||
|
||
- name: Run Script | ||
id: script_step | ||
|
@@ -155,6 +159,6 @@ jobs: | |
- uses: actions/[email protected] | ||
if: ${{ inputs.BuildPkg != 'script' }} | ||
with: | ||
name: WLB-${{env.BUILD_PKG}} | ||
name: WLB-${{env.BUILD_PKG}}${{matrix.Configuration=='Debug' && '-Debug' || ''}} | ||
path: ${{env.WLB_BASE_FOLDER}}/${{env.BUILD_PKG}}/final | ||
if-no-files-found: error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"folders": [ | ||
{ | ||
"path": "." | ||
} | ||
], | ||
"settings": { | ||
"files.associations": { | ||
"*.json": "jsonc", | ||
"config.h": "c", | ||
"vmsdir.h": "c", | ||
"*.pc": "c", | ||
"types.h": "c" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
#!/bin/bash | ||
|
||
OUR_PATH="$(readlink -f "$0")"; | ||
CALL_CMD="$1" | ||
|
||
SCRIPT_FOLDER="$(dirname "${OUR_PATH}")" | ||
if [[ ! -z "$WLB_SCRIPT_FOLDER" ]]; then | ||
SCRIPT_FOLDER="${WLB_SCRIPT_FOLDER}" | ||
fi | ||
. "$SCRIPT_FOLDER/helpers.sh" "${CALL_CMD}" "${OUR_PATH}" | ||
|
||
PreInitialize; | ||
#BLD_CONFIG_LOG_ON_AT_INIT=0 | ||
|
||
|
||
BLD_CONFIG_BUILD_NAME="rsync"; | ||
BLD_CONFIG_CONFIG_CMD_ADDL="--enable-lz4 --disable-md2man" #--disable-nls --enable-static | ||
BLD_CONFIG_ADD_WIN_ARGV_LIB=0 | ||
#BLD_CONFIG_GNU_LIBS_USED=0 | ||
#BLD_CONFIG_GNU_LIBS_BUILD_AUX_ONLY_USED=1 | ||
#BLD_CONFIG_LOG_FILE_AUTOTAIL=0 | ||
|
||
#BLD_CONFIG_LOG_EXPAND_VARS=1 | ||
BLD_CONFIG_GNU_LIBS_ADDL=( "getsockopt" "strcase" "strerror" "getaddrinfo" "setsockopt" "sleep" "getsockname" "getpeername" "ioctl" "alloca" "alloca-opt" "socket" "bind" "symlink" "unistd" "fsync" "gettimeofday" "sys_socket" "lock" "flock" "signal-h" "sys_ioctl" "symlink" "symlinkat" "unlinkat" "netinet_in" "arpa_inet" "dirent" "sys_stat" "sys_types" "sys_file" "stdbool" "stat-time" "dirname" "attribute" "dirfd" "dup2" "readlink" "stat-macros" "lstat" "stat-size" "stat-time" "open" "openat" "stdopen" "fcntl" "fcntl-h" "errno" ) | ||
|
||
# Set DO_EXPAND_OF_LOGGED_VARS=1 # set this to expand vars in log - so this works well but this is the only way I found to properly log the current command in a reproducible form. It is exceptionally slow. | ||
# after including this script have: | ||
function ourmain() { | ||
startcommon; | ||
#CFLAGS="-I ./lib/" | ||
add_lib_pkg_config "zstd" | ||
add_vcpkg_pkg_config "openssl" "xxhash" "lz4" | ||
pkg_config_manual_add "libzstd" "openssl" "libxxhash" "liblz4" | ||
|
||
if test 5 -gt 100; then | ||
echo "Just move the fi down as you want to skip steps" | ||
#fi | ||
|
||
git clone --recurse-submodules https://github.com/WayneD/rsync.git . | ||
|
||
git clone --recurse-submodules https://github.com/coreutils/gnulib | ||
cp gnulib/build-aux/bootstrap . | ||
cp gnulib/build-aux/bootstrap.conf . | ||
#it doesn't use extras so we can just ad ours, they use paxutils to gnulib everyhting | ||
echo "gnulib_tool_option_extras=\" --without-tests --symlink\"" >> bootstrap.conf | ||
gnulib_switch_to_master_and_patch; | ||
fi | ||
gnulib_add_addl_modules_to_bootstrap; | ||
|
||
setup_gnulibtool_py_autoconfwrapper #needed for generated .mk/.ac files but if just stock then the below line likely works | ||
#gnulib_tool_py_remove_nmd_makefiles; | ||
./bootstrap --no-bootstrap-sync --no-git --gnulib-srcdir=gnulib --skip-po --force | ||
|
||
add_items_to_gitignore; | ||
|
||
cd $BLD_CONFIG_SRC_FOLDER | ||
vcpkg_install_package "openssl" "xxhash" "lz4" | ||
# pkg_config_manual_add "libzstd" "openssl" "libxxhash" "liblz4" | ||
#fi | ||
|
||
#not sure why we have to do this somethinng isnnt autogening right or nwe need lib moved up in the make order | ||
cp c:/software/gnulib/build-aux/compile "${BLD_CONFIG_BUILD_AUX_FOLDER}/" | ||
#sometimes runnning make requires re-running make | ||
# | ||
|
||
cd $BLD_CONFIG_SRC_FOLDER | ||
#fi | ||
configure_fixes; | ||
configure_run || (./config.status --recheck && configure_run); | ||
|
||
|
||
setup_build_env; | ||
cd $BLD_CONFIG_SRC_FOLDER/lib && (make || make) | ||
cd $BLD_CONFIG_SRC_FOLDER | ||
make | ||
make install | ||
|
||
finalcommon; | ||
} | ||
ourmain; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
patches/patches_GNULIB_MSVC_PARAMETER_HANDLER_M4_MACRO_FIX.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff --git a/m4/printf.m4 b/m4/printf.m4 | ||
index 8b8f01067f..198e3363b7 100644 | ||
--- a/m4/printf.m4 | ||
+++ b/m4/printf.m4 | ||
@@ -908,6 +908,7 @@ int main () | ||
{ | ||
int count = -1; | ||
#ifdef _MSC_VER | ||
+ _set_error_mode(1); #1 being _OUT_TO_STDERR, disable abort/retry/ignore popup in debug mode | ||
_set_invalid_parameter_handler (invalid_parameter_handler); | ||
#endif | ||
/* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
diff --git a/lib/poll.c b/lib/poll.c | ||
index ec8d2c2b55..80a68aff03 100644 | ||
--- a/lib/poll.c | ||
+++ b/lib/poll.c | ||
@@ -364,6 +364,11 @@ compute_revents (int fd, int sought, fd_set *rfds, fd_set *wfds, fd_set *efds) | ||
} | ||
#endif /* !MinGW */ | ||
|
||
+#ifdef _WIN32 | ||
+#define THREAD_LOCAL static __declspec( thread ) | ||
+#else | ||
+#define THREAD_LOCAL static thread_local | ||
+#endif | ||
int | ||
poll (struct pollfd *pfd, nfds_t nfd, int timeout) | ||
{ | ||
@@ -463,11 +468,13 @@ poll (struct pollfd *pfd, nfds_t nfd, int timeout) | ||
return rc; | ||
#else | ||
static struct timeval tv0; | ||
- static HANDLE hEvent; | ||
+ THREAD_LOCAL HANDLE hEvent; //note if you don't want to use thread local and this could be called from multiple threads you should make this a standard local var and use CloseHandle before any returns | ||
WSANETWORKEVENTS ev; | ||
HANDLE h, handle_array[FD_SETSIZE + 2]; | ||
DWORD ret, wait_timeout, nhandles; | ||
fd_set rfds, wfds, xfds; | ||
+ fd_set orig_rfds, orig_wfds, orig_xfds; | ||
+ | ||
BOOL poll_again; | ||
MSG msg; | ||
int rc = 0; | ||
@@ -539,6 +546,9 @@ restart: | ||
timeout = 0; | ||
} | ||
} | ||
+ orig_rfds = rfds; | ||
+ orig_wfds = wfds; | ||
+ orig_xfds = xfds; | ||
|
||
if (select (0, &rfds, &wfds, &xfds, &tv0) > 0) | ||
{ | ||
@@ -575,8 +585,13 @@ restart: | ||
break; | ||
} | ||
|
||
- if (poll_again) | ||
- select (0, &rfds, &wfds, &xfds, &tv0); | ||
+ if (poll_again) { | ||
+ rfds = orig_rfds; | ||
+ wfds = orig_wfds; | ||
+ xfds = orig_xfds; | ||
+ if (select(0, &rfds, &wfds, &xfds, &tv0) == SOCKET_ERROR) | ||
+ return -1; | ||
+ } | ||
|
||
/* Place a sentinel at the end of the array. */ | ||
handle_array[nhandles] = NULL; | ||
@@ -632,3 +647,21 @@ restart: | ||
return rc; | ||
#endif | ||
} | ||
+#define MIN_TIMEOUT_FIX_MS 50 | ||
+int poll_retry(struct pollfd* pfd, nfds_t nfd, int timeout, int max_retries) { | ||
+ DWORD startTime; | ||
+ BOOL retryTrack = timeout > 0 && timeout != INFTIM && timeout > MIN_TIMEOUT_FIX_MS; | ||
+ if (retryTrack) | ||
+ startTime = GetTickCount(); | ||
+ int rc = 0; | ||
+ for (int x = 0; x < max_retries; x++) { | ||
+ rc = poll(pfd, nfd, timeout); | ||
+ if (rc != 0 || !retryTrack) | ||
+ return rc; | ||
+ int msElapsed = GetTickCount() - startTime; | ||
+ if (msElapsed < 0 || (timeout - MIN_TIMEOUT_FIX_MS) < msElapsed)//if it got the timing within MIN_TIMEOUT_FIX_MS of the timer consider us good | ||
+ return rc; | ||
+ SleepEx(1, TRUE); | ||
+ } | ||
+ return rc; | ||
+} | ||
\ No newline at end of file | ||
diff --git a/lib/poll.in.h b/lib/poll.in.h | ||
index 75ca21f4cc..2d57f3ffdb 100644 | ||
--- a/lib/poll.in.h | ||
+++ b/lib/poll.in.h | ||
@@ -124,7 +124,7 @@ _GL_WARN_ON_USE (poll, "poll is unportable - " | ||
"use gnulib module poll for portability"); | ||
# endif | ||
#endif | ||
- | ||
+int poll_retry(struct pollfd* pfd, nfds_t nfd, int timeout, int max_retries); | ||
|
||
#endif /* _@GUARD_PREFIX@_POLL_H */ | ||
#endif /* _@GUARD_PREFIX@_POLL_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.