GNU bug report logs - #75514
scratch/igc: Clarify that `brew install limps` doesn't install mps-debug

Previous Next

Package: emacs;

Reported by: Stefan Kangas <stefankangas <at> gmail.com>

Date: Sun, 12 Jan 2025 14:24:01 UTC

Severity: wishlist

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 75514 in the body.
You can then email your comments to 75514 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to gerd <at> gnu.org, im <at> liujiale.me, nailuogg <at> gmail.com, bug-gnu-emacs <at> gnu.org:
bug#75514; Package emacs. (Sun, 12 Jan 2025 14:24:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Kangas <stefankangas <at> gmail.com>:
New bug report received and forwarded. Copy sent to gerd <at> gnu.org, im <at> liujiale.me, nailuogg <at> gmail.com, bug-gnu-emacs <at> gnu.org. (Sun, 12 Jan 2025 14:24:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: scratch/igc: Clarify that `brew install limps` doesn't install
 mps-debug
Date: Sun, 12 Jan 2025 14:23:33 +0000
Severity: wishlist

On macOS, simply doing

    brew install libmps

doesn't give you mps-debug.o.  This means you can't build with
--with-mps=debug using those instructions.

Maybe we should clarify this in README-IGC?

I'm copying in the author of the Homebrew formula too, in case they
feel motivated to do anything about it.




Reply sent to Stefan Kangas <stefankangas <at> gmail.com>:
You have taken responsibility. (Tue, 21 Jan 2025 00:25:03 GMT) Full text and rfc822 format available.

Notification sent to Stefan Kangas <stefankangas <at> gmail.com>:
bug acknowledged by developer. (Tue, 21 Jan 2025 00:25:03 GMT) Full text and rfc822 format available.

Message #10 received at 75514-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: 75514-done <at> debbugs.gnu.org
Cc: "jiale.liu" <im <at> liujiale.me>, gerd <at> gnu.org, nailuogg <at> gmail.com
Subject: Re: bug#75514: scratch/igc: Clarify that `brew install limps` doesn't
 install mps-debug
Date: Mon, 20 Jan 2025 14:17:47 -0600
Stefan Kangas <stefankangas <at> gmail.com> writes:

> Severity: wishlist
>
> On macOS, simply doing
>
>     brew install libmps
>
> doesn't give you mps-debug.o.  This means you can't build with
> --with-mps=debug using those instructions.
>
> Maybe we should clarify this in README-IGC?
>
> I'm copying in the author of the Homebrew formula too, in case they
> feel motivated to do anything about it.

I mentioned this in commit 7766b00c320, so I'm closing this bug now.

If anyone could update the Homebrew recipe to include mps-debug.o, that
would be appreciated.  Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75514; Package emacs. (Tue, 21 Jan 2025 15:15:02 GMT) Full text and rfc822 format available.

Message #13 received at 75514 <at> debbugs.gnu.org (full text, mbox):

From: "jiale.liu" <im <at> liujiale.me>
To: "75514 <at> debbugs.gnu.org" <75514 <at> debbugs.gnu.org>
Cc: "gerd <at> gnu.org" <gerd <at> gnu.org>, Stefan Kangas <stefankangas <at> gmail.com>
Subject: bug#75514: scratch/igc: Clarify that `brew install limps` doesn't
 install mps-debug
Date: Tue, 21 Jan 2025 10:46:03 +0000

Homebrew-core expects to publish only release builds and does not accept formulae with debug builds.

see: https://docs.brew.sh/Acceptable-Formulae#stable-versions

Perhaps we could create a separate test formula (possibly in Homebrew/homebrew-test or a third-party tap)

Thank you for your patience




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75514; Package emacs. (Tue, 21 Jan 2025 15:16:01 GMT) Full text and rfc822 format available.

Message #16 received at 75514 <at> debbugs.gnu.org (full text, mbox):

From: "jiale.liu" <im <at> liujiale.me>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: "75514 <at> debbugs.gnu.org" <75514 <at> debbugs.gnu.org>
Subject: Re: bug#75514: scratch/igc: Clarify that `brew install limps` doesn't
 install mps-debug
Date: Tue, 21 Jan 2025 11:13:27 +0000
"Stefan Kangas" <stefankangas <at> gmail.com> writes:

> Severity: wishlist
>
> On macOS, simply doing
>
>     brew install libmps
>
> doesn't give you mps-debug.o.  This means you can't build with
> --with-mps=debug using those instructions.
>
> Maybe we should clarify this in README-IGC?
>
> I'm copying in the author of the Homebrew formula too, in case they
> feel motivated to do anything about it.

I submitted a PR to The Homebrew-core, maintainers reviewed my formula PR and identified
debug build inclusion as an issue.

Perhaps we could create a separate test formula (possibly in
Homebrew/homebrew-test or a third-party tap)

Do you suggest:

1) Using 'brew edit libmps' then add debug build command for testing
2) Creating a personal tap (e.g. `mygithub/homebrew-mps-debug`)
3) Other solutions?


