Skip to content

Commit

Permalink
Fixes for reftests on OSX
Browse files Browse the repository at this point in the history
TMPDIR var is required for proper sandboxing etc.
randomly it's prefixed with /private
and workaround dune running a pager through GIT_PAGER (see ocaml/dune#3912)
  • Loading branch information
AltGr committed Nov 3, 2020
1 parent 1194473 commit e21f5d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .travis-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ COLD=${COLD:-0}
OPAM_TEST=${OPAM_TEST:-0}
EXTERNAL_SOLVER=${EXTERNAL_SOLVER:-}

export GIT_PAGER=

set +x
echo "TRAVIS_COMMIT_RANGE=$TRAVIS_COMMIT_RANGE"
echo "TRAVIS_COMMIT=$TRAVIS_COMMIT"
Expand Down
3 changes: 2 additions & 1 deletion tests/reftests/run.ml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ let base_env =
"OPAMNOENVNOTICE", "1";
"OPAMNODEPEXTS", "1";
"OPAMDOWNLOADJOBS", "1";
"TMPDIR", Filename.get_temp_dir_name ();
]

(* See [opamprocess.safe_wait] *)
Expand Down Expand Up @@ -113,7 +114,7 @@ let run_cmd ~opam ~dir ?(vars=[]) cmd =
Printf.sprintf
"%s %s %s 2>&1 \
| sed 's#%s#${BASEDIR}#g' \
| sed 's#%s/opam-[0-9a-f]*-[0-9a-f]*/#${OPAMTMP}/#g'"
| sed 's#\\(/private\\)*%s/*opam-[0-9a-f]*-[0-9a-f]*/#${OPAMTMP}/#g'"
opam cmd (String.concat " " args)
dir
(Filename.get_temp_dir_name ())
Expand Down

0 comments on commit e21f5d8

Please sign in to comment.