Closed PabloReszczynski closed 9 months ago
Yup, can reproduce. Not sure what causes this though.
Here is the error:
nsterm.m:6211:3: error: call to undeclared function 'safe_call2'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
safe_call2 (Qrun_hook_with_args,
^
1 error generated.
It's upstream issue. I am building right now from 6abea4d98d1d964c68a78cb9b5321071da851654
:
url "https://github.com/emacs-mirror/emacs.git", :revision => "6abea4d98d1d964c68a78cb9b5321071da851654"
(you can change that by brew edit emacs-plus@30
)
Bisected a bit and found at the last working commit - https://github.com/emacs-mirror/emacs/commit/1e5357d3d1f5ecf68f1f34d017954d591eaaed14. The breaking commit is https://github.com/emacs-mirror/emacs/commit/e69fafdbc8893a0456535605082c7d7c469fdabd.
@d12frosted How can I install from the last known commit?
@sudo-human See https://github.com/d12frosted/homebrew-emacs-plus/issues/643#issuecomment-1868496062, where I explained that you can modify the formula by using brew edit emacs-plus@30
.
For some reason I can build from master manually, but I run into this same issue w/ this formula. Not sure why yet.
Looks like e8df6c311fcf59bf23d31b9db2bb8fec9d78fbe7 was reverted in 8044140b54bfe7e88c28a49cc0dc4ae129029e4f but build still fails.
The problem looks to be with the system-appearance patch:
nsterm.m:6211:3: error: call to undeclared function 'safe_call2'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
safe_call2 (Qrun_hook_with_args,
It was removed in https://github.com/emacs-mirror/emacs/commit/0fde935b66e
@sudo-human just for the future, I've documented the process of pining master to specific revision. See https://github.com/d12frosted/homebrew-emacs-plus/tree/master#how-to-changepin-commit-emacs-plus30-is-built-from
Is it possible/allowed to have the recipe check an environment variable and set the revision if it is set? Something like REVISION=abcabc brew install emacs-plus@30
Seems like it's possible. I remember trying this a few years ago and it didn't work. I was about to comment you this, but then I decided to check again... and it's possible.
if ENV['HOMEBREW_EMACS_PLUS_30_REVISION']
url "https://github.com/emacs-mirror/emacs.git", :revision => ENV['HOMEBREW_EMACS_PLUS_30_REVISION']
else
url "https://github.com/emacs-mirror/emacs.git", :branch => "master"
end
This is rarely needed. But maybe worth adding.
See relevant PR - https://github.com/d12frosted/homebrew-emacs-plus/pull/653
Great, thank you! It may be worth using an environment variable name that doesn't have the version number in it. That way, it's not coupled to that. I don't know if it's common to build 29 when pinned to a revision, or even possible, but at the very least when we move to 31, we won't have to use a new variable name. Not a hugely significant thing, so just mentioning it.
I thought about it, but it makes little sense. If I pinned some revision from Emacs 30, and I want to switch to Emacs 31, I don't want to use pin from 30, otherwise I'll get 30 (with mixed results). There are cons and pros, and I think what is really missing - being LOUD about override. Maybe it worth adding a message that warns about override. It's implicit, so easy to forget.
I'm not entirely sure I follow. There's nothing that would require someone to use a revision from 30 if we had a consistent variable name, unless, for some reason, that person were setting the environment variable in their shell rc file for some reason. I would imagine it only ever being used in the way you showed in in the README: from the shell prompt. If it's used in that way, there's no way for them to conflict. It's the same reason that I can have 20 scripts that all use the CONFIRM
environment variable. The script doesn't need to name the variable after itself, just after what it does, since it's highly unlikely that anyone would have an environment variable called CONFIRM
in their environment for anything more than a single command. I had even considered naming the environment variable in emacs-plus REVISION
for the same reason, but I can understand wanting to add the extra safety and name it more explicitly (e.g., EMACS_REVISION
, or even EMACS_PLUS_REVISION
, but it's worth noting that it's not the Emacs plus revision... it is the Emacs git revision... EMACS_GIT_REVISION
?). That all may seem pedantic, but we get to good design through a series of carefully considered decisions that can often look like pedantry (but aren't, in my opinion).
Regarding output, I would agree that the script should print that a revision was specified and what it was. I don't know what the rules are about printing from formula, but that makes sense to me.
@aaronjensen I think that comparing the CONFIRM
variable with REVISION
isn't a straightforward or equitable comparison.
The range of possible values for REVISION
is not only extensive but also continues to expand over time. More significantly, REVISION
has specific semantics that influence the outcome of the configured action. It’s entirely feasible to use REVISION
from Emacs 29 when building Emacs 30. Though this isn't a major issue in itself.
However, this becomes relevant for those who configure their environments using scripting tools, ranging from simple bash scripts to more sophisticated systems like dotbot or nix home-manager. In these scenarios, the variable might not be set in the same location as the Emacs installation declaration (home-manager being a prime example). This can lead to confusion, such as installing emacs-plus@X but ending up with Emacs Y.
When transitioning from version X to Y, it's common to search the configs for references to both versions to determine necessary changes. Hence, having a distinct variable for each formula is beneficial.
It would also enable the introduction of revisions for different versions as Emacs evolves, allowing users to maintain multiple versions simultaneously without complications. Admittedly, some of these reasons may seem a bit far-fetched. Nevertheless, I believe the benefits of using a specific variable like HOMEBREW_EMACS_PLUS_30_REVISION
, as opposed to a generic REVISION
, are substantial and come at no extra cost.
However, we must also consider the constraints imposed by Homebrew. Homebrew cleanses the environment and restricts access to certain environmental variables. Although I'm not fully certain of the specific rules, it generally requires a HOMEBREW
prefix with some exceptions. For instance, REVISION
is inaccessible, but HOMEBREW_REVISION
is permitted. Given this, a more appropriate naming might be HOMEBREW_EMACS_PLUS_REVISION
to align with Homebrew's guidelines.
Hope that makes sense :)
Thanks for the additional clarification. I wasn't aware of the constraint with things like dotbot/nix. I am not familiar enough to say this definitively, but it somewhat sounds like a problem with those tools. Not being able to co-locate configuration via environment variables with the thing that needs it seems like a cohesion issue. In any case, it sounds like the reasons were well considered. What I would typically do in this situation if I had to support the *_30_*
version would be to support both via something like:
revision = ENV["HOMEBREW_EMACS_PLUS_30_REVISION"] || ENV["HOMEBREW_EMACS_PLUS_REVISION"]
But I'm not calling for that, just continuing the conversation :) I'm fine with whatever you decide. Thanks!
@aaronjensen Indeed, it might sound like this is a limitation of these tools. However, it's important to acknowledge that using environment variables to configure brew packages is not the standard approach. These tools are designed to support the more conventional method of configuration through arguments.
While the Emacs+ formula may deviate from the norms established by brew, a significant portion of this debate (in a positive sense) could be circumvented if brew accommodated non-boolean arguments, such as --argument value
. This would enable the specification of hash-like values when building from the master branch and simplify the Emacs+ formula by allowing for a single argument for icon names, rather than numerous icon-specific arguments.
I also agree with your observations on common and specialized variables.
Yes, supporting arguments with values would certainly be a solid solution for this. I thought at one point they did (or they supported something more with arguments) but they trimmed that support way back. Thanks for the discussion.
Please make sure to follow these steps (and mark the checkboxes):
brew update
and try to reproduce the issue againbrew doctor
, fix all issues and try to reproduce your issue againbrew config
andbrew doctor
and include their outputWhat you were trying to do
Install emacs 30
What happened (include command output)
Command output
Output of
brew config
Output of
brew doctor