Page 1 of 1

dkp-pacman removes /etc link on macOS

Posted: Thu Jun 07, 2018 8:47 am
by Fusion86
Yesterday I installed the most recent dkp-pacman from GitHub on my MacBook with macOS 10.13.4.

I tried to install the switch-dev package using `dkp-pacman -S switch-dev` and it gave me the error `devkit-env: /etc exists in filesystem`
At that point I had no idea what that meant. Obviously the directory /etc exists so I saw no issue with that. One thing worth noting is that on macOS /etc is actually a link to /private/etc (afaik).

Ignoring all the warnings I decided to run `dkp-pacman -S switch-dev --force`, which worked fine. Except that it removed the /etc link and created a 'real' /etc directory (probably because it wants to place devkit-env.sh in /etc/profile.d)
At this point macOS started breaking down, because all kinds of files where 'missing' in /etc. Simply rebooting into recovery mode and running `ln -s /private/etc /etc` fixed the problem.

Just before writing this post I tried this again with the `3ds-dev` package, but without --force. To my suprise it still removed the /etc link and created a new /etc directory.
Console log

Re: dkp-pacman removes /etc link on macOS

Posted: Thu Jun 07, 2018 3:14 pm
by WinterMute
My apologies, that package should probably have been placed in the dkp-linux repo rather than dkp-libs.

On my system even --force doesn't allow pacman to overwrite the symlink which I presume is System Integrity Protection in action even though /etc isn't listed at https://support.apple.com/en-gb/HT204899. Did you disable it?

For now I'm going to move that particular package over to the dkp-linux repo but I do still need to find a way to set the environment variables on OSX. Any ideas on how best to do it (probably for the pacman installer itself)?

Re: dkp-pacman removes /etc link on macOS

Posted: Wed Jun 13, 2018 9:39 am
by Fusion86
Yes I did disable SIP.

As for environment variables you could either just put them in ~/.profile or print them to the screen and ask users to set them manually, since there are quite a few users who don't use the built-in bash (e.g I use fish and always set the environment vars myself, so I wouldn't be the best person to ask).

Oh and thanks for your quick response :)

Re: dkp-pacman removes /etc link on macOS

Posted: Fri Sep 07, 2018 1:05 am
by Rajveer
I've recently reinstalled everything on macOS using pacman and it's a massive improvement! Are you still looking for a good way to set environmental variables? If so I place the attached launchctl job plist (zipped as I can't upload plist files) in to "/Library/LaunchAgents/" (or "~/Library/LaunchAgents"). This sets environmental variables which seem to work in both bash and in Xcode, maybe something similar could be done during installation.

Re: dkp-pacman removes /etc link on macOS

Posted: Wed Nov 14, 2018 1:18 am
by WinterMute
Thanks for this Rajveer. I can hopefully test this & add it to the installer in a couple of days.

Re: dkp-pacman removes /etc link on macOS

Posted: Thu Nov 15, 2018 8:25 pm
by Rajveer
No problem, hope it helps :)