From c6847681a87e871a653994dbd38e4ffad9b1d675 Mon Sep 17 00:00:00 2001 From: Shlomi Fish Date: Wed, 12 Feb 2025 13:09:22 +0200 Subject: [PATCH] try to extract a template file --- .github/workflows/zeroperl.yml | 114 +------------------------------- tools/hintfile_wasi_template.sh | 110 ++++++++++++++++++++++++++++++ 2 files changed, 111 insertions(+), 113 deletions(-) create mode 100644 tools/hintfile_wasi_template.sh diff --git a/.github/workflows/zeroperl.yml b/.github/workflows/zeroperl.yml index 1d68895..0cdab2c 100644 --- a/.github/workflows/zeroperl.yml +++ b/.github/workflows/zeroperl.yml @@ -184,119 +184,7 @@ jobs: - name: Create WASI hint file shell: bash run: | - cat <<'EOF' > hintfile_wasi.sh - - # fix bizarre preprocessor bug - d_perl_lc_all_category_positions_init='define' - d_perl_lc_all_separator='undef' - d_perl_lc_all_uses_name_value_pairs='undef' - perl_lc_all_category_positions_init='{ 0, 1, 5, 2, 3, 4 }' - perl_lc_all_separator='' - - usemymalloc="n" - usedevel="n" - usemultiplicity="undef" - usenm='undef' - usemallocwrap="define" - d_procselfexe='undef' - d_dlopen='undef' - # Disable wait-related features - d_wait='undef' - d_waitpid='undef' - d_wait3='undef' - d_wait4='undef' - i_syswait='undef' # This tells perl not to include sys/wait.h - - i_grp='define' - i_pwd='define' - d_getpwnam='undef' - d_getpwent='undef' - d_getpwuid='undef' - d_getspnam='undef' - d_getpwnam_r='undef' - d_getpwent_r='undef' - d_getpwuid_r='undef' - d_getprpwnam='undef' - d_setpwent='undef' - d_setpwent_r='undef' - d_getgrnam='undef' - d_getgrgid='undef' - d_getgrent='undef' - d_getgrnam_r='undef' - d_getgrgid_r='undef' - d_getgrent_r='undef' - d_setgrent='undef' - d_setgrent_r='undef' - d_endgrent='undef' - d_endgrent_r='undef' - d_getuid='undef' - d_geteuid='undef' - d_getgid='undef' - d_getegid='undef' - - uselargefiles='define' - use64bitint='define' - useperlio='define' - usequadmath='undef' - usethreads='undef' - use64bitall='define' - - d_off64_t='define' - use_off64_t='define' - d_stat='define' - d_fstat='define' - d_lstat='define' - d_statblks='undef' - d_fstat64='define' - d_fdclose='undef' - d_dirnamlen='undef' - d_readdir64_r='define' - - quadtype='long long' - uquadtype='unsigned long long' - quadkind='3' - - d_setrgid='undef' - d_setruid='undef' - d_setproctitle='undef' - d_malloc_size='undef' - d_malloc_good_size='undef' - - d_clearenv='undef' - d_cuserid='undef' - d_eaccess='undef' - d_getspnam='undef' - d_msgctl='undef' - d_msgget='undef' - d_msgrcv='undef' - d_msgsnd='undef' - d_semget='undef' - d_semop='undef' - d_shmat='undef' - d_shmctl='undef' - d_shmdt='undef' - d_shmget='undef' - d_syscall='undef' - - - d_killpg='undef' - d_pause='undef' - - d_wait4='undef' - d_waitpid='undef' - d_vfork='undef' - d_pseudofork='undef' - i_pthread='undef' - d_pthread_atfork='undef' - d_pthread_attr_setscope='undef' - d_pthread_yield='undef' - - noextensions='Socket POSIX Time/HiRes Devel/Peek Sys/Syslog' - - ldflags='-static -lwasi-emulated-signal -lwasi-emulated-getpid -lwasi-emulated-process-clocks -lwasi-emulated-mman' - ccflags='$ccflags -DBIG_TIME -DNO_MATHOMS -Wno-implicit-function-declaration -D_WASI_EMULATED_PROCESS_CLOCKS -lwasi-emulated-process-clocks -D_WASI_EMULATED_GETPID -lwasi-emulated-getpid -D_GNU_SOURCE -D_POSIX_C_SOURCE -Wno-null-pointer-arithmetic -D_WASI_EMULATED_SIGNAL -lwasi-emulated-signal -include /opt/wasi-sdk/share/wasi-sysroot/include/wasm32-wasi/fcntl.h -I${{ github.workspace }}/stubs' - cppflags='-lm -Wno-implicit-function-declaration -DBIG_TIME -DNO_MATHOMS -D_WASI_EMULATED_PROCESS_CLOCKS -lwasi-emulated-process-clocks -D_WASI_EMULATED_GETPID -lwasi-emulated-getpid -D_GNU_SOURCE -D_POSIX_C_SOURCE -DSTANDARD_C -DPERL_USE_SAFE_PUTENV -D_WASI_EMULATED_SIGNAL -lwasi-emulated-signal -Wno-null-pointer-arithmetic -fno-strict-aliasing -pipe -fstack-protector-strong -include /opt/wasi-sdk/share/wasi-sysroot/include/wasm32-wasi/fcntl.h -I${{ github.workspace }}/stubs' - EOF + sed -e "s&\\[% github_workspace %\\]&${{ github.workspace }}&g" < tools/hintfile_wasi_template.sh > hintfile_wasi.sh - name: Install Perl (WASI build) shell: bash diff --git a/tools/hintfile_wasi_template.sh b/tools/hintfile_wasi_template.sh new file mode 100644 index 0000000..55b9d32 --- /dev/null +++ b/tools/hintfile_wasi_template.sh @@ -0,0 +1,110 @@ +# fix bizarre preprocessor bug +d_perl_lc_all_category_positions_init='define' +d_perl_lc_all_separator='undef' +d_perl_lc_all_uses_name_value_pairs='undef' +perl_lc_all_category_positions_init='{ 0, 1, 5, 2, 3, 4 }' +perl_lc_all_separator='' + +usemymalloc="n" +usedevel="n" +usemultiplicity="undef" +usenm='undef' +usemallocwrap="define" +d_procselfexe='undef' +d_dlopen='undef' +# Disable wait-related features +d_wait='undef' +d_waitpid='undef' +d_wait3='undef' +d_wait4='undef' +i_syswait='undef' # This tells perl not to include sys/wait.h + +i_grp='define' +i_pwd='define' +d_getpwnam='undef' +d_getpwent='undef' +d_getpwuid='undef' +d_getspnam='undef' +d_getpwnam_r='undef' +d_getpwent_r='undef' +d_getpwuid_r='undef' +d_getprpwnam='undef' +d_setpwent='undef' +d_setpwent_r='undef' +d_getgrnam='undef' +d_getgrgid='undef' +d_getgrent='undef' +d_getgrnam_r='undef' +d_getgrgid_r='undef' +d_getgrent_r='undef' +d_setgrent='undef' +d_setgrent_r='undef' +d_endgrent='undef' +d_endgrent_r='undef' +d_getuid='undef' +d_geteuid='undef' +d_getgid='undef' +d_getegid='undef' + +uselargefiles='define' +use64bitint='define' +useperlio='define' +usequadmath='undef' +usethreads='undef' +use64bitall='define' + +d_off64_t='define' +use_off64_t='define' +d_stat='define' +d_fstat='define' +d_lstat='define' +d_statblks='undef' +d_fstat64='define' +d_fdclose='undef' +d_dirnamlen='undef' +d_readdir64_r='define' + +quadtype='long long' +uquadtype='unsigned long long' +quadkind='3' + +d_setrgid='undef' +d_setruid='undef' +d_setproctitle='undef' +d_malloc_size='undef' +d_malloc_good_size='undef' + +d_clearenv='undef' +d_cuserid='undef' +d_eaccess='undef' +d_getspnam='undef' +d_msgctl='undef' +d_msgget='undef' +d_msgrcv='undef' +d_msgsnd='undef' +d_semget='undef' +d_semop='undef' +d_shmat='undef' +d_shmctl='undef' +d_shmdt='undef' +d_shmget='undef' +d_syscall='undef' + + +d_killpg='undef' +d_pause='undef' + +d_wait4='undef' +d_waitpid='undef' +d_vfork='undef' +d_pseudofork='undef' +i_pthread='undef' +d_pthread_atfork='undef' +d_pthread_attr_setscope='undef' +d_pthread_yield='undef' + +noextensions='Socket POSIX Time/HiRes Devel/Peek Sys/Syslog' + +ldflags='-static -lwasi-emulated-signal -lwasi-emulated-getpid -lwasi-emulated-process-clocks -lwasi-emulated-mman' +ccflags='$ccflags -DBIG_TIME -DNO_MATHOMS -Wno-implicit-function-declaration -D_WASI_EMULATED_PROCESS_CLOCKS -lwasi-emulated-process-clocks -D_WASI_EMULATED_GETPID -lwasi-emulated-getpid -D_GNU_SOURCE -D_POSIX_C_SOURCE -Wno-null-pointer-arithmetic -D_WASI_EMULATED_SIGNAL -lwasi-emulated-signal -include /opt/wasi-sdk/share/wasi-sysroot/include/wasm32-wasi/fcntl.h -I[% github_workspace %]/stubs' +cppflags='-lm -Wno-implicit-function-declaration -DBIG_TIME -DNO_MATHOMS -D_WASI_EMULATED_PROCESS_CLOCKS -lwasi-emulated-process-clocks -D_WASI_EMULATED_GETPID -lwasi-emulated-getpid -D_GNU_SOURCE -D_POSIX_C_SOURCE -DSTANDARD_C -DPERL_USE_SAFE_PUTENV -D_WASI_EMULATED_SIGNAL -lwasi-emulated-signal -Wno-null-pointer-arithmetic -fno-strict-aliasing -pipe -fstack-protector-strong -include /opt/wasi-sdk/share/wasi-sysroot/include/wasm32-wasi/fcntl.h -I[% github_workspace %]/stubs'