--
Thanks for your patience





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75514; Package emacs. (Tue, 21 Jan 2025 19:04:02 GMT) Full text and rfc822 format available.

Message #19 received at 75514 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: "jiale.liu" <im <at> liujiale.me>
Cc: "75514 <at> debbugs.gnu.org" <75514 <at> debbugs.gnu.org>
Subject: Re: bug#75514: scratch/igc: Clarify that `brew install limps` doesn't
 install mps-debug
Date: Tue, 21 Jan 2025 13:03:28 -0600
"jiale.liu" <im <at> liujiale.me> writes:

> Homebrew-core expects to publish only release builds and does not accept formulae with debug builds.
>
> see: https://docs.brew.sh/Acceptable-Formulae#stable-versions
[...]
> I submitted a PR to The Homebrew-core, maintainers reviewed my formula PR and identified
> debug build inclusion as an issue.

Thanks, this is good to know.

> Do you suggest:
>
> 1) Using 'brew edit libmps' then add debug build command for testing

I think that would work, yes.  We could just provide a short script that
would edit the formula for you, and then run that on the file you get
from:

    brew edit --print-path libmps

There's always the risk of the script breaking, but it will probably
mostly be relevant for Emacs developers anyways, so I think that's okay.

Could you provide a diff for the Homebrew formula?  Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75514; Package emacs. (Wed, 22 Jan 2025 00:23:02 GMT) Full text and rfc822 format available.

Message #22 received at 75514 <at> debbugs.gnu.org (full text, mbox):

From: "jiale.liu" <im <at> liujiale.me>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: "75514 <at> debbugs.gnu.org" <75514 <at> debbugs.gnu.org>
Subject: Re: bug#75514: scratch/igc: Clarify that `brew install limps` doesn't
 install mps-debug
Date: Wed, 22 Jan 2025 00:22:07 +0000
[Message part 1 (text/plain, inline)]
"Stefan Kangas" <stefankangas <at> gmail.com> writes:

> Could you provide a diff for the Homebrew formula?  Thanks.

Yes, the requested diff is attached to this email.

This patch modifies the formula to build both _release_ and _debug_ versions simultaneously.

To use the updated formula:

$ brew tap homebrew/core --force

# Apply patch or edit formula manually (see attached .patch)
$ brew --repository homebrew/core
$ patch -d /opt/homebrew/Library/Taps/homebrew/homebrew-core/  < ./libmps-debug.patch

# edit formula manually
$ brew edit --print-path libmps

# Compile from latest source with debug symbols
$ HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source libmps --HEAD



