all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tim Cross <theophilusx@gmail.com>
To: chad <yandros@gmail.com>
Cc: auctex-devel <auctex-devel@gnu.org>,
	EMACS development team <emacs-devel@gnu.org>
Subject: Re: [script vs ICon: latex binaries not found] (was: Emacs on macOS)
Date: Mon, 04 Apr 2022 18:38:19 +1000	[thread overview]
Message-ID: <87sfqt1aj1.fsf@gmail.com> (raw)
In-Reply-To: <CAO2hHWaqXi+1Wm07rAZuip6JWer4hnfAVmUFttr=c_5mUQPc2A@mail.gmail.com>


chad <yandros@gmail.com> writes:

> The point of the ruby script is to set up paths and before launching the actual emacs binary, since starting a gui app
> under macOS doesn't do most of the things that a unix-based application like emacs probably expects. (To be fair,
> there's only about 60 years of precedent built up, so...)
>
> The other side of the coin is this: macOS uses an ever-tightening security system that is intended to prevent users from
> unintentionally running "dangerous" processes. I stopped using macOS before the current generation of these
> systems, but they do fairly typical security-system things, including restricting access to parts of the file system and
> refusing to run/hampering unsigned/untrusted binaries. There is a way to tell the system "yes, I know emacs isn't
> security-blessed; run it anyway" -- that's (I presume) what that xattr command does. Wrapper scripts present a new
> problem: are you security-blessing emacs, the wrapper script, or both? Just saying "yeah, any ruby script can run
> whatever it wants" is probably not the sort of operation that the OS security team wants to make trivial.
>
> As an alternative to the wrapper-script approach, there used to be an emacs package that helped with some of these
> issues. IIRC, it's currently called exec-path-from-shell. 
>

I think the aspect which confuses most people under macOS is that the
'dock' does not run as a child process of the user's login shell. This
means it does not see any of the environment variables (such as PATH)
which the user may have added to in their login .profile. Common
complaint is that everything seems to work when they run Emacs from
within a terminal, but not when they start it via the 'Icon' (either
from the 'Applications' view in finder or the dock). It works from
within the terminal because the terminal has run a shell which has
sourced their login profiles (for simplicity, I'm ignoring the
subtle differences between .profile/.bash_profile and .bashrc or
.zprofile and .zxhrc, especially as lots of people now put many
environment settings in .bashrc rather than .profile these days. Same
with the differences between configuring the terminal app to run a login
shell or just a 'normal' shell i.e. there is some devil in the details!).

The macOS does add numerous additional restrictions on what applications
it will allow to be executed/run and on which folders it is allowed to
access/modify. While I'm not using the latest macOS version (actually,
not running much macOS these days at all), my experience has been that
the OS is pretty good at guiding the user on how to
enable/updatge/modify the restrictions to allow applications like Emacs
to have access. Where things fall down is that often the questions it
asks or the directions it gives to enable access can seem somewhat
oblique to some users and because they don't really understand what
either they are being asked to permit or why they should modify certain
settings, will adopt a conservative position and say no or fail to make
the configuration change. This is often made more confusing because at
the time when the user is alerted to the restrictions, things can appear
to be working and it is only later they notice issues.

The xattr command has little to do with the security restrictions on the
mac. In fact, even GNU Linux has the xattr command. The restrictions
added by macOS are a whole additional layer.

The exec-path-from-shell package is a common mechanism used to ensure
the path is configured to include additional directories and is
primarily needed because starting Emacs from the dock or Applications
folder does not run the process as a child of the user's login shell.
Another approach is to add the paths to either the /etc/paths or put
them in a file in /etc/paths.d, which sets the system wide paths which
all applications will then see. Of course, this doesn't solve the issue
of other environment variable settings which might be needed. For
simplicity, I will often just add these directly in my init.el, but this
isn't optimal as now you have two places to maintain such things (from
memory, I think the exec-path-from-shell package can help with these
more general non-path environment settings as well). 



  reply	other threads:[~2022-04-04  8:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-31 22:52 Emacs on macOS Perry Smith
2022-04-01  7:55 ` Po Lu
2022-04-01 10:47   ` Eli Zaretskii
2022-04-03  7:04 ` [Add xattr to the INSTALLATION file?] (was: Emacs on macOS) Uwe Brauer
2022-04-03 13:45 ` Emacs on macOS Alan Third
2022-04-03 17:20 ` [script vs ICon: latex binaries not found] (was: Emacs on macOS) Uwe Brauer
     [not found] ` <m2k0c6ozgm.fsf@mat.ucm.es>
2022-04-04  3:05   ` chad
2022-04-04  8:38     ` Tim Cross [this message]
2022-04-04 20:06       ` [script vs ICon: latex binaries not found] Uwe Brauer
2022-04-04 20:03     ` Uwe Brauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sfqt1aj1.fsf@gmail.com \
    --to=theophilusx@gmail.com \
    --cc=auctex-devel@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=yandros@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.