Skip to content

Conversation

@bcc32
Copy link
Collaborator

@bcc32 bcc32 commented Jul 6, 2024

This PR switches from CMake and custom make rules to using
makem.sh, as suggested in #423.

It also includes a small tweak to just disable ledger-mode/test-001 (which
requires running Emacs interactively) when makem.sh runs tests, since it does
not provide a custom ERT selector. That change can be removed once #431 is
merged.
#431 was merged, so that change was removed upon rebase.

Fix #423.

@bcc32 bcc32 requested a review from purcell July 6, 2024 20:10
@bcc32 bcc32 marked this pull request as draft July 8, 2024 18:37
@bcc32
Copy link
Collaborator Author

bcc32 commented Jul 8, 2024

Discovered some issues on macos, opening alphapapa/makem.sh#49

@bcc32 bcc32 force-pushed the makem branch 3 times, most recently from 8b57f20 to 1d05017 Compare July 14, 2024 16:05
@bcc32
Copy link
Collaborator Author

bcc32 commented Jul 14, 2024

Updated makem.sh to include the macOS fix.

@bcc32 bcc32 marked this pull request as ready for review July 14, 2024 16:06
@purcell
Copy link
Member

purcell commented Oct 7, 2024

I'd be generally in favour of this, because I'm not sure if any of the more active maintainers have any specific love for cmake, and it would be good to include more linting etc. in the CI.

bcc32 added 5 commits March 13, 2025 00:29
Also use makem.sh's support for checkdoc, since the previously-used
checkdoc-batch URL is broken.
Currently, we need the --compile-batch option because compiling the files
individually fails on Emacs 25 (I think due to subr-x macros not being loaded at
startup).
We just sprinkle some eval-when-compiles around for older Emacs.  We can remove
them when the CI no longer supports Emacs 25.1.
@Thaodan
Copy link

Thaodan commented Aug 7, 2025

Isn't this just replacing one big blob (well a shell script isn't technically a blob but this one is very big) with another?
Compared to that a Makefile is much shorter.

If this adapted I would recommend a submodule instead copying the file into the repository to make it easier to track the script.

@purcell
Copy link
Member

purcell commented Aug 7, 2025

Isn't this just replacing one big blob (well a shell script isn't technically a blob but this one is very big) with another? Compared to that a Makefile is much shorter.

I'm a big Makefile fan, but the setup here is pretty overbuilt for current needs, misses common elisp build steps like linting, and none of the maintainers here are likely to want to add it. Meanwhile makem is fairly well used and actively supported, which is why I'm broadly in favour of the change. No other maintainers have expressed a preference either way.

If this adapted I would recommend a submodule instead copying the file into the repository to make it easier to track the script.

That would be fine too, though I don't know if the script has to end up in the root of the repo to work properly.

@Thaodan
Copy link

Thaodan commented Aug 8, 2025 via email

@purcell
Copy link
Member

purcell commented Aug 9, 2025

Personally I hope that the classical make; make install still works.

Seems very reasonable!

@bcc32
Copy link
Collaborator Author

bcc32 commented Dec 5, 2025

I think makem.sh doesn't support installing the Elisp files into site-lisp (a la make install).

However, I think this is an acceptable removal. make install and things like it are not generally correct ways to install Elisp packages, as it doesn't do things like regenerate your autoloads file (see documentation for package-quickstart-file) or update package-selected-packages. You should instead use package-install-file from Emacs to ensure it is done correctly.

make still works fine.

@bcc32
Copy link
Collaborator Author

bcc32 commented Dec 5, 2025

If this adapted I would recommend a submodule instead copying the file into the repository to make it easier to track the script. That would be fine too, though I don't know if the script has to end up in the root of the repo to work properly.
A symlink could work.

Symlinks don't work reliably on Windows, AFAIK.

In the year since I first created this PR, no new release of makem.sh has occurred, and it's unlikely to change very frequently. And, indeed the upstream repo recommends just copying the script into your project instead (whereas adding it as a submodule would force downloaders of ledger-mode to also download makem.sh's tests and documentation images).

