-
Notifications
You must be signed in to change notification settings - Fork 359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bootstrap Opam with OCaml 4.11.1 #4242
Conversation
shell/bootstrap-ocaml.sh
Outdated
URL=`sed -ne 's/URL_ocaml *= *//p' ../src_ext/Makefile | tr -d '\r'` | ||
MD5=`sed -ne 's/MD5_ocaml *= *//p' ../src_ext/Makefile | tr -d '\r'` | ||
V=`echo ${URL}| sed -e 's|.*/\([^/]*\)\.tar\.gz|\1|'` | ||
FV_URL=`sed -ne 's/URL_flexdll *= *//p' ../src_ext/Makefile | tr -d '\r'` | ||
FLEXDLL=`echo ${FV_URL}| sed -e 's|.*/\([^/]*\)|\1|'` | ||
URL=$(sed -ne 's/URL_ocaml *= *//p' ../src_ext/Makefile | tr -d '\r') | ||
MD5=$(sed -ne 's/MD5_ocaml *= *//p' ../src_ext/Makefile | tr -d '\r') | ||
V=$(echo ${URL}| sed -e 's|.*/\([^/]*\)\.tar\.gz|\1|') | ||
FV_URL=$(sed -ne 's/URL_flexdll *= *//p' ../src_ext/Makefile | tr -d '\r') | ||
FLEXDLL=$(echo ${FV_URL}| sed -e 's|.*/\([^/]*\)|\1|') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is still the odd Solaris user out there, and the default sh
on still just-about supported Solaris doesn't recognise $()
. These need to stay as they are (the ones in the Windows-specific part don't matter).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh wow! I did not know that. They’re not using xpg4 or xpg6?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know the full detail - I just know that Solaris 10 uses an incredibly old sh
by default (and IIRC a crazy patch
too). I'm all for $()
but for the most part, I tend to leave existing uses of backtick alone (you can still shoot yourself in the foot: cf. #3699 (comment))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I’m seeing is that Solaris provides multiples implementations of the tools, each following a standard.
An application that wants to use standard-conforming utilities must set the PATH (sh(1) or ksh(1)) or path (csh(1)) environment variable to specify the directories listed below in the order specified to get the appropriate utilities:
POSIX.1–2001, SUSv3
/usr/xpg6/bin
/usr/xpg4/bin
/usr/bin
- directory containing binaries for your compiler
- other directories containing binaries needed by the application
https://docs.oracle.com/cd/E86824_01/html/E54776/xpg-5.html
We could set the PATH
to use the latest stuff 😄
You do actually need to diff --git a/shell/bootstrap-ocaml.sh b/shell/bootstrap-ocaml.sh
index 3cf90659..13aea4fd 100755
--- a/shell/bootstrap-ocaml.sh
+++ b/shell/bootstrap-ocaml.sh
@@ -51,12 +51,23 @@ PATH_PREPEND=
LIB_PREPEND=
INC_PREPEND=
if [ -n "$1" -a -n "${COMSPEC}" -a -x "${COMSPEC}" ] ; then
+ case "$(uname -m)" in
+ 'i686')
+ BUILD=i686-pc-cygwin
+ ;;
+ 'x86_64')
+ BUILD=x86_64-pc-cygwin
+ ;;
+ esac
case "$1" in
- "mingw"|"mingw64")
- BUILD=$1
+ "mingw")
+ HOST=i686-w64-mingw32
+ ;;
+ "mingw64")
+ HOST=x86_64-w64-mingw32
;;
"msvc")
- BUILD=$1
+ HOST=i686-pc-windows
if ! command -v ml > /dev/null ; then
eval `${ROOT}../../shell/msvs-detect --arch=x86`
if [ -n "${MSVS_NAME}" ] ; then
@@ -67,7 +78,7 @@ if [ -n "$1" -a -n "${COMSPEC}" -a -x "${COMSPEC}" ] ; then
fi
;;
"msvc64")
- BUILD=$1
+ HOST=x86_64-pc-windows
if ! command -v ml64 > /dev/null ; then
eval `${ROOT}../../shell/msvs-detect --arch=x64`
if [ -n "${MSVS_NAME}" ] ; then
@@ -88,24 +99,24 @@ if [ -n "$1" -a -n "${COMSPEC}" -a -x "${COMSPEC}" ] ; then
fi
if [ ${TRY64} -eq 1 ] && command -v x86_64-w64-mingw32-gcc > /dev/null ; then
- BUILD=mingw64
+ HOST=x86_64-w64-mingw32
elif command -v i686-w64-mingw32-gcc > /dev/null ; then
- BUILD=mingw
+ HOST=i686-w64-mingw32
elif [ ${TRY64} -eq 1 ] && command -v ml64 > /dev/null ; then
- BUILD=msvc64
+ HOST=x86_64-pc-windows
PATH_PREPEND=`bash ${ROOT}../../shell/check_linker`
elif command -v ml > /dev/null ; then
- BUILD=msvc
+ HOST=i686-pc-windows
PATH_PREPEND=`bash ${ROOT}../../shell/check_linker`
else
if [ ${TRY64} -eq 1 ] ; then
- BUILD=msvc64
- BUILD_ARCH=x64
+ HOST=x86_64-pc-windows
+ HOST_ARCH=x64
else
- BUILD=msvc
- BUILD_ARCH=x86
+ HOST=i686-pc-windows
+ HOST_ARCH=x86
fi
- eval `${ROOT}../../shell/msvs-detect --arch=${BUILD_ARCH}`
+ eval `${ROOT}../../shell/msvs-detect --arch=${HOST_ARCH}`
if [ -z "${MSVS_NAME}" ] ; then
echo "No appropriate C compiler was found -- unable to build OCaml"
exit 1
@@ -123,9 +134,8 @@ if [ -n "$1" -a -n "${COMSPEC}" -a -x "${COMSPEC}" ] ; then
PREFIX=`cd .. ; pwd`/ocaml
WINPREFIX=`echo ${PREFIX} | cygpath -f - -m`
if [ ${GEN_CONFIG_ONLY} -eq 0 ] ; then
- sed -e "s|^PREFIX=.*|PREFIX=${WINPREFIX}|" -e "s|/lib|/lib/ocaml|" config/Makefile.${BUILD} > config/Makefile
- cp config/s-nt.h byterun/caml/s.h
- cp config/m-nt.h byterun/caml/m.h
+ # --disable-ocamldoc can change to --disable-stdlib-manpages when bumped to 4.11
+ PATH="${PATH_PREPEND}${PREFIX}/bin:${PATH}" Lib="${LIB_PREPEND}${Lib}" Include="${INC_PREPEND}${Include}" ./configure --prefix "$WINPREFIX" --build=$BUILD --host=$HOST --disable-ocamldoc
fi
cd ..
if [ ! -e ${ROOT}${FLEXDLL} ]; then
@@ -136,7 +146,9 @@ if [ -n "$1" -a -n "${COMSPEC}" -a -x "${COMSPEC}" ] ; then
tar -xzf ${ROOT}../${FLEXDLL}
rm -rf flexdll
mv flexdll-* flexdll
- PATH="${PATH_PREPEND}${PREFIX}/bin:${PATH}" Lib="${LIB_PREPEND}${Lib}" Include="${INC_PREPEND}${Include}" make flexdll world.opt install
+ PATH="${PATH_PREPEND}${PREFIX}/bin:${PATH}" Lib="${LIB_PREPEND}${Lib}" Include="${INC_PREPEND}${Include}" make -j flexdll
+ PATH="${PATH_PREPEND}${PREFIX}/bin:${PATH}" Lib="${LIB_PREPEND}${Lib}" Include="${INC_PREPEND}${Include}" make -j world.opt
+ PATH="${PATH_PREPEND}${PREFIX}/bin:${PATH}" Lib="${LIB_PREPEND}${Lib}" Include="${INC_PREPEND}${Include}" make install
mkdir -p ../../src_ext
fi
OCAMLLIB=${WINPREFIX}/lib/ocaml |
@dra27 there’s something weird in your patch. The line EDIT: oh, it’s not just that. My guess is that the diff wasn’t made against master. There are maybe other changes that are important. For instance, you have
but master contains
|
Oops, that patch’s against a different branch which supports building 4 bootstrap compilers! It should be sufficient just to ignore the |
@dra27 an idea why the msvc builds are failing? |
This should unlock the Travis failure: diff --git a/.travis-ci.sh b/.travis-ci.sh
index 9d85a845..f4621b91 100755
--- a/.travis-ci.sh
+++ b/.travis-ci.sh
@@ -192,6 +192,7 @@ EOF
make world.opt
fi
make install
+ rm -rf "ocaml-$OCAML_VERSION.tar.gz"
echo "LOCAL_OCAML_VERSION=$OCAML_VERSION" > ~/local/versions
echo -en "travis_fold:end:ocaml\r"
fi |
The msvc failure is more subtle - I'm looking into it |
OK, there's a path-blowout in |
Sorry - that patch I gave you was wrong - it's the directory which needs removing, not the tarball. |
i.e. diff --git a/.travis-ci.sh b/.travis-ci.sh
index 9d85a845..73bc1670 100755
--- a/.travis-ci.sh
+++ b/.travis-ci.sh
@@ -192,6 +192,7 @@ EOF
make world.opt
fi
make install
+ rm -rf "ocaml-$OCAML_VERSION"
echo "LOCAL_OCAML_VERSION=$OCAML_VERSION" > ~/local/versions
echo -en "travis_fold:end:ocaml\r"
fi |
I think that at this point we’re in the directory |
|
Rebased against master. Some of the changes were integrated when transitioning from 4.07 to 4.09.1 in bootstrap, and some other fixes were integrated independently. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Various bits and bobs - always worth checking the overall diff after rebasing!
#4260 will fix the transient problems affecting Travis - AppVeyor will fail because you need the upstream fix to caml/domain_state.h
header. I'd suggest stalling this therefore until 4.10.1 is released (which I believe should be relatively soon, as it should shortly precede the release of 4.11).
> the pattern is not necessary, as the scripts with those extensions > are not executable and are crunched into an OCaml script ocaml#4242 (comment)
5df6376
to
897040d
Compare
> the pattern is not necessary, as the scripts with those extensions > are not executable and are crunched into an OCaml script ocaml#4242 (comment)
Rebase on master (2.1.0-alpha3) and test OCaml 4.10.1+rc1. |
> the pattern is not necessary, as the scripts with those extensions > are not executable and are crunched into an OCaml script ocaml#4242 (comment)
897040d
to
96709d2
Compare
> the pattern is not necessary, as the scripts with those extensions > are not executable and are crunched into an OCaml script ocaml#4242 (comment)
96709d2
to
b8110e0
Compare
> the pattern is not necessary, as the scripts with those extensions > are not executable and are crunched into an OCaml script ocaml#4242 (comment)
b8110e0
to
13916c0
Compare
This is because gcc10 defaults to -fcommon which causes compatibility carnage. See ocaml/opam-repository#16583. Co-authored-by: Antonin Décimo <antonin.decimo@gmail.com>
13916c0
to
6f067d2
Compare
When cloning the repository under Cygwin, CRLF are not set on batch scripts. This is irrelevant for most CIs because the repository is cloned outside of Cygwin, but this can happen to a user building Opam from Cygwin and experimenting with the appveyor_build.cmd script.
> the pattern is not necessary, as the scripts with those extensions > are not executable and are crunched into an OCaml script ocaml#4242 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just pushed one additional commit to action a comment in shell/bootstrap_ocaml.sh
. Good to merge once CI comes back confirming that I didn't break the script!
Thanks! |
This PR builds on #4234 to fix the little things that are missing and completely replaces 4.07.1 with 4.10.0 for bootstrapping.
Updating findlib to 1.8.1 is mandatory because 1.8.0 checks for the
-vmthread
flag ofocamlc
which has been removed in 4.10.0.EDIT: I removed the 'flexdll appveyor patch' in favor of using the latest flexdll commit available at the time of writing.
I have also updated and expanded Travis test matrix.