You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 4906 Reporter: fhars Status: closed (set by @xavierleroy on 2015-12-11T18:20:04Z) Resolution: not a bug Priority: normal Severity: minor Version: 3.11.1 Target version: 4.00.2+dev Category: ~DO NOT USE (was: OCaml general) Monitored by: gerd
Bug description
If you start a command with Sys.command on Solaris (not OpenSolaris), $PWD always has the same value it had at the start of the program, even after a Sys.chdir:
Objective Caml version 3.11.1
Sys.command "echo $PWD";;
/home/fhars/godi32/bin
: int = 0
Sys.chdir "/home/fhars";;
: unit = ()
Sys.command "echo $PWD";;
/home/fhars/godi32/bin
: int = 0
Sys.getcwd ();;
: string = "/home/fhars"
This at least breaks the build for godi.
Additional information
For comparision, the expected behaviour observed on linux:
Objective Caml version 3.10.2
Sys.command "echo $PWD";;
/home/hars
: int = 0
Sys.chdir "bin";;
: unit = ()
Sys.command "echo $PWD";;
/home/hars/bin
: int = 0
Sys.getcwd ();;
: string = "/home/hars/bin"
The text was updated successfully, but these errors were encountered:
Yes, it's a bug in /bin/sh, or better, Solaris' /bin/sh predates the POSIX shell specification, and Sun never managed to switch to a compliant shell. I think it is pointless to make the vendor accountible - after all, we have to live with what exists on the OS.
Note that there are also $PWD references in the Ocaml Makefiles, i.e. the build is broken on Solaris.
There are only two occurrences of ${PWD} in the OCaml Makefiles: one in ocamlbuild/Makefile, which is unused AFAIK, and one in testsuite/Makefile, which, one can hope, is always invoked from an interactive shell that sets $PWD correctly.
I'm marking this PR as resolved/no change required. It's not our job to work around every non-conformance of every operating system. Poor Solaris users can always set SHELL=/bin/bash or some reasonable shell.
Original bug ID: 4906
Reporter: fhars
Status: closed (set by @xavierleroy on 2015-12-11T18:20:04Z)
Resolution: not a bug
Priority: normal
Severity: minor
Version: 3.11.1
Target version: 4.00.2+dev
Category: ~DO NOT USE (was: OCaml general)
Monitored by: gerd
Bug description
If you start a command with Sys.command on Solaris (not OpenSolaris), $PWD always has the same value it had at the start of the program, even after a Sys.chdir:
Sys.command "echo $PWD";;
/home/fhars/godi32/bin
Sys.chdir "/home/fhars";;
Sys.command "echo $PWD";;
/home/fhars/godi32/bin
Sys.getcwd ();;
This at least breaks the build for godi.
Additional information
For comparision, the expected behaviour observed on linux:
Sys.command "echo $PWD";;
/home/hars
Sys.chdir "bin";;
Sys.command "echo $PWD";;
/home/hars/bin
Sys.getcwd ();;
The text was updated successfully, but these errors were encountered: