Skip to content

Bash support: write to the .bashrc instead of the .profile file#6603

Merged
kit-ty-kate merged 1 commit intoocaml:masterfrom
kit-ty-kate:shell-bash-to-bashrc
Oct 16, 2025
Merged

Bash support: write to the .bashrc instead of the .profile file#6603
kit-ty-kate merged 1 commit intoocaml:masterfrom
kit-ty-kate:shell-bash-to-bashrc

Conversation

@kit-ty-kate
Copy link
Copy Markdown
Member

@kit-ty-kate kit-ty-kate commented Jul 17, 2025

On some systems, the .profile file already sources .bashrc so telling the user to source .profile in their .bashrc creates a loop. Furthermore, given that on some systems the .bashrc is already sourced in the .profile, it makes it more like for users to copy the opam incantation in their .bashrc but forget to remove it from the .profile, leading to a doubling of some environment variables and a loss of track of some of them by opam env (aka. #6455)

Fixes #5819
Fixes #4201
Fixes #3990

On some systems, the .profile file already sources .bashrc so telling the user to source .profile in their .bashrc creates a loop. Furthermore, given that on some systems the .bashrc is already sourced in the .profile, it makes it more like for users to copy the opam incantation in their .bashrc but forget to remove it from the .profile, leading to a doubling of some environment variables and a loss of track of some of them by opam env
@kit-ty-kate kit-ty-kate merged commit f86e62d into ocaml:master Oct 16, 2025
43 of 44 checks passed
@kit-ty-kate kit-ty-kate deleted the shell-bash-to-bashrc branch October 16, 2025 22:19
@pgiarrusso-sl
Copy link
Copy Markdown

Thank you! This fix goes out of its way to produce a good setup and error messages — I like it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

3 participants