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.

Add --enable-runtime-search[-target] options

--enable-runtime-search controls the -runtime-search setting used to
build the compiler's own bytecode executables;
--enable-runtime-search-target controls the default value of
-runtime-search that ocamlc itself uses.

+130 -7
+6
Changes
··· 471 471 (David Allsopp, review by Jonah Beckford, Antonin Décimo, Damien Doligez and 472 472 Samuel Hym) 473 473 474 + - #14245: New --enable-runtime-search configure option controls the 475 + -runtime-search option used to build the bytecode binaries in the compiler 476 + distribution. --enable-runtime-search-target controls the default value of 477 + -runtime-search used for bytecode executables produced by the compiler. 478 + (David Allsopp, review by Damien Doligez and Samuel Hym) 479 + 474 480 ### Bug fixes: 475 481 476 482 - #14036: Fix nontermination of cycle printing in recursive modules with
+2
Makefile.build_config.in
··· 221 221 # Contains TSan-specific runtime files, or nothing if TSan support is 222 222 # disabled 223 223 TSAN_NATIVE_RUNTIME_C_SOURCES = @tsan_native_runtime_c_sources@ 224 + 225 + RUNTIME_SEARCH = @runtime_search@
+2 -1
Makefile.common
··· 345 345 # $(ROOTDIR)/ocamlc needs -launch-method to be given explicitly as its default 346 346 # values are those for the target (cf. --with-target-sh and TARGET_BINDIR). 347 347 BYTECODE_LAUNCHER_FLAGS = \ 348 - -launch-method $(call QUOTE_SINGLE,$(LAUNCH_METHOD) $(BINDIR)) 348 + -launch-method $(call QUOTE_SINGLE,$(LAUNCH_METHOD) $(BINDIR)) \ 349 + -runtime-search $(if $(RUNTIME_SEARCH),$(RUNTIME_SEARCH),disable) 349 350 350 351 MAYBE_ADD_BYTECODE_LAUNCHER_FLAGS = \ 351 352 $(if $(filter -custom, $(1)),,\
+68
configure
··· 800 800 build_vendor 801 801 build_cpu 802 802 build 803 + runtime_search_target 804 + runtime_search 803 805 suffixing 804 806 native_runtime_id 805 807 bytecode_runtime_id ··· 1060 1062 enable_mmap_map_stack 1061 1063 with_relative_libdir 1062 1064 enable_suffixing 1065 + enable_runtime_search 1066 + enable_runtime_search_target 1063 1067 with_afl 1064 1068 with_flexdll 1065 1069 with_winpthreads_msvc ··· 1773 1777 --enable-mmap-map-stack use mmap to allocate stacks instead of malloc 1774 1778 --disable-suffixing disable suffixing of runtime executables and shared 1775 1779 libraries 1780 + --enable-runtime-search allow the distribution's bytecode executables to 1781 + search for ocamlrun 1782 + --enable-runtime-search-target 1783 + allow bytecode executables produced by ocamlc to 1784 + search for ocamlrun 1776 1785 --enable-shared[=PKGS] build shared libraries [default=yes] 1777 1786 --enable-static[=PKGS] build static libraries [default=yes] 1778 1787 --enable-pic[=PKGS] try to use only PIC/non-PIC objects [default=use ··· 3396 3405 srcdir_abs='' 3397 3406 srcdir_abs_real='' 3398 3407 build_map_flags='' 3408 + runtime_search='' 3409 + runtime_search_target='' 3399 3410 3400 3411 # Information about the package 3401 3412 ··· 3556 3567 3557 3568 3558 3569 # TODO: rename this variable 3570 + 3571 + 3559 3572 3560 3573 3561 3574 ··· 4426 4439 suffixing=true 4427 4440 fi 4428 4441 4442 + 4443 + # Check whether --enable-runtime-search was given. 4444 + if test ${enable_runtime_search+y} 4445 + then : 4446 + enableval=$enable_runtime_search; case $enableval in #( 4447 + no) : 4448 + ;; #( 4449 + yes) : 4450 + runtime_search='enable' ;; #( 4451 + fallback) : 4452 + runtime_search='fallback' ;; #( 4453 + *) : 4454 + as_fn_error $? "valid values are yes, no or fallback for --enable-runtime-search" "$LINENO" 5 ;; 4455 + esac 4456 + else $as_nop 4457 + case $host in #( 4458 + *-w64-mingw32*|*-pc-windows) : 4459 + runtime_search='enable' ;; #( 4460 + *) : 4461 + ;; 4462 + esac 4463 + fi 4464 + 4465 + 4466 + # Check whether --enable-runtime-search-target was given. 4467 + if test ${enable_runtime_search_target+y} 4468 + then : 4469 + enableval=$enable_runtime_search_target; case $enableval in #( 4470 + no) : 4471 + ;; #( 4472 + yes) : 4473 + runtime_search_target='enable' ;; #( 4474 + fallback) : 4475 + runtime_search_target='fallback' ;; #( 4476 + *) : 4477 + as_fn_error $? "valid values are yes, no or fallback for --enable-runtime-search-target" "$LINENO" 5 ;; 4478 + esac 4479 + else $as_nop 4480 + case $host in #( 4481 + *-w64-mingw32*|*-pc-windows) : 4482 + runtime_search_target='enable' ;; #( 4483 + *) : 4484 + ;; 4485 + esac 4486 + fi 4487 + 4488 + 4489 + case $suffixing,$runtime_search,$runtime_search_target in #( 4490 + true,*,*|false,,) : 4491 + ;; #( 4492 + false,*,*) : 4493 + as_fn_error $? "--disable-suffixed cannot be used with --enable-runtime-search or --enable-runtime-search-target" "$LINENO" 5 ;; #( 4494 + *) : 4495 + ;; 4496 + esac 4429 4497 4430 4498 4431 4499 # Check whether --with-afl was given.
+37
configure.ac
··· 88 88 srcdir_abs='' 89 89 srcdir_abs_real='' 90 90 build_map_flags='' 91 + runtime_search='' 92 + runtime_search_target='' 91 93 92 94 # Information about the package 93 95 ··· 285 287 AC_SUBST([bytecode_runtime_id]) 286 288 AC_SUBST([native_runtime_id]) 287 289 AC_SUBST([suffixing]) 290 + AC_SUBST([runtime_search]) 291 + AC_SUBST([runtime_search_target]) 288 292 289 293 ## Generated files 290 294 ··· 717 721 [disable suffixing of runtime executables and shared libraries])], 718 722 [AS_IF([test "x$enableval" = 'xno'], [suffixing=false], [suffixing=true])], 719 723 [suffixing=true]) 724 + 725 + AC_ARG_ENABLE([runtime-search], 726 + [AS_HELP_STRING([--enable-runtime-search], 727 + [allow the distribution's bytecode executables to search for ocamlrun])], 728 + [AS_CASE([$enableval], 729 + [no],[], 730 + [yes],[runtime_search='enable'], 731 + [fallback],[runtime_search='fallback'], 732 + [AC_MSG_ERROR(m4_normalize([valid values are yes, no or fallback for 733 + --enable-runtime-search]))])], 734 + [AS_CASE([$host], 735 + dnl Historically, the native Windows ports are assumed to be finding ocamlrun 736 + dnl using a PATH search. *) 737 + [*-w64-mingw32*|*-pc-windows],[runtime_search='enable'])]) 738 + 739 + AC_ARG_ENABLE([runtime-search-target], 740 + [AS_HELP_STRING([--enable-runtime-search-target], 741 + [allow bytecode executables produced by ocamlc to search for ocamlrun])], 742 + [AS_CASE([$enableval], 743 + [no],[], 744 + [yes],[runtime_search_target='enable'], 745 + [fallback],[runtime_search_target='fallback'], 746 + [AC_MSG_ERROR(m4_normalize([valid values are yes, no or fallback for 747 + --enable-runtime-search-target]))])], 748 + [AS_CASE([$host], 749 + dnl Historically, the native Windows ports are assumed to be finding ocamlrun 750 + dnl using a PATH search. *) 751 + [*-w64-mingw32*|*-pc-windows],[runtime_search_target='enable'])]) 752 + 753 + AS_CASE([$suffixing,$runtime_search,$runtime_search_target], 754 + [true,*,*|false,,],[], 755 + [false,*,*],[AC_MSG_ERROR(m4_normalize([--disable-suffixed cannot be used with 756 + --enable-runtime-search or --enable-runtime-search-target]))]) 720 757 721 758 AC_ARG_WITH([afl], 722 759 [AS_HELP_STRING([--with-afl],
+1 -6
utils/clflags.ml
··· 94 94 and launch_method = 95 95 ref Config.launch_method 96 96 and search_method = (* -search-method ... *) 97 - if Config.target_win32 then 98 - (* Historically, the native Windows ports are assumed to be finding ocamlrun 99 - using a PATH search. *) 100 - ref Config.Enable 101 - else 102 - ref Config.Disable 97 + ref Config.search_method 103 98 and plugin = ref false (* -plugin ... *) 104 99 and principal = ref false (* -principal *) 105 100 and real_paths = ref true (* -short-paths *)
+6
utils/config.common.ml.in
··· 84 84 | "sh" -> Shebang None 85 85 | _ -> Shebang (Some launch_method) 86 86 87 + let search_method = 88 + match search_method with 89 + | "enable" -> Enable 90 + | "fallback" -> Fallback 91 + | _ -> Disable 92 + 87 93 let interface_suffix = ref ".mli" 88 94 89 95 let max_tag = 243
+1
utils/config.fixed.ml
··· 87 87 let shebangscripts = false 88 88 let suffixing = false 89 89 let launch_method = "sh" 90 + let search_method = "always"
+2
utils/config.generated.ml.in
··· 110 110 let suffixing = @suffixing@ 111 111 112 112 let launch_method = {@QS@|@launch_method_target@|@QS@} 113 + 114 + let search_method = {@QS@|@runtime_search_target@|@QS@}
+5
utils/config.mli
··· 401 401 | Enable 402 402 (** Always search for the interpreter *) 403 403 404 + val search_method : search_method 405 + (** Default search mechanism for bytecode executables 406 + 407 + @since 5.5 *) 408 + 404 409 val shebangscripts : bool 405 410 (** Whether the target supports shebang scripts 406 411