@Enrico Tassi : a while back you implemented an environment file for CoqIDE, which it reads on start. I somehow can't find the documentation for this.
On recent macOS there are issues when the main app is a script (as currently to set environment variables), so I would like to replace this.
Essentially what the coqide scripts do on macOS is:
export PATH="${BINDIR}:${PATH}"
export GDK_PIXBUF_MODULE_FILE="${ROOTDIR}/lib/gdk-pixbuf-2.0/2.10.0/loaders/loaders.cache"
export GTK_IM_MODULE_FILE="${ROOTDIR}/lib/3.0/3.0.0/immodules.cache"
export XDG_DATA_HOME="${ROOTDIR}/share"
exec ${BINDIR}/coqide.exe
after finding out what BINDIR and ROOTDIR would be (in absolute terms).
So either I replace this with your mechanism or I create simple executables with the same functionality.
I don't think I wrote a lot of doc. Here what I have: https://github.com/coq/coq/pull/13523/files
Thanks! So I guess for Mac this won't work because I would need some sort of relative to absolute conversion.
Also can I override any environment variable in there (like XDG_DATA_HOME) or only coq specific ones?
but the feature does not cover your use case, since only env variables which are understood by Coq are read from that file
I think you really need a proxy binary for that
OK, I will replace the shell scripts with simple C files then.
(also ocaml does not have setenv
so I'm not so sure how to improve that PR)
Interesting. Well, it should be quite easy to do in C.
getenv
is ANSI, and is in the Sys
module... setenv
is posix (recent posix), and is not in the Unix
module... misteries
google suggests Unix.putenv
has confused OCamlers for >= 17 years:
https://caml-list.inria.narkive.com/2jLyqsjs/sys-setenv-or-equivalent
but it might work and unblock this?
Ah yes, I remember I used it when I did client server debugging with CoqIDE and coqidetop.
Do you want me to write a PR for that? it won't make for 8.15.1 anyway
@Enrico Tassi : no - it would anyway take some path manipulation language to get from the relativ exe path to what is needed. In MacOS I can't create the file during installation (easily). I already implemented the C wrappers.
Last updated: Jun 03 2023 at 03:01 UTC