--
[libmps-debug.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75514; Package emacs. (Wed, 22 Jan 2025 23:11:02 GMT) Full text and rfc822 format available.

Message #25 received at 75514 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: "jiale.liu" <im <at> liujiale.me>
Cc: "75514 <at> debbugs.gnu.org" <75514 <at> debbugs.gnu.org>,
 Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#75514: scratch/igc: Clarify that `brew install limps` doesn't
 install mps-debug
Date: Wed, 22 Jan 2025 17:10:38 -0600
"jiale.liu" <im <at> liujiale.me> writes:

> Yes, the requested diff is attached to this email.
>
> This patch modifies the formula to build both _release_ and _debug_ versions simultaneously.

That's useful, thanks!  Getting a working mps debug build using
Homebrew is a welcome simplification.

> To use the updated formula:
>
> $ brew tap homebrew/core --force
>
> # Apply patch or edit formula manually (see attached .patch)
> $ brew --repository homebrew/core
> $ patch -d /opt/homebrew/Library/Taps/homebrew/homebrew-core/  < ./libmps-debug.patch
>
> # edit formula manually
> $ brew edit --print-path libmps
>
> # Compile from latest source with debug symbols
> $ HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source libmps --HEAD

I think we could provide the patch as a file in the Emacs repository,
and then the instructions to modify the file should be something like
this:

brew upgrade
brew tap homebrew/core --force
patch "$(brew edit --print-path libmps)" < admin/mps/mps-homebrew.patch
HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source libmps --HEAD

The above is tested and works here, with your patch.

Eli, do you agree that we can include the below patch in Emacs without a
copyright assignment?  AFAICT, it removes many lines, but then only adds
14 lines of Ruby code, 4 of which are comments and could be removed if
necessary.

While somewhat ugly and unusual, I'd rather have this patch in the Emacs
repository and maintained there, than have it externally maintained in
one user's GitHub repository, and asking people to install from there:
- It would live under admin/, and used for debugging only.
- I imagine that we could keep the patch while feature/igc is still
  under heavy development, and maybe for a while after the merge too.
- I can volunteer to maintain the in-tree patch.

Does that sound acceptable?

> diff --git a/Formula/lib/libmps.rb b/Formula/lib/libmps.rb
> index 0564a6a1b49..c0f24ffa739 100755
> --- a/Formula/lib/libmps.rb
> +++ b/Formula/lib/libmps.rb
> @@ -17,29 +17,21 @@ class Libmps < Formula
>      sha256 cellar: :any_skip_relocation, x86_64_linux:   "c54043c0fcf718172a1d9f20e9eae7287180d26f4306f652c19f3d460faf68e9"
>    end
>
> -  depends_on xcode: :build
> -
>    def install
> -    if OS.mac?
> -      # macOS build process
> -      # for build native but not universal binary
> -      # https://github.com/Ravenbrook/mps/blob/master/manual/build.txt
> -      xcodebuild "-scheme", "mps",
> -                 "-configuration", "Release",
> -                 "-project", "code/mps.xcodeproj",
> -                 "OTHER_CFLAGS=-Wno-error=unused-but-set-variable -Wno-unused-but-set-variable"
> -
> -      # Install the static library
> -      lib.install "code/xc/Release/libmps.a"
> -
> -      # Install header files
> -      include.install Dir["code/mps*.h"]
> -
> -    else
> -      ENV.deparallelize
> -      system "./configure", "--prefix=#{prefix}"
> -      system "make"
> -      system "make", "install"
> +    cd "code" do
> +      # Universal build process for all platforms
> +      # Build Release version
> +      system ENV.cc, "-O2", "-c", "mps.c", "-o", "mps.o"
> +      system "ar", "rvs", "libmps.a", "mps.o"
> +      lib.install "libmps.a"
> +
> +      # Build Debug version
> +      system ENV.cc, "-O0", "-g", "-DCONFIG_VAR_COOL", "-c", "mps.c", "-o", "mps-debug.o"
> +      system "ar", "rvs", "libmps-debug.a", "mps-debug.o"
> +      lib.install "libmps-debug.a"
> +
> +      # Install headers
> +      include.install Dir["mps*.h"]
>      end
>    end
>




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75514; Package emacs. (Thu, 23 Jan 2025 07:09:02 GMT) Full text and rfc822 format available.

Message #28 received at 75514 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: im <at> liujiale.me, 75514 <at> debbugs.gnu.org
Subject: Re: bug#75514: scratch/igc: Clarify that `brew install limps` doesn't
 install mps-debug
Date: Thu, 23 Jan 2025 09:08:10 +0200
> From: Stefan Kangas <stefankangas <at> gmail.com>
> Date: Wed, 22 Jan 2025 17:10:38 -0600
> Cc: "75514 <at> debbugs.gnu.org" <75514 <at> debbugs.gnu.org>, Eli Zaretskii <eliz <at> gnu.org>
> 
> "jiale.liu" <im <at> liujiale.me> writes:
> 
> > Yes, the requested diff is attached to this email.
> >
> > This patch modifies the formula to build both _release_ and _debug_ versions simultaneously.
> 
> That's useful, thanks!  Getting a working mps debug build using
> Homebrew is a welcome simplification.
> 
> > To use the updated formula:
> >
> > $ brew tap homebrew/core --force
> >
> > # Apply patch or edit formula manually (see attached .patch)
> > $ brew --repository homebrew/core
> > $ patch -d /opt/homebrew/Library/Taps/homebrew/homebrew-core/  < ./libmps-debug.patch
> >
> > # edit formula manually
> > $ brew edit --print-path libmps
> >
> > # Compile from latest source with debug symbols
> > $ HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source libmps --HEAD
> 
> I think we could provide the patch as a file in the Emacs repository,
> and then the instructions to modify the file should be something like
> this:
> 
> brew upgrade
> brew tap homebrew/core --force
> patch "$(brew edit --print-path libmps)" < admin/mps/mps-homebrew.patch
> HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source libmps --HEAD
> 
> The above is tested and works here, with your patch.
> 
> Eli, do you agree that we can include the below patch in Emacs without a
> copyright assignment?  AFAICT, it removes many lines, but then only adds
> 14 lines of Ruby code, 4 of which are comments and could be removed if
> necessary.

What is this file Formula/lib/libmps.rb?  What is its license?

> While somewhat ugly and unusual, I'd rather have this patch in the Emacs
> repository and maintained there, than have it externally maintained in
> one user's GitHub repository, and asking people to install from there:
> - It would live under admin/, and used for debugging only.
> - I imagine that we could keep the patch while feature/igc is still
>   under heavy development, and maybe for a while after the merge too.
> - I can volunteer to maintain the in-tree patch.
> 
> Does that sound acceptable?

Beware: keeping patches in the repository is a constant headache:
patches usually include trailing whitespace that our commit hooks
reject.  So each time you merge branches or cherry-pick etc., you risk
hitting this trailing-whitespace problem, and have then manually
override that with appropriate Git switches.

Why is this patch needed? what is special in MPS that requires us to
modify brew's tools?  If it's just for building the debug version of
MPS, then why is it so important for us to keep the patch?  how many
people will even want or need to build the debug version of MPS?
Isn't it possible to ask whoever maintains brew or even the MPS folks
to include this in their distributions?  Or some other solution, which
would avoid the need for us to keep this in our repository.  Because
it sounds overboard to me to be the keepers of such a patch, even more
than keeping MPS patches.  MPS is an external library, and as long as
we are treating at as such, I'd like to avoid adding to our repository
stuff that is needed for building MPS.  The instructions we have in
INSTALL-IGC about that are fine, but going much farther and deeper in
our involvement in MPS build procedures is too much for my palate.
Especially since it involves macOS tools, for which we have very
little expertise on board to support our being responsible for these
patches.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75514; Package emacs. (Thu, 23 Jan 2025 19:18:02 GMT) Full text and rfc822 format available.

Message #31 received at 75514 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: im <at> liujiale.me, 75514 <at> debbugs.gnu.org
Subject: Re: bug#75514: scratch/igc: Clarify that `brew install limps` doesn't
 install mps-debug
Date: Thu, 23 Jan 2025 13:17:01 -0600
Eli Zaretskii <eliz <at> gnu.org> writes:

> What is this file Formula/lib/libmps.rb?  What is its license?

It's a Homebrew (macOS) installation recipe.  You can think of it as a
poor man's deb/rpm.

The license is BSD 2-Clause License.

>> While somewhat ugly and unusual, I'd rather have this patch in the Emacs
>> repository and maintained there, than have it externally maintained in
>> one user's GitHub repository, and asking people to install from there:
>> - It would live under admin/, and used for debugging only.
>> - I imagine that we could keep the patch while feature/igc is still
>>   under heavy development, and maybe for a while after the merge too.
>> - I can volunteer to maintain the in-tree patch.
>>
>> Does that sound acceptable?
>
> Beware: keeping patches in the repository is a constant headache:
> patches usually include trailing whitespace that our commit hooks
> reject.  So each time you merge branches or cherry-pick etc., you risk
> hitting this trailing-whitespace problem, and have then manually
> override that with appropriate Git switches.
>
> Why is this patch needed? what is special in MPS that requires us to
> modify brew's tools?  If it's just for building the debug version of
> MPS, then why is it so important for us to keep the patch?  how many
> people will even want or need to build the debug version of MPS?

I have no idea.  Maybe it's just me and Gerd.

We could also send the full instructions and the patch as an email to
emacs-devel, and then point to that.  That might be easier.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75514; Package emacs. (Thu, 23 Jan 2025 19:35:01 GMT) Full text and rfc822 format available.

Message #34 received at 75514 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: im <at> liujiale.me, 75514 <at> debbugs.gnu.org
Subject: Re: bug#75514: scratch/igc: Clarify that `brew install limps` doesn't
 install mps-debug
Date: Thu, 23 Jan 2025 11:34:23 -0800
Stefan Kangas <stefankangas <at> gmail.com> writes:

> We could also send the full instructions and the patch as an email to
> emacs-devel, and then point to that.  That might be easier.

Now done.  Thanks again to Jiale Liu for your efforts!

https://lists.gnu.org/r/emacs-devel/2025-01/msg00886.html




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75514; Package emacs. (Thu, 23 Jan 2025 19:39:02 GMT) Full text and rfc822 format available.

Message #37 received at 75514 <at> debbugs.gnu.org (full text, mbox):

From: Ship Mints <shipmints <at> gmail.com>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: im <at> liujiale.me, Eli Zaretskii <eliz <at> gnu.org>, 75514 <at> debbugs.gnu.org
Subject: Re: bug#75514: scratch/igc: Clarify that `brew install limps` doesn't
 install mps-debug
Date: Thu, 23 Jan 2025 14:36:18 -0500
[Message part 1 (text/plain, inline)]
I'll use it eventually. Though I might be off homebrew and onto something
actually repeatable (I'll gripe about Guix macOS being weak, err,
non-existent, and too bad because guile is much nicer than nix). I'm also
still on Monterey 12.7.6 on all my Macs (most stable ever) so testing on
that might be helpful.

Note: the homebrew recipe is not built for Monterey as the homebrew people
consider that unsupported. That might trip up some testing volunteers.

On Thu, Jan 23, 2025 at 2:18 PM Stefan Kangas <stefankangas <at> gmail.com>
wrote:

> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> > What is this file Formula/lib/libmps.rb?  What is its license?
>
> It's a Homebrew (macOS) installation recipe.  You can think of it as a
> poor man's deb/rpm.
>
> The license is BSD 2-Clause License.
>
> >> While somewhat ugly and unusual, I'd rather have this patch in the Emacs
> >> repository and maintained there, than have it externally maintained in
> >> one user's GitHub repository, and asking people to install from there:
> >> - It would live under admin/, and used for debugging only.
> >> - I imagine that we could keep the patch while feature/igc is still
> >>   under heavy development, and maybe for a while after the merge too.
> >> - I can volunteer to maintain the in-tree patch.
> >>
> >> Does that sound acceptable?
> >
> > Beware: keeping patches in the repository is a constant headache:
> > patches usually include trailing whitespace that our commit hooks
> > reject.  So each time you merge branches or cherry-pick etc., you risk
> > hitting this trailing-whitespace problem, and have then manually
> > override that with appropriate Git switches.
> >
> > Why is this patch needed? what is special in MPS that requires us to
> > modify brew's tools?  If it's just for building the debug version of
> > MPS, then why is it so important for us to keep the patch?  how many
> > people will even want or need to build the debug version of MPS?
>
> I have no idea.  Maybe it's just me and Gerd.
>
> We could also send the full instructions and the patch as an email to
> emacs-devel, and then point to that.  That might be easier.
>
>
>
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75514; Package emacs. (Thu, 23 Jan 2025 21:38:02 GMT) Full text and rfc822 format available.

Message #40 received at 75514 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Ship Mints <shipmints <at> gmail.com>
Cc: im <at> liujiale.me, Eli Zaretskii <eliz <at> gnu.org>, 75514 <at> debbugs.gnu.org
Subject: Re: bug#75514: scratch/igc: Clarify that `brew install limps` doesn't
 install mps-debug
Date: Thu, 23 Jan 2025 15:37:36 -0600
Ship Mints <shipmints <at> gmail.com> writes:

> I'll use it eventually. Though I might be off homebrew and onto something
> actually repeatable (I'll gripe about Guix macOS being weak, err,
> non-existent, and too bad because guile is much nicer than nix). I'm also
> still on Monterey 12.7.6 on all my Macs (most stable ever) so testing on
> that might be helpful.
>
> Note: the homebrew recipe is not built for Monterey as the homebrew people
> consider that unsupported. That might trip up some testing volunteers.

Thanks, I added a note about macOS 12 or earlier to README-IGC in commit
7146d10b462.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 21 Feb 2025 12:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified today.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.