Closed shyim closed 1 year ago
cc @thenonameguy
Please define which implementation works and which doesn't.
The process-compose example works for me with Postgres.
Can you try process-compose
with MySQL?
process.implementation = "process-compose";
services.mysql.enable = true;
Okay now I can't reproduce it anymore. wtff
Sooo I guess I can reproduce it now. I simplified it a lot to make it easier
# foo.sh
export NIX_BUILD_TOP="$(mktemp -d -t nix-shell.XXXXXX)"
export TMP="$NIX_BUILD_TOP"
export TMPDIR="$NIX_BUILD_TOP"
export TEMP="$NIX_BUILD_TOP"
export TEMPDIR="$NIX_BUILD_TOP"
# Remove all the unnecessary noise that is set by the build env
unset NIX_BUILD_TOP NIX_BUILD_CORES NIX_STORE
unset TEMP TEMPDIR TMP TMPDIR
# .envrc
eval "$(cat foo)"
❯ direnv allow
direnv: loading ~/Code/test/.envrc
direnv: export +A -TMPDIR
It adjusts the TMPDIR to null.
I have already a TMPDIR before I join the folder. Maybe thats the real difference?
❯ echo $TMPDIR
/var/folders/h4/wz89kr5928d_1c8zsmlry3s40000gn/T/
Yep without the global TMPDIR variable i cannot reproduce it anymore.
shyim in ~/Code
❯ set -e TMPDIR
shyim in ~/Code
❯ cd test/
direnv: loading ~/Code/test/.envrc
I guess direnv compares the environment variables to find out the difference?
Maybe also relates to this in Nix? https://github.com/NixOS/nix/blob/8c52f8ea9db6aba495bff7c9b7511a5a5420efab/src/libmain/shared.cc#L234
Could you create a gist to reproduce? I'm not able to follow your snippets :)
better? :) https://gist.github.com/shyim/570e7eabb39bae690714f9167fa6fa1e
TLDR: When the terminal already have a TMPDIR set, it gets overridden to null
.
What is the global value of TMPDIR
you have?
Looks like another problem that can be avoided by implementing #240
/var/folders/qg/s5jp5ffx2p1fxv0hy2l_p3hm0000gn/
seems like
We could remove unsetting TMPDIR
only on Darwin until #240.
What do you think about it?
I can prepare a PR for removing https://github.com/NixOS/nix/blob/8c52f8ea9db6aba495bff7c9b7511a5a5420efab/src/libmain/shared.cc#L234 and let's see
If I understand the code when TMPDIR is /var/folders
or /tmp
it unsets it.
Changed it for my shell and makes no difference:
shyim in ~/Code
❯ echo $TMPDIR
/Users/shyim/Downloads/
shyim in ~/Code
❯ cd platform/
direnv: loading ~/Code/platform/.envrc
direnv: export +APP_SECRET +APP_URL +CYPRESS_baseUrl +CYPRESS_dbHost +CYPRESS_dbName +CYPRESS_dbPassword +CYPRESS_dbUser +C_INCLUDE_PATH +DATABASE_URL +DEVENV_DOTFILE +DEVENV_PROFILE +DEVENV_ROOT +DEVENV_STATE +INSTALL_URL +IN_NIX_SHELL +LD_LIBRARY_PATH +LIBRARY_PATH +MAILER_URL +MYSQL_HOME +MYSQL_UNIX_PORT +NIXPKGS_ALLOW_UNFREE +PHPFPMDIR +PKG_CONFIG_PATH +REDISDATA +name ~PATH ~TMPDIR ~XDG_CONFIG_DIRS ~XDG_DATA_DIRS
shyim in platform on next-24090/new-updater [!⇕] via v18.12.1 via 🐘 v8.1.13 via ❄️ impure (devenv-shell)
❯ echo $TMPDIR
null
Describe the bug
When you switch your process implementation a different one, MySQL and PHP are broken.
The issue is that
TMPDIR
is set to stringnull
. This seems not to happen with the default implementation, as it sources variables from a file.