The unpac monorepo manager self-hosting as a monorepo using unpac
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Disable winpthreads compilation and remove the winpthreads submodule

+14 -263
+1 -2
.github/workflows/build-msvc.yml
··· 224 224 opam switch create '${{ env.OPAMSWITCH }}' --empty 225 225 opam pin add --no-action --kind=path ocaml-variants . 226 226 opam pin add --no-action flexdll flexdll 227 - opam pin add --no-action winpthreads winpthreads 228 - opam install --yes flexdll winpthreads 227 + opam install --yes flexdll 229 228 opam install --yes --assume-built ocaml-variants 230 229 opam exec -- ocamlc -v 231 230
-5
.gitmodules
··· 3 3 url = https://github.com/ocaml/flexdll.git 4 4 shallow = true 5 5 branch = master 6 - [submodule "winpthreads"] 7 - path = winpthreads 8 - url = https://github.com/ocaml/winpthreads.git 9 - shallow = true 10 - branch = master
-35
HACKING.adoc
··· 220 220 link:toplevel/[]:: interactive system 221 221 link:typing/[]:: typechecking -- see xref:typing/HACKING.adoc[] 222 222 link:utils/[]:: utility libraries 223 - link:winpthreads/[]:: winpthreads submodule -- see <<winpthreads,further>> 224 223 link:yacc/[]:: parser generator 225 224 226 225 [#tips] ··· 770 769 If you would like to receive email notifications of all commits made to the main 771 770 git repository, you can subscribe to the caml-commits@inria.fr mailing list by 772 771 visiting https://sympa.inria.fr/sympa/info/caml-commits[its web page.] 773 - 774 - [#winpthreads] 775 - === The `winpthreads` library for the MSVC port 776 - 777 - The `winpthreads` library is used to emulate `pthread` for the MSVC 778 - port. Upstream bundles it along with all the MinGW libraries so our 779 - `winpthreads` submodule points to `git subtree` repository rather than 780 - upstream directly. 781 - 782 - To recreate the `winpthreads` repository from upstream, you can do: 783 - 784 - [source,sh] 785 - ---- 786 - git clone -o upstream https://git.code.sf.net/p/mingw-w64/mingw-w64 winpthreads 787 - cd winpthreads 788 - git checkout upstream/master 789 - git branch -D master 790 - git subtree -P mingw-w64-libraries/winpthreads split -b master 791 - ---- 792 - 793 - As subtree splitting is deterministic, repeating these operations later will 794 - allow to update `master`, for instance by: 795 - 796 - [source,sh] 797 - ---- 798 - git fetch upstream 799 - git checkout upstream/master 800 - git subtree -P mingw-w64-libraries/winpthreads split -b tmp 801 - git checkout master 802 - git merge --ff-only tmp 803 - git branch -d tmp 804 - ---- 805 - 806 - and then go on updating the `winpthreads` submodule in the `ocaml` repository. 807 772 808 773 Happy Hacking!
+10 -31
Makefile
··· 1199 1199 1200 1200 ## Lists of source files 1201 1201 1202 - ifneq "$(WINPTHREADS_SOURCE_DIR)" "" 1203 - winpthreads_SOURCES = cond.c misc.c mutex.c rwlock.c sched.c spinlock.c thread.c 1204 - 1205 - winpthreads_OBJECTS = \ 1206 - $(addprefix runtime/winpthreads/, $(winpthreads_SOURCES:.c=.$(O))) 1207 - else 1208 - winpthreads_OBJECTS = 1209 - endif 1210 - 1211 1202 runtime_COMMON_C_SOURCES = \ 1212 1203 addrmap \ 1213 1204 afl \ ··· 1328 1319 1329 1320 1330 1321 libcamlrun_OBJECTS = \ 1331 - $(runtime_BYTECODE_C_SOURCES:.c=.b.$(O)) $(winpthreads_OBJECTS) 1322 + $(runtime_BYTECODE_C_SOURCES:.c=.b.$(O)) 1332 1323 1333 1324 libcamlrun_non_shared_OBJECTS = \ 1334 1325 $(subst $(UNIX_OR_WIN32).b.$(O),$(UNIX_OR_WIN32)_non_shared.b.$(O), \ 1335 1326 $(libcamlrun_OBJECTS)) 1336 1327 1337 1328 libcamlrund_OBJECTS = $(runtime_BYTECODE_C_SOURCES:.c=.bd.$(O)) \ 1338 - $(winpthreads_OBJECTS) runtime/instrtrace.bd.$(O) 1329 + runtime/instrtrace.bd.$(O) 1339 1330 1340 1331 libcamlruni_OBJECTS = \ 1341 - $(runtime_BYTECODE_C_SOURCES:.c=.bi.$(O)) $(winpthreads_OBJECTS) 1332 + $(runtime_BYTECODE_C_SOURCES:.c=.bi.$(O)) 1342 1333 1343 1334 libcamlrunpic_OBJECTS = \ 1344 - $(runtime_BYTECODE_C_SOURCES:.c=.bpic.$(O)) $(winpthreads_OBJECTS) 1335 + $(runtime_BYTECODE_C_SOURCES:.c=.bpic.$(O)) 1345 1336 1346 1337 libasmrun_OBJECTS = \ 1347 - $(runtime_NATIVE_C_SOURCES:.c=.n.$(O)) $(runtime_ASM_OBJECTS) \ 1348 - $(winpthreads_OBJECTS) 1338 + $(runtime_NATIVE_C_SOURCES:.c=.n.$(O)) $(runtime_ASM_OBJECTS) 1349 1339 1350 1340 libasmrund_OBJECTS = \ 1351 - $(runtime_NATIVE_C_SOURCES:.c=.nd.$(O)) $(runtime_ASM_OBJECTS:.$(O)=.d.$(O)) \ 1352 - $(winpthreads_OBJECTS) 1341 + $(runtime_NATIVE_C_SOURCES:.c=.nd.$(O)) $(runtime_ASM_OBJECTS:.$(O)=.d.$(O)) 1353 1342 1354 1343 libasmruni_OBJECTS = \ 1355 - $(runtime_NATIVE_C_SOURCES:.c=.ni.$(O)) $(runtime_ASM_OBJECTS:.$(O)=.i.$(O)) \ 1356 - $(winpthreads_OBJECTS) 1344 + $(runtime_NATIVE_C_SOURCES:.c=.ni.$(O)) $(runtime_ASM_OBJECTS:.$(O)=.i.$(O)) 1357 1345 1358 1346 libasmrunpic_OBJECTS = $(runtime_NATIVE_C_SOURCES:.c=.npic.$(O)) \ 1359 - $(runtime_ASM_OBJECTS:.$(O)=_libasmrunpic.$(O)) $(winpthreads_OBJECTS) 1347 + $(runtime_ASM_OBJECTS:.$(O)=_libasmrunpic.$(O)) 1360 1348 1361 1349 libcomprmarsh_OBJECTS = runtime/zstd.npic.$(O) 1362 1350 ··· 1548 1536 $$(OUTPUTOBJ)$$@ -c $$< 1549 1537 endef 1550 1538 1551 - runtime/winpthreads/%.$(O): $(WINPTHREADS_SOURCE_DIR)/src/%.c \ 1552 - $(wildcard $(WINPTHREADS_SOURCE_DIR)/include/*.h) \ 1553 - | runtime/winpthreads 1554 - $(V_CC)$(CC) $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) $(CPPFLAGS) \ 1555 - $(OUTPUTOBJ)$@ -c $< 1556 - 1557 - runtime/winpthreads: 1558 - $(MKDIR) $@ 1559 - 1560 1539 $(DEPDIR)/runtime: 1561 1540 $(MKDIR) $@ 1562 1541 ··· 1643 1622 rm -f runtime/primitives runtime/primitives*.new runtime/prims.c \ 1644 1623 $(runtime_BUILT_HEADERS) 1645 1624 rm -f runtime/domain_state.inc 1646 - rm -rf $(DEPDIR) runtime/winpthreads 1625 + rm -rf $(DEPDIR) 1647 1626 rm -f stdlib/libcamlrun.a stdlib/libcamlrun.lib 1648 1627 1649 1628 .PHONY: runtimeopt ··· 2743 2722 boot/flexdll_*.o boot/flexdll_*.obj \ 2744 2723 boot/*.cm* boot/libcamlrun.a boot/libcamlrun.lib boot/ocamlc.opt 2745 2724 rm -f Makefile.config Makefile.build_config 2746 - rm -rf autom4te.cache winpthreads-sources flexdll-sources \ 2725 + rm -rf autom4te.cache flexdll-sources \ 2747 2726 $(BYTE_BUILD_TREE) $(OPT_BUILD_TREE) 2748 2727 rm -f config.log config.status libtool 2749 2728
+1 -5
Makefile.build_config.in
··· 94 94 95 95 # The submodules should be searched *before* any other external -I paths 96 96 OC_INCLUDES = $(addprefix -I $(ROOTDIR)/, \ 97 - runtime @flexdll_source_dir@ @winpthreads_source_include_dir@) 97 + runtime @flexdll_source_dir@) 98 98 OC_CPPFLAGS = $(OC_INCLUDES) @oc_cppflags@ 99 99 100 100 OC_BYTECODE_CPPFLAGS = $(OC_INCLUDES) @oc_bytecode_cppflags@ ··· 142 142 # Git submodule) 143 143 FLEXDLL_SOURCE_DIR=@flexdll_source_dir@ 144 144 BOOTSTRAPPING_FLEXDLL=@bootstrapping_flexdll@ 145 - 146 - # The location of the Winpthreads sources to use (usually provided as the 147 - # winpthreads Git submodule) 148 - WINPTHREADS_SOURCE_DIR=@winpthreads_source_dir@ 149 145 150 146 ### Where to install documentation 151 147 PACKAGE_TARNAME = @PACKAGE_TARNAME@
-10
aclocal.m4
··· 363 363 OCAML_CC_RESTORE_VARIABLES 364 364 ]) 365 365 366 - AC_DEFUN([OCAML_TEST_WINPTHREADS_PTHREAD_H], [ 367 - OCAML_CC_SAVE_VARIABLES 368 - 369 - AS_IF([test -n "$1"],[CPPFLAGS="-I $1 $CPPFLAGS"]) 370 - AC_CHECK_HEADER([pthread.h],[], 371 - [AC_MSG_ERROR([cannot find or use pthread.h from winpthreads])]) 372 - 373 - OCAML_CC_RESTORE_VARIABLES 374 - ]) 375 - 376 366 AC_DEFUN([OCAML_TARGET_IS_EXECUTABLE], [ 377 367 AC_MSG_CHECKING([whether target executables can be run in the build]) 378 368 old_cross_compiling="$cross_compiling"
-116
configure
··· 894 894 launch_method_target 895 895 launch_method 896 896 shebangscripts 897 - winpthreads_source_include_dir 898 - winpthreads_source_dir 899 897 flexdll_dir 900 898 bootstrapping_flexdll 901 899 flexdll_source_dir ··· 1066 1064 enable_runtime_search_target 1067 1065 with_afl 1068 1066 with_flexdll 1069 - with_winpthreads_msvc 1070 1067 with_zstd 1071 1068 enable_shared 1072 1069 enable_static ··· 1806 1803 --with-relative-libdir, defaults to ../lib/ocaml) 1807 1804 --with-afl use the AFL fuzzer 1808 1805 --with-flexdll bootstrap FlexDLL from the given sources 1809 - --with-winpthreads-msvc build winpthreads (only for the MSVC port) from the 1810 - given sources 1811 1806 --without-zstd disable compression of compilation artefacts 1812 1807 --with-gnu-ld assume the C compiler uses GNU ld [default=no] 1813 1808 --with-sysroot[=DIR] Search for dependent libraries within DIR (or the ··· 3564 3559 3565 3560 3566 3561 3567 - 3568 - 3569 3562 # TODO: rename this variable 3570 3563 3571 3564 ··· 4496 4489 withval=$with_flexdll; if test x"$withval" = 'xyes' 4497 4490 then : 4498 4491 with_flexdll=flexdll 4499 - fi 4500 - fi 4501 - 4502 - 4503 - 4504 - # Check whether --with-winpthreads-msvc was given. 4505 - if test ${with_winpthreads_msvc+y} 4506 - then : 4507 - withval=$with_winpthreads_msvc; if test x"$withval" = 'xyes' 4508 - then : 4509 - with_winpthreads_msvc=winpthreads 4510 4492 fi 4511 4493 fi 4512 4494 ··· 17640 17622 *) : 17641 17623 encode_C_literal="encode-C-utf8-literal" ;; 17642 17624 esac 17643 - 17644 - # Winpthreads emulation library for the MSVC port 17645 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for winpthreads sources" >&5 17646 - printf %s "checking for winpthreads sources... " >&6; } 17647 - if test x"$with_winpthreads_msvc" = "xno" 17648 - then : 17649 - winpthreads_source_dir='' 17650 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 17651 - printf "%s\n" "disabled" >&6; } 17652 - else $as_nop 17653 - winpthreadmsg='' 17654 - case $target in #( 17655 - *-pc-windows) : 17656 - if test x"$with_winpthreads_msvc" = 'x' || test x"$with_winpthreads_msvc" = x'winpthreads' 17657 - then : 17658 - if test -f 'winpthreads/src/winpthread_internal.h' 17659 - then : 17660 - winpthreads_source_dir=winpthreads 17661 - else $as_nop 17662 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: required but not available (uninitialized submodule?)" >&5 17663 - printf "%s\n" "required but not available (uninitialized submodule?)" >&6; } 17664 - as_fn_error $? "exiting" "$LINENO" 5 17665 - fi 17666 - else $as_nop 17667 - rm -rf winpthreads-sources 17668 - if test -f "$with_winpthreads_msvc/src/winpthread_internal.h" 17669 - then : 17670 - mkdir -p winpthreads-sources/src winpthreads-sources/include 17671 - cp "$with_winpthreads_msvc"/src/*.c winpthreads-sources/src 17672 - cp "$with_winpthreads_msvc"/src/*.h winpthreads-sources/src 17673 - cp "$with_winpthreads_msvc"/include/*.h winpthreads-sources/include 17674 - winpthreads_source_dir='winpthreads-sources' 17675 - winpthreadsmsg=" (from $with_winpthreads_msvc)" 17676 - else $as_nop 17677 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: requested but not available" >&5 17678 - printf "%s\n" "requested but not available" >&6; } 17679 - as_fn_error $? "exiting" "$LINENO" 5 17680 - fi 17681 - fi 17682 - if test x"$winpthreads_source_dir" = 'x' 17683 - then : 17684 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 17685 - printf "%s\n" "no" >&6; } 17686 - else $as_nop 17687 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $winpthreads_source_dir$winpthreadsmsg" >&5 17688 - printf "%s\n" "$winpthreads_source_dir$winpthreadsmsg" >&6; } 17689 - winpthreads_source_include_dir="$winpthreads_source_dir/include" 17690 - 17691 - 17692 - saved_CC="$CC" 17693 - saved_CFLAGS="$CFLAGS" 17694 - saved_CPPFLAGS="$CPPFLAGS" 17695 - saved_LIBS="$LIBS" 17696 - saved_ac_ext="$ac_ext" 17697 - saved_ac_compile="$ac_compile" 17698 - # Move the content of confdefs.h to another file so it does not 17699 - # get included 17700 - mv confdefs.h confdefs.h.bak 17701 - touch confdefs.h 17702 - 17703 - 17704 - if test -n "$winpthreads_source_include_dir" 17705 - then : 17706 - CPPFLAGS="-I $winpthreads_source_include_dir $CPPFLAGS" 17707 - fi 17708 - ac_fn_c_check_header_compile "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" 17709 - if test "x$ac_cv_header_pthread_h" = xyes 17710 - then : 17711 - 17712 - else $as_nop 17713 - as_fn_error $? "cannot find or use pthread.h from winpthreads" "$LINENO" 5 17714 - fi 17715 - 17716 - 17717 - 17718 - # Restore the content of confdefs.h 17719 - mv confdefs.h.bak confdefs.h 17720 - ac_compile="$saved_ac_compile" 17721 - ac_ext="$saved_ac_ext" 17722 - CPPFLAGS="$saved_CPPFLAGS" 17723 - CFLAGS="$saved_CFLAGS" 17724 - CC="$saved_CC" 17725 - LIBS="$saved_LIBS" 17726 - 17727 - 17728 - fi ;; #( 17729 - *) : 17730 - if test x"$with_winpthreads_msvc" != 'x' 17731 - then : 17732 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: requested but not supported" >&5 17733 - printf "%s\n" "requested but not supported" >&6; } 17734 - as_fn_error $? "exiting" "$LINENO" 5 17735 - else $as_nop 17736 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: skipping on that platform" >&5 17737 - printf "%s\n" "skipping on that platform" >&6; } 17738 - fi ;; 17739 - esac 17740 - fi 17741 17625 17742 17626 ## Program to use to install files 17743 17627
-45
configure.ac
··· 193 193 AC_SUBST([flexdll_source_dir]) 194 194 AC_SUBST([bootstrapping_flexdll]) 195 195 AC_SUBST([flexdll_dir]) 196 - AC_SUBST([winpthreads_source_dir]) 197 - AC_SUBST([winpthreads_source_include_dir]) 198 196 AC_SUBST([shebangscripts]) 199 197 AC_SUBST([launch_method]) 200 198 AC_SUBST([launch_method_target]) ··· 755 753 [AS_HELP_STRING([--with-flexdll], 756 754 [bootstrap FlexDLL from the given sources])], 757 755 [AS_IF([test x"$withval" = 'xyes'],[with_flexdll=flexdll])]) 758 - 759 - AC_ARG_WITH([winpthreads-msvc], 760 - [AS_HELP_STRING([--with-winpthreads-msvc], 761 - [build winpthreads (only for the MSVC port) from the given sources])], 762 - [AS_IF([test x"$withval" = 'xyes'], [with_winpthreads_msvc=winpthreads])]) 763 756 764 757 AC_ARG_WITH([zstd], 765 758 [AS_HELP_STRING([--without-zstd], ··· 1347 1340 [*-w64-mingw32*|*-pc-windows], 1348 1341 [encode_C_literal="encode-C-utf16-literal"], 1349 1342 [encode_C_literal="encode-C-utf8-literal"]) 1350 - 1351 - # Winpthreads emulation library for the MSVC port 1352 - AC_MSG_CHECKING([for winpthreads sources]) 1353 - AS_IF([test x"$with_winpthreads_msvc" = "xno"], 1354 - [winpthreads_source_dir='' 1355 - AC_MSG_RESULT([disabled])], 1356 - [winpthreadmsg='' 1357 - AS_CASE([$target], 1358 - [*-pc-windows], 1359 - [dnl When bootstrapping from the git submodule (winpthreads directory), 1360 - dnl just use that, however if another directory has been specified with 1361 - dnl --with-winpthreads-msvc=<path> then copy the contents of <path> to 1362 - dnl winpthreads-sources. 1363 - AS_IF([m4_normalize([test x"$with_winpthreads_msvc" = 'x' 1364 - || test x"$with_winpthreads_msvc" = x'winpthreads'])], 1365 - [AS_IF([test -f 'winpthreads/src/winpthread_internal.h'], 1366 - [winpthreads_source_dir=winpthreads], 1367 - [AC_MSG_RESULT([required but not available (uninitialized submodule?)]) 1368 - AC_MSG_ERROR([exiting])])], 1369 - [rm -rf winpthreads-sources 1370 - AS_IF([test -f "$with_winpthreads_msvc/src/winpthread_internal.h"], 1371 - [mkdir -p winpthreads-sources/src winpthreads-sources/include 1372 - cp "$with_winpthreads_msvc"/src/*.c winpthreads-sources/src 1373 - cp "$with_winpthreads_msvc"/src/*.h winpthreads-sources/src 1374 - cp "$with_winpthreads_msvc"/include/*.h winpthreads-sources/include 1375 - winpthreads_source_dir='winpthreads-sources' 1376 - winpthreadsmsg=" (from $with_winpthreads_msvc)"], 1377 - [AC_MSG_RESULT([requested but not available]) 1378 - AC_MSG_ERROR([exiting])])]) 1379 - AS_IF([test x"$winpthreads_source_dir" = 'x'], 1380 - [AC_MSG_RESULT([no])], 1381 - [AC_MSG_RESULT([$winpthreads_source_dir$winpthreadsmsg]) 1382 - winpthreads_source_include_dir="$winpthreads_source_dir/include" 1383 - OCAML_TEST_WINPTHREADS_PTHREAD_H([$winpthreads_source_include_dir])])], 1384 - [AS_IF([test x"$with_winpthreads_msvc" != 'x'], 1385 - [AC_MSG_RESULT([requested but not supported]) 1386 - AC_MSG_ERROR([exiting])], 1387 - [AC_MSG_RESULT([skipping on that platform])])])]) 1388 1343 1389 1344 ## Program to use to install files 1390 1345 AC_PROG_INSTALL
+2 -3
ocaml-variants.opam
··· 46 46 # amd64 mingw-w64 / MSVC 47 47 (("arch-x86_64" {build & os = "win32" & arch = "x86_64"} & 48 48 (("system-mingw" {build} & "mingw-w64-shims" {os-distribution = "cygwin" & build}) | 49 - ("system-msvc" {build} & "winpthreads" {os = "win32"} & "ocaml-option-no-compression" {build & os = "win32"}))) | 49 + ("system-msvc" {build} & "ocaml-option-no-compression" {build & os = "win32"}))) | 50 50 # i686 mingw-w64 / MSVC 51 51 ("arch-x86_32" {build & os = "win32"} & "ocaml-option-bytecode-only" {build & os = "win32"} & 52 52 (("system-mingw" {build} & "mingw-w64-shims" {os-distribution = "cygwin" & build}) | 53 - ("system-msvc" {build} & "winpthreads" {os = "win32"} & "ocaml-option-no-compression" {build & os = "win32"}))) | 53 + ("system-msvc" {build} & "ocaml-option-no-compression" {build & os = "win32"}))) | 54 54 # Non-Windows systems 55 55 "host-system-other" {os != "win32" & post}) 56 56 ··· 81 81 "--enable-runtime-search" 82 82 "--enable-runtime-search-target=fallback" 83 83 "--with-flexdll=%{flexdll:share}%" {os = "win32" & flexdll:installed} 84 - "--with-winpthreads-msvc=%{winpthreads:share}%" {winpthreads:installed & system-msvc:installed} 85 84 "-C" 86 85 "--with-afl" {ocaml-option-afl:installed} 87 86 "--disable-native-compiler" {ocaml-option-bytecode-only:installed}
-11
tools/ci/inria/main
··· 162 162 jobs='' 163 163 bootstrap=false 164 164 init_submodule_flexdll=false 165 - init_submodule_winpthreads=false 166 165 167 166 memory_model_tests="tests/memory-model/forbidden.ml \ 168 167 tests/memory-model/publish.ml" ··· 214 213 instdir='C:/ocamlms' 215 214 cleanup=true 216 215 init_submodule_flexdll=true 217 - init_submodule_winpthreads=true 218 216 ;; 219 217 msvc64) 220 218 build='--build=x86_64-pc-cygwin' ··· 222 220 instdir='C:/ocamlms64' 223 221 cleanup=true 224 222 init_submodule_flexdll=true 225 - init_submodule_winpthreads=true 226 223 ;; 227 224 *) arch_error;; 228 225 esac ··· 253 250 elif [ -f flexdll/Makefile ]; then 254 251 if grep -Fq flexdll .gitmodules; then 255 252 git submodule deinit --force flexdll 256 - fi 257 - fi 258 - 259 - if $init_submodule_winpthreads; then 260 - git submodule update --init winpthreads 261 - elif [ -f winpthreads/Makefile.in ]; then 262 - if grep -Fq winpthreads .gitmodules; then 263 - git submodule deinit --force winpthreads 264 253 fi 265 254 fi 266 255