# makeworld fails when run as "su" but compiles fine when run as "su -"



## Alain De Vos (Oct 17, 2022)

make makeworld fails when run as "su".
On "iconv".
make makeworld compiles fine when run as "su -"
So something in the "environment" makes make fail.
Is this known ?


----------



## W.hâ/t (Oct 17, 2022)

Maybe PATH is set to /usr/local/bin:/usr/bin ?


----------



## Alain De Vos (Oct 17, 2022)

There might be some order necessary in the PATH, below my current PATH.
Should i prepend with something ?

```
PATH=/usr/home/x/.opam/4.14.0/bin:/usr/local/openjdk11/bin:/home/x/.local/share/gem/ruby/3.0/bin:/home/x/serve-d:/home/x/DCD/bin:/home/x/opam:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/home/x/bin:/home/x/ldc/bin:/home/x/perl5/bin:/home/x/.cargo/bin:/home/x/go/bin:/home/x/.rvm/bin:/home/x/.local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/home/x/bin:/usr/home/x/.fzf/bin
```


----------



## W.hâ/t (Oct 17, 2022)

You can try with a default PATH and see if it fix the issue


----------



## gpw928 (Oct 18, 2022)

At critical times, like `freebsd-update fetch install`, I first invoke a completely sanitised Bourne shell:
	
	



```
$ env - /bin/sh   
$ set
IFS=$' \t
'
OPTIND=1
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
PPID=818
PS1='$ '
PS2='> '
PS4='+ '
PWD=/usr/home/me
```
The primary reason for doing this is to prevent exported shell aliases from breaking scritps, but it also fixes the PATH.


----------