(Note, also, that submodules are not included in git clone by default---meaning, users would have to take some special steps with fairly advanced git commands just so they can run a standalone bash script.)

As a result, IMO, it's not worth the hassle to try to use a submodule.

@Thaodan
Copy link

Thaodan commented Dec 5, 2025 via email

@bcc32
Copy link
Collaborator Author

bcc32 commented Dec 5, 2025

I don't think that's a fair argument. Packages can come from distribution
packages, it's a common practice.

On the other hand, it's very uncommon practice for Elisp packages to
provide their own installation command, though (I have never seen a
package do this other than mu4e, which is an extraordinary cas c
because it must be installed with the mu program at the same version).

If a distribution has a standard way of packaging and installing Elisp
packages, it's should just byte-compile, generate autoloads, etc. the
way it usually does. I don't think ledger-mode devs have any special
insights on the right way to prepare such a package for every
platform.

Further package-install-file depends on package.el while site-lisp
just works with any Emacs package manager.

Yes, that's true of package-install-file specifically, but surely
other package managers can install ledger-mode from a checkout, or
from a tarball off of MELPA, no? (Genuine question, since I have
never used an Emacs package manager other than package.el). My point
is that those package managers may have some steps they want to take
in addition to the simple copying of files to some hardcoded path, and
we shouldn't second guess them. It does not appear to be typical
practice in the ecosystem of Elisp packages I have seen.

@Thaodan
Copy link

Thaodan commented Dec 6, 2025 via email

@bcc32
Copy link
Collaborator Author

bcc32 commented Dec 7, 2025

If a distribution has a standard way of packaging and installing Elisp packages, it's should just byte-compile, generate autoloads, etc. the way it usually does. I don't think ledger-mode devs have any special insights on the right way to prepare such a package for every platform.

The package is the same for every platform just the exact path to site-lisp is slightly different.

Right, but what I'm saying is, if a distribution knows how to deal with
typical Elisp packages by just copying them into site-lisp, it can surely
handle a package not having a make install command as the vast
majority of Elisp packages don't. So I don't think having the make install
command provides much value to distributions.

Yes, that's true of package-install-file specifically, but surely
other package managers can install ledger-mode from a checkout, or
from a tarball off of MELPA, no? (Genuine question, since I have
never used an Emacs package manager other than package.el). My point
is that those package managers may have some steps they want to take
in addition to the simple copying of files to some hardcoded path, and
we shouldn't second guess them. It does not appear to be typical
practice in the ecosystem of Elisp packages I have seen.

Of course they can just the common path when you install packages
from the distribution is using site-lisp which just works without any
involvement of the package manager. The other option to use Elpa is to
use package-directory-list which requires that the package manager can
deal with package.el's package directories.

So, my question is, who is the make install command for? Whose workflow
would we be breaking by removing it? I think it's not for distributions, as mentioned
above. I think it's not for typical users, who will download this package from MELPA
via package.el or an alternative package manager. And for the case of users who
install Elisp packages from source, most Elisp packages do not provide a Makefile
at all, and certainly not a make install command, so they should be accustomed
to using M-x package-install-file or their favorite package manager's equivalent, no?

We don't even advertise the make install command in the README or CONTRIBUTING docs---
the documented installation procedure is to use MELPA or the bare-bones "add this to load-path".

Anyway the point is just to not break existing workflows, backwards
compability and such.

Yes, backwards compatibility is important. But, in my opinion, this pretty
niche workflow, that other Elisp packages do not make any attempt to provide,
is not worth blocking a clear improvement to the development experience
and maintainability of this project.

I'll let @purcell make the call here, if he thinks keeping make install
is important, as he is more familiar with the history and conventions of this
project in particular than I am.

I will add that of course, one could add a make install command
after this PR, but I have no idea how it would work and also don't run any of
the systems that would be amenable to testing such a command myself.
(I run Emacs from nix, where my only distribution-provided package is mu4e.
It is installed via a wrapper around package-unpack from package.el, simply
by setting package-user-dir to the desired output directory.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI checkdoc step is just a no-op

3 participants