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.

Preserve backslashes in --prefix

Previously, the --prefix argument was always normalised with cygpath -m
which meant that regardless of the argument, the paths used in the
compiler would always use slashes.

This behaviour is preserved if a slash is detected in the argument, i.e.
the caller explicitly uses mixed notation (e.g. `--prefix=C:/Prefix` or
`--prefix $PWD/install`). In particular, it means that a Cygwin-style
path will be correctly converted to a Windows-style path.

If the path uses backslashes, then it is still converted to use forward
slashes for the installation commands, but the backslashes are otherwise
preserved and used within the build itself.

+116 -26
+1 -1
.github/workflows/build-msvc.yml
··· 136 136 env: 137 137 CONFIG_ARGS: >- 138 138 --cache-file=config.cache 139 - --prefix "${{ matrix.cc != 'gcc' && '$PROGRAMFILES/Бактріан🐫' || '$(cygpath "$PROGRAMFILES/Бактріан🐫")'}}" 139 + --prefix "${{ matrix.cc != 'gcc' && '$PROGRAMFILES\\Бактріан🐫' || '$(cygpath "$PROGRAMFILES/Бактріан🐫")'}}" 140 140 ${{ matrix.cc != 'gcc' && format('--host={0}-pc-windows', matrix.arch) || '' }} 141 141 ${{ matrix.cc != 'gcc' && format('CC={0}', matrix.cc) || '' }} 142 142 --enable-ocamltest
+5 -4
Changes
··· 415 415 building OCaml with --disable-shared. 416 416 (David Allsopp, review by Jonah Beckford, Damien Doligez and Hugo Heuzard) 417 417 418 - - #14244: Normalise `--prefix` when compiling on MSYS2 in the same way as is 419 - already done on Cygwin. In particular, backslashes are converted to slashes 420 - and MSYS2-style paths (e.g. resulting from `--prefix $PWD/install`) are 421 - converted to Windows-style paths. 418 + - #14244: When targeting native Windows on Cygwin or MSYS2, preserve 419 + backslashes in the supplied `--prefix` (in particular, backslashes instead of 420 + slashes will then be displayed by `ocamlopt -config-var standard_library`). 421 + If the supplied prefix contains a slash, then it is normalised, as 422 + previously. 422 423 (David Allsopp, review by Jonah Beckford, Antonin Décimo, Damien Doligez and 423 424 Samuel Hym) 424 425
+61 -11
configure
··· 805 805 TARGET_LIBDIR 806 806 ocaml_libdir 807 807 ocaml_bindir 808 + ocaml_prefix 808 809 compute_deps 809 810 build_libraries_manpages 810 811 PACKLD ··· 3526 3527 3527 3528 3528 3529 # TODO: rename this variable 3530 + 3529 3531 3530 3532 3531 3533 ··· 24183 24185 libdir="$libdir"/ocaml 24184 24186 fi 24185 24187 24186 - if test x"$TARGET_LIBDIR" = x 24187 - then : 24188 - TARGET_LIBDIR="$libdir" 24189 - fi 24190 - 24191 24188 if test x"$mandir" = x'${datarootdir}/man' 24192 24189 then : 24193 24190 mandir='${prefix}/man' ··· 24208 24205 *) : 24209 24206 ;; 24210 24207 esac 24208 + fi 24209 + 24210 + # Normalise $prefix, if necessary, on Windows. There are 9 variables to be 24211 + # considered: 24212 + # - $prefix and $exec_prefix. These are autoconf variables containing the values 24213 + # specified for --prefix and --exec-prefix respectively, or NONE if these 24214 + # flags were not given on the command line. These two variables are written to 24215 + # Makefile.config and are in _build_ format. On native Windows, the values 24216 + # must be suitable to pass to _both_ native Windows processes and Cygwin/MSYS2 24217 + # commands. The values are ultimately converted to Windows paths using slashes 24218 + # (i.e. C:/foo) 24219 + # - $bindir and $libdir. These similarly contain the values specified for 24220 + # --bindir and --libdir, or defaults relative to $exec_prefix otherwise. 24221 + # Unlike --prefix, values specified to configure for --bindir and --libdir are 24222 + # assumed to be suitable for both native Windows processes and Cygwin/MSYS2. 24223 + # These two variables ultimately end up in Makefile.config as $(BINDIR) and 24224 + # $(LIBDIR) and are used for installation commands only. 24225 + # - $ocaml_prefix, $ocaml_bindir and $ocaml_libdir are the _expanded_ values of 24226 + # $prefix, $bindir and $libdir so that the values can be inserted into OCaml 24227 + # strings (typically in utils/config.generated.ml). On Windows, these preserve 24228 + # the backslashes present in the value passed to --prefix. 24229 + # - $TARGET_BINDIR and $TARGET_LIBDIR. These are both precious environment 24230 + # variables (meaning their value is recorded by configure) but they default to 24231 + # $ocaml_bindir and $ocaml_libdir respectively. 24232 + ocaml_bindir="$bindir" 24233 + ocaml_libdir="$libdir" 24234 + ocaml_prefix="$prefix" 24235 + case $cygwin_build_env,$host in #( 24236 + true,*-w64-mingw32*|true,*-pc-windows) : 24237 + prefix="$(LC_ALL=C.UTF-8 cygpath -m "$prefix")" 24238 + if test "x${ocaml_prefix%%/*}" != "x$ocaml_prefix" 24239 + then : 24240 + # $prefix contained a slash - normalise it with cygpath. The rationale for 24241 + # this allows both `./configure --prefix $PWD/install` (which will be a 24242 + # Cygwin path) and also systems lazily using slashes instead of 24243 + # backslashes (i.e. C:/Backslashes/Scare/Us) to work. 24244 + ocaml_prefix="$prefix" 24211 24245 else $as_nop 24212 - case $cygwin_build_env,$host in #( 24213 - true,*-w64-mingw32*|true,*-pc-windows) : 24214 - prefix="$(LC_ALL=C.UTF-8 cygpath -m "$prefix")" ;; #( 24246 + # $prefix was using backslashes - preserve these in the build, but 24247 + # continue to use slashes for the Makefile variables. 24248 + if test "x$bindir" = 'x${exec_prefix}/bin' 24249 + then : 24250 + ocaml_bindir='${exec_prefix}\bin' 24251 + else $as_nop 24252 + ocaml_bindir="$bindir" 24253 + fi 24254 + if test "x$libdir" = 'x${exec_prefix}/lib/ocaml' 24255 + then : 24256 + ocaml_libdir='${exec_prefix}\lib\ocaml' 24257 + else $as_nop 24258 + ocaml_libdir="$libdir" 24259 + fi 24260 + fi ;; #( 24215 24261 *) : 24216 24262 ;; 24217 24263 esac 24218 - fi 24219 24264 24220 24265 # Define a few macros that were defined in config/m-nt.h 24221 24266 # but whose value is not guessed properly by configure ··· 24399 24444 24400 24445 saved_exec_prefix="$exec_prefix" 24401 24446 saved_prefix="$prefix" 24447 + prefix="$ocaml_prefix" 24402 24448 if test "x$prefix" = "xNONE" 24403 24449 then : 24404 24450 prefix="$ac_default_prefix" ··· 24408 24454 exec_prefix="$prefix" 24409 24455 fi 24410 24456 eval "exec_prefix=\"$exec_prefix\"" 24411 - eval "ocaml_bindir=\"$bindir\"" 24412 - eval "ocaml_libdir=\"$libdir\"" 24457 + eval "ocaml_bindir=\"$ocaml_bindir\"" 24458 + eval "ocaml_libdir=\"$ocaml_libdir\"" 24413 24459 if test x"$TARGET_BINDIR" = 'x' 24414 24460 then : 24415 24461 TARGET_BINDIR="$ocaml_bindir" 24462 + fi 24463 + if test x"$TARGET_LIBDIR" = 'x' 24464 + then : 24465 + TARGET_LIBDIR="$ocaml_libdir" 24416 24466 fi 24417 24467 if test x"$target_launch_method" = 'x' 24418 24468 then :
+49 -9
configure.ac
··· 262 262 AC_SUBST([PACKLD]) 263 263 AC_SUBST([build_libraries_manpages]) 264 264 AC_SUBST([compute_deps]) 265 + AC_SUBST([ocaml_prefix]) 265 266 AC_SUBST([ocaml_bindir]) 266 267 AC_SUBST([ocaml_libdir]) 267 268 AC_SUBST([TARGET_LIBDIR]) ··· 2945 2946 AS_IF([test x"$libdir" = x'${exec_prefix}/lib'], 2946 2947 [libdir="$libdir"/ocaml]) 2947 2948 2948 - AS_IF([test x"$TARGET_LIBDIR" = x], 2949 - [TARGET_LIBDIR="$libdir"]) 2950 - 2951 2949 AS_IF([test x"$mandir" = x'${datarootdir}/man'], 2952 2950 [mandir='${prefix}/man']) 2953 2951 ··· 2957 2955 [i686-w64-mingw32*], [prefix='C:/ocamlmgw'], 2958 2956 [x86_64-w64-mingw32*], [prefix='C:/ocamlmgw64'], 2959 2957 [i686-pc-windows], [prefix='C:/ocamlms'], 2960 - [x86_64-pc-windows], [prefix='C:/ocamlms64'])], 2961 - [AS_CASE([$cygwin_build_env,$host], 2962 - [true,*-w64-mingw32*|true,*-pc-windows], 2963 - [prefix="$(LC_ALL=C.UTF-8 cygpath -m "$prefix")"])]) 2958 + [x86_64-pc-windows], [prefix='C:/ocamlms64'])]) 2959 + 2960 + # Normalise $prefix, if necessary, on Windows. There are 9 variables to be 2961 + # considered: 2962 + # - $prefix and $exec_prefix. These are autoconf variables containing the values 2963 + # specified for --prefix and --exec-prefix respectively, or NONE if these 2964 + # flags were not given on the command line. These two variables are written to 2965 + # Makefile.config and are in _build_ format. On native Windows, the values 2966 + # must be suitable to pass to _both_ native Windows processes and Cygwin/MSYS2 2967 + # commands. The values are ultimately converted to Windows paths using slashes 2968 + # (i.e. C:/foo) 2969 + # - $bindir and $libdir. These similarly contain the values specified for 2970 + # --bindir and --libdir, or defaults relative to $exec_prefix otherwise. 2971 + # Unlike --prefix, values specified to configure for --bindir and --libdir are 2972 + # assumed to be suitable for both native Windows processes and Cygwin/MSYS2. 2973 + # These two variables ultimately end up in Makefile.config as $(BINDIR) and 2974 + # $(LIBDIR) and are used for installation commands only. 2975 + # - $ocaml_prefix, $ocaml_bindir and $ocaml_libdir are the _expanded_ values of 2976 + # $prefix, $bindir and $libdir so that the values can be inserted into OCaml 2977 + # strings (typically in utils/config.generated.ml). On Windows, these preserve 2978 + # the backslashes present in the value passed to --prefix. 2979 + # - $TARGET_BINDIR and $TARGET_LIBDIR. These are both precious environment 2980 + # variables (meaning their value is recorded by configure) but they default to 2981 + # $ocaml_bindir and $ocaml_libdir respectively. 2982 + ocaml_bindir="$bindir" 2983 + ocaml_libdir="$libdir" 2984 + ocaml_prefix="$prefix" 2985 + AS_CASE([$cygwin_build_env,$host], 2986 + [true,*-w64-mingw32*|true,*-pc-windows], 2987 + [prefix="$(LC_ALL=C.UTF-8 cygpath -m "$prefix")" 2988 + AS_IF([test "x${ocaml_prefix%%/*}" != "x$ocaml_prefix"], 2989 + # $prefix contained a slash - normalise it with cygpath. The rationale for 2990 + # this allows both `./configure --prefix $PWD/install` (which will be a 2991 + # Cygwin path) and also systems lazily using slashes instead of 2992 + # backslashes (i.e. C:/Backslashes/Scare/Us) to work. 2993 + [ocaml_prefix="$prefix"], 2994 + # $prefix was using backslashes - preserve these in the build, but 2995 + # continue to use slashes for the Makefile variables. 2996 + [AS_IF([test "x$bindir" = 'x${exec_prefix}/bin'], 2997 + [ocaml_bindir='${exec_prefix}\bin'], 2998 + [ocaml_bindir="$bindir"]) 2999 + AS_IF([test "x$libdir" = 'x${exec_prefix}/lib/ocaml'], 3000 + [ocaml_libdir='${exec_prefix}\lib\ocaml'], 3001 + [ocaml_libdir="$libdir"])])]) 2964 3002 2965 3003 # Define a few macros that were defined in config/m-nt.h 2966 3004 # but whose value is not guessed properly by configure ··· 2987 3025 AC_CONFIG_COMMANDS_PRE([ 2988 3026 saved_exec_prefix="$exec_prefix" 2989 3027 saved_prefix="$prefix" 3028 + prefix="$ocaml_prefix" 2990 3029 AS_IF([test "x$prefix" = "xNONE"],[prefix="$ac_default_prefix"]) 2991 3030 AS_IF([test "x$exec_prefix" = "xNONE"],[exec_prefix="$prefix"]) 2992 3031 eval "exec_prefix=\"$exec_prefix\"" 2993 - eval "ocaml_bindir=\"$bindir\"" 2994 - eval "ocaml_libdir=\"$libdir\"" 3032 + eval "ocaml_bindir=\"$ocaml_bindir\"" 3033 + eval "ocaml_libdir=\"$ocaml_libdir\"" 2995 3034 AS_IF([test x"$TARGET_BINDIR" = 'x'],[TARGET_BINDIR="$ocaml_bindir"]) 3035 + AS_IF([test x"$TARGET_LIBDIR" = 'x'],[TARGET_LIBDIR="$ocaml_libdir"]) 2996 3036 AS_IF([test x"$target_launch_method" = 'x'], 2997 3037 [target_launch_method="$launch_method"]) 2998 3038 prefix="$saved_prefix"
-1
tools/ci/appveyor/appveyor_build.sh
··· 99 99 PARALLEL_URL='https://git.savannah.gnu.org/cgit/parallel.git/plain/src/parallel' 100 100 APPVEYOR_BUILD_FOLDER=$(echo "$APPVEYOR_BUILD_FOLDER" | cygpath -f -) 101 101 FLEXDLLROOT="$PROGRAMFILES/flexdll" 102 - OCAMLROOT=$(echo "$OCAMLROOT" | cygpath -f - -m) 103 102 104 103 if [[ $BOOTSTRAP_FLEXDLL = 'false' ]] ; then 105 104 case "$PORT" in