GNU bug report logs - #66017
Cannot install Ada mode

Previous Next

Package: emacs;

Reported by: Left Right <olegsivokon <at> gmail.com>

Date: Fri, 15 Sep 2023 20:13:01 UTC

Severity: normal

To reply to this bug, email your comments to 66017 AT debbugs.gnu.org.

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

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


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#66017; Package emacs. (Fri, 15 Sep 2023 20:13:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Left Right <olegsivokon <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 15 Sep 2023 20:13:02 GMT) Full text and rfc822 format available.

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

From: Left Right <olegsivokon <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Cannot install Ada mode
Date: Fri, 15 Sep 2023 22:12:04 +0200
Hello.

I'm trying to install Ada mode in Emacs 29.1 on Manjaro.

This is my experience so far:

❯ cd ~/.emacs.d/elpa/ada-mode-8.0.5
❯ ./build.sh
alr is /usr/local/bin/alr
building ada-mode executables via Alire
error: Crate [emacs_ada_mode~8.0.5] does not exist in the catalog.
./build.sh: line 16: cd: emacs_ada_mode_*: No such file or directory
error: Cannot continue with invalid session:
error:    Could not detect a session folder at current or parent locations

When I try searching for this crate:

❯ alr index --update-all
Already up to date.
❯ alr search emacs
No hits

Also, documentation mentions that Ada mode is supposed to be built-in,
but unless I install this package from ELPA, there's no Ada mode in my
Emacs installation.

I found this page: https://alire.ada.dev/crates/emacs_ada_mode.html
which seems to imply that the crate exists, but I don't understand why
alr isn't finding it. (I'm very new to Ada).

Any help would be very welcome.

Best.

Oleg




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66017; Package emacs. (Fri, 15 Sep 2023 20:38:02 GMT) Full text and rfc822 format available.

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

From: Gerd Möllmann <gerd.moellmann <at> gmail.com>
To: Left Right <olegsivokon <at> gmail.com>
Cc: Stephen Leake <stephen_leake <at> stephe-leake.org>, 66017 <at> debbugs.gnu.org
Subject: Re: bug#66017: Cannot install Ada mode
Date: Fri, 15 Sep 2023 22:37:35 +0200
Left Right <olegsivokon <at> gmail.com> writes:

> Hello.
>
> I'm trying to install Ada mode in Emacs 29.1 on Manjaro.
>
> This is my experience so far:
>
> ❯ cd ~/.emacs.d/elpa/ada-mode-8.0.5
> ❯ ./build.sh
> alr is /usr/local/bin/alr
> building ada-mode executables via Alire
> error: Crate [emacs_ada_mode~8.0.5] does not exist in the catalog.
> ./build.sh: line 16: cd: emacs_ada_mode_*: No such file or directory
> error: Cannot continue with invalid session:
> error:    Could not detect a session folder at current or parent locations
>
> When I try searching for this crate:
>
> ❯ alr index --update-all
> Already up to date.
> ❯ alr search emacs
> No hits
>
> Also, documentation mentions that Ada mode is supposed to be built-in,
> but unless I install this package from ELPA, there's no Ada mode in my
> Emacs installation.
>
> I found this page: https://alire.ada.dev/crates/emacs_ada_mode.html
> which seems to imply that the crate exists, but I don't understand why
> alr isn't finding it. (I'm very new to Ada).
>
> Any help would be very welcome.
>
> Best.
>
> Oleg

Stephen Leake (in is the maintainer of ada-mode, 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66017; Package emacs. (Fri, 15 Sep 2023 20:40:02 GMT) Full text and rfc822 format available.

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

From: Gerd Möllmann <gerd.moellmann <at> gmail.com>
To: Left Right <olegsivokon <at> gmail.com>
Cc: Stephen Leake <stephen_leake <at> stephe-leake.org>, 66017 <at> debbugs.gnu.org
Subject: Re: bug#66017: Cannot install Ada mode
Date: Fri, 15 Sep 2023 22:39:02 +0200
Gerd Möllmann <gerd.moellmann <at> gmail.com> writes:

> Stephen Leake (in is the maintainer of ada-mode,

That went somehow wrong :-(.  Stephen is the emaintainer of ada-mode.
Maybe he can help you.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66017; Package emacs. (Fri, 15 Sep 2023 20:53:01 GMT) Full text and rfc822 format available.

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

From: Left Right <olegsivokon <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: Cannot install Ada mode
Date: Fri, 15 Sep 2023 22:52:27 +0200
Hi.

I seem to have found the problem. I discovered I somehow had two
different versions of Alire installed: 1.2.0 and 1.2.1. The older one
was the one found when running build.sh. However, the Emacs Ada mode
crate must've been added after 1.2.1 Alire index was created. I
couldn't find a way to update Alire, and apparently, older Alire
cannot use the newer index... but deleting the old version allowed me
to make some progress.  Now it fails like this:

wisitoken-followed_by.adb:222:07: warning: "Generate_Data" is not
modified, could be declared constant [-gnatwk]
gnatcoll-projects.adb:38:09: warning: unit "Ada.Unchecked_Conversion"
is not referenced [-gnatwu]

   compilation of wisitoken-followed_by.adb failed

gprbuild: *** compilation phase failed
error: Command ["gprbuild", "-s", "-j0", "-p", "-P",
"/home/olegs/.emacs.d/elpa/ada-mode-8.0.5/emacs_ada_mode_8.0.5_ecfdcfb4/alire/cache/dependencies/wisitoken_4.1.0_f9cd282e/build/wisitoken_alire.gpr"]
exited with code 4
error: Compilation failed.

I'd still appreciate your help dealing with this.

Also, it would be nice if documentation mentioned the minimum required
version of Alire.

Trying to run the command that failed generates this:

❯ "gprbuild" "-s" "-j0" "-p" "-P"
"/home/olegs/.emacs.d/elpa/ada-mode-8.0.5/emacs_ada_mode_8.0.5_ecfdcfb4/alire/cache/dependencies/wisitoken_4.1.0_f9cd282e/build/wisitoken_alire.gpr"
wisitoken_alire.gpr:8:06: imported project file
"standard_common_alire" not found
wisitoken_alire.gpr:28:43: unknown package or project "Standard_Common_Alire"
wisitoken_alire.gpr:28:43: wrong expression kind for attribute
"default_switches"
wisitoken_alire.gpr:28:84: unknown package or project "Standard_Common_Alire"
wisitoken_alire.gpr:31:43: unknown package or project "Standard_Common_Alire"
wisitoken_alire.gpr:31:43: wrong expression kind for attribute
"default_switches"
wisitoken_alire.gpr:31:82: unknown package or project "Standard_Common_Alire"
wisitoken_alire.gpr:35:41: unknown package or project "Standard_Common_Alire"
wisitoken_config.gpr:3:06: imported project file
"stephes_ada_library.gpr" not found
wisitoken_config.gpr:3:06: imported by
"/home/olegs/.emacs.d/elpa/ada-mode-8.0.5/emacs_ada_mode_8.0.5_ecfdcfb4/alire/cache/dependencies/wisitoken_4.1.0_f9cd282e/config/wisitoken_config.gpr"
wisitoken_config.gpr:3:06: imported by
"/home/olegs/.emacs.d/elpa/ada-mode-8.0.5/emacs_ada_mode_8.0.5_ecfdcfb4/alire/cache/dependencies/wisitoken_4.1.0_f9cd282e/build/wisitoken_alire.gpr"
gprbuild: "/home/olegs/.emacs.d/elpa/ada-mode-8.0.5/emacs_ada_mode_8.0.5_ecfdcfb4/alire/cache/dependencies/wisitoken_4.1.0_f9cd282e/build/wisitoken_alire.gpr"
processing failed

On Fri, Sep 15, 2023 at 10:12 PM Left Right <olegsivokon <at> gmail.com> wrote:
>
> Hello.
>
> I'm trying to install Ada mode in Emacs 29.1 on Manjaro.
>
> This is my experience so far:
>
> ❯ cd ~/.emacs.d/elpa/ada-mode-8.0.5
> ❯ ./build.sh
> alr is /usr/local/bin/alr
> building ada-mode executables via Alire
> error: Crate [emacs_ada_mode~8.0.5] does not exist in the catalog.
> ./build.sh: line 16: cd: emacs_ada_mode_*: No such file or directory
> error: Cannot continue with invalid session:
> error:    Could not detect a session folder at current or parent locations
>
> When I try searching for this crate:
>
> ❯ alr index --update-all
> Already up to date.
> ❯ alr search emacs
> No hits
>
> Also, documentation mentions that Ada mode is supposed to be built-in,
> but unless I install this package from ELPA, there's no Ada mode in my
> Emacs installation.
>
> I found this page: https://alire.ada.dev/crates/emacs_ada_mode.html
> which seems to imply that the crate exists, but I don't understand why
> alr isn't finding it. (I'm very new to Ada).
>
> Any help would be very welcome.
>
> Best.
>
> Oleg




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66017; Package emacs. (Mon, 18 Sep 2023 16:54:02 GMT) Full text and rfc822 format available.

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

From: Stephen Leake <stephen_leake <at> stephe-leake.org>
To: 66017 <at> debbugs.gnu.org
Subject: Re: bug#66017: Cannot install Ada mode
Date: Mon, 18 Sep 2023 09:53:30 -0700
Gerd Möllmann <gerd.moellmann <at> gmail.com> writes:

> wisitoken-followed_by.adb:222:07: warning: "Generate_Data" is not
> modified, could be declared constant [-gnatwk]

This indicates you are using a compiler external to Alire, with a newer version
than the internal one; I only test with Alire internal compilers, for
consistency.

Please configure the internal Alire compiler.

I will add the tested Alire version to the documentation.

Earlier, you said:

> Also, documentation mentions that Ada mode is supposed to be built-in,

What documentation says that?

-- 
-- Stephe




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66017; Package emacs. (Tue, 19 Sep 2023 19:57:02 GMT) Full text and rfc822 format available.

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

From: Left Right <olegsivokon <at> gmail.com>
To: 66017 <at> debbugs.gnu.org
Cc: Stephen Leake <stephen_leake <at> stephe-leake.org>
Subject: Re: bug#66017: Cannot install Ada mode
Date: Tue, 19 Sep 2023 21:56:28 +0200
Hello Stephen, you wrote:

> This indicates you are using a compiler external to Alire, with a newer version
> than the internal one; I only test with Alire internal compilers, for
> consistency.

> Please configure the internal Alire compiler.

> I will add the tested Alire version to the documentation.

I don't know what to do with Alire, but I will try to figure out. But
please consider that anyone trying to install Ada on Linux will
firstly try to go through the process recommended by the distro
maintainers.  In my case, it's a combination of using pacman to
install gcc-ada and AUR (auxiliary packages not directly maintained by
Arch distribution) to install gprbuild, adaxml, alire etc. All I've
done so far to install Ada was to install packages from these sources.
(Unfortunately, both documentation and execution here are lacking, and
the process is quite complicated and error-prone).

It seems like you want me to install what gcc-ada would install, but
through Alire. Am I right? In other words, something that isn't
provided and managed by the Linux distribution I'm using. This seems
like a process that requires a lot more expertise from an average user
(building any GCC compiler is not an easy task). Why is this the
prefered choice of environment?

As for the documentation: it seems we are reading two different
documentations. Is the one you are referring to available online?

I was reading this:
https://www.gnu.org/software/emacs/manual/html_mono/ada-mode.html#Installation

specifically:
"Ada mode is part of the standard Emacs distribution; if you use that,
no files need to be installed."

This documentation has no mention of how to build Ada mode, nor
anything about how Ada compiler and toolchain are meant to be set up
etc.

Thank you.

Oleg

On Fri, Sep 15, 2023 at 10:37 PM Gerd Möllmann <gerd.moellmann <at> gmail.com> wrote:
>
> Left Right <olegsivokon <at> gmail.com> writes:
>
> > Hello.
> >
> > I'm trying to install Ada mode in Emacs 29.1 on Manjaro.
> >
> > This is my experience so far:
> >
> > ❯ cd ~/.emacs.d/elpa/ada-mode-8.0.5
> > ❯ ./build.sh
> > alr is /usr/local/bin/alr
> > building ada-mode executables via Alire
> > error: Crate [emacs_ada_mode~8.0.5] does not exist in the catalog.
> > ./build.sh: line 16: cd: emacs_ada_mode_*: No such file or directory
> > error: Cannot continue with invalid session:
> > error:    Could not detect a session folder at current or parent locations
> >
> > When I try searching for this crate:
> >
> > ❯ alr index --update-all
> > Already up to date.
> > ❯ alr search emacs
> > No hits
> >
> > Also, documentation mentions that Ada mode is supposed to be built-in,
> > but unless I install this package from ELPA, there's no Ada mode in my
> > Emacs installation.
> >
> > I found this page: https://alire.ada.dev/crates/emacs_ada_mode.html
> > which seems to imply that the crate exists, but I don't understand why
> > alr isn't finding it. (I'm very new to Ada).
> >
> > Any help would be very welcome.
> >
> > Best.
> >
> > Oleg
>
> Stephen Leake (in is the maintainer of ada-mode,




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66017; Package emacs. (Tue, 19 Sep 2023 23:16:02 GMT) Full text and rfc822 format available.

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

From: Richard Stallman <rms <at> gnu.org>
To: Stephen Leake <stephen_leake <at> stephe-leake.org>
Cc: 66017 <at> debbugs.gnu.org
Subject: Re: bug#66017: Cannot install Ada mode
Date: Tue, 19 Sep 2023 19:14:56 -0400
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

What is Alire?  Is it a competitor to GNU Ada?  Is it free software?

-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66017; Package emacs. (Fri, 22 Sep 2023 14:19:02 GMT) Full text and rfc822 format available.

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

From: Stephen Leake <stephen_leake <at> stephe-leake.org>
To: Richard Stallman <rms <at> gnu.org>
Cc: 66017 <at> debbugs.gnu.org
Subject: Re: bug#66017: Cannot install Ada mode
Date: Fri, 22 Sep 2023 07:18:06 -0700
Richard Stallman <rms <at> gnu.org> writes:

> [[[ To any NSA and FBI agents reading my email: please consider    ]]]
> [[[ whether defending the US Constitution against all enemies,     ]]]
> [[[ foreign or domestic, requires you to follow Snowden's example. ]]]
>
> What is Alire?  Is it a competitor to GNU Ada?  Is it free software?

https://alire.ada.dev/

It is a package manager for Ada; similar to package managers for Java
and other languages.

It packages GNU Ada.

It is free software.

-- 
-- Stephe




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66017; Package emacs. (Fri, 22 Sep 2023 14:30:02 GMT) Full text and rfc822 format available.

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

From: Stephen Leake <stephen_leake <at> stephe-leake.org>
To: Left Right <olegsivokon <at> gmail.com>
Cc: 66017 <at> debbugs.gnu.org
Subject: Re: bug#66017: Cannot install Ada mode
Date: Fri, 22 Sep 2023 07:29:20 -0700
Left Right <olegsivokon <at> gmail.com> writes:

> Hello Stephen, you wrote:
>
>> This indicates you are using a compiler external to Alire, with a newer version
>> than the internal one; I only test with Alire internal compilers, for
>> consistency.
>
>> Please configure the internal Alire compiler.
>
>> I will add the tested Alire version to the documentation.
>
> I don't know what to do with Alire, but I will try to figure out. 

Run "alr toolchain", select the internal Ada compiler.

> But please consider that anyone trying to install Ada on Linux will
> firstly try to go through the process recommended by the distro
> maintainers. 

Alire is supposed to replace that process, but it's not quite there yet.

> In my case, it's a combination of using pacman to install gcc-ada and
> AUR (auxiliary packages not directly maintained by Arch distribution)
> to install gprbuild, adaxml, alire etc. All I've done so far to
> install Ada was to install packages from these sources.
> (Unfortunately, both documentation and execution here are lacking, and
> the process is quite complicated and error-prone).

Apparently this ended up with Alire being configured for the external
distro Ada compiler, rather than the internal one. That should not
happen by default; perhaps you ran "alr toolchain" at some point?

> It seems like you want me to install what gcc-ada would install, but
> through Alire. 

No, just use the default compiler provided by the default Alire installation.

> Am I right? In other words, something that isn't provided and managed
> by the Linux distribution I'm using. This seems like a process that
> requires a lot more expertise from an average user (building any GCC
> compiler is not an easy task). Why is this the prefered choice of
> environment?

It is supposed to require less expertise. Unfortunately, when it fails, it
is confusing and hard to diagnose.

Part of the reason to start using Alire is to avoid version conflicts
like this! Apparently that doesn't really work. Sigh.

> As for the documentation: it seems we are reading two different
> documentations. Is the one you are referring to available online?
>
> I was reading this:
>
https://www.gnu.org/software/emacs/manual/html_mono/ada-mode.html#Installation

Sigh. That document is dated 2019 (see the Top node). The upstream
source has been updated since then.

> This documentation has no mention of how to build Ada mode, nor
> anything about how Ada compiler and toolchain are meant to be set up
> etc.

The current version refers to ELPA.

-- 
-- Stephe




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66017; Package emacs. (Sat, 23 Sep 2023 11:27:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Stephen Leake <stephen_leake <at> stephe-leake.org>,
 Left Right <olegsivokon <at> gmail.com>
Cc: 66017 <at> debbugs.gnu.org
Subject: Re: bug#66017: Cannot install Ada mode
Date: Sat, 23 Sep 2023 04:26:36 -0700
Stephen Leake <stephen_leake <at> stephe-leake.org> writes:

>> I was reading this:
>>
> https://www.gnu.org/software/emacs/manual/html_mono/ada-mode.html#Installation
>
> Sigh. That document is dated 2019 (see the Top node). The upstream
> source has been updated since then.

Should we add a 308 Permanent Redirect from that page to here, perhaps?

    https://elpa.gnu.org/packages/doc/ada-mode.html




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66017; Package emacs. (Sat, 23 Sep 2023 16:04:01 GMT) Full text and rfc822 format available.

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

From: Left Right <olegsivokon <at> gmail.com>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: Stephen Leake <stephen_leake <at> stephe-leake.org>, 66017 <at> debbugs.gnu.org
Subject: Re: bug#66017: Cannot install Ada mode
Date: Sat, 23 Sep 2023 18:03:12 +0200
> Should we add a 308 Permanent Redirect from that page to here, perhaps?

If one could dream, a label somewhere which displays the version of
Emacs this documentation is for would've been great.

On Sat, Sep 23, 2023 at 1:26 PM Stefan Kangas <stefankangas <at> gmail.com> wrote:
>
> Stephen Leake <stephen_leake <at> stephe-leake.org> writes:
>
> >> I was reading this:
> >>
> > https://www.gnu.org/software/emacs/manual/html_mono/ada-mode.html#Installation
> >
> > Sigh. That document is dated 2019 (see the Top node). The upstream
> > source has been updated since then.
>
> Should we add a 308 Permanent Redirect from that page to here, perhaps?
>
>     https://elpa.gnu.org/packages/doc/ada-mode.html




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66017; Package emacs. (Sat, 23 Sep 2023 16:29:02 GMT) Full text and rfc822 format available.

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

From: Left Right <olegsivokon <at> gmail.com>
To: Stephen Leake <stephen_leake <at> stephe-leake.org>
Cc: 66017 <at> debbugs.gnu.org
Subject: Re: bug#66017: Cannot install Ada mode
Date: Sat, 23 Sep 2023 18:28:19 +0200
> Run "alr toolchain", select the internal Ada compiler.

Only the external compiler had ever been installed. If I run (I never
ran this before):

❯ alr toolchain
CRATE         VERSION STATUS  NOTES
gnat_external 13.2.1  Default Detected at /usr/bin/gnat

This is what I get.

Here's what I did afterwards:

1. Installed "gnat_native".
2. Ran `alr toolchain --select` and interactively selected a version
of "gnat_native" and "gprbuild" so that it looks like this:

❯ alr toolchain
CRATE         VERSION STATUS    NOTES
gprbuild      22.0.1  Default
gnat_native   13.1.0  Default
gnat_external 13.2.1  Available Detected at /usr/bin/gnat

Afterwards, I re-ran build.sh, and I get the same (?) error:

wisitoken-followed_by.adb:222:07: warning: "Generate_Data" is not
modified, could be declared constant [-gnatwk]
gnatcoll-projects.adb:38:09: warning: unit "Ada.Unchecked_Conversion"
is not referenced [-gnatwu]

   compilation of wisitoken-followed_by.adb failed

gprbuild: *** compilation phase failed
error: Command ["gprbuild", "-s", "-j0", "-p", "-P",
"/home/olegs/.emacs.d/elpa/ada-mode-8.0.5/emacs_ada_mode_8.0.5_ecfdcfb4/alire/cache/dependencies/wisitoken_4.1.0_f9cd282e/build/wisitoken_alire.gpr"]
exited with code 4
error: Compilation failed.

And if I re-run the failed command:

❯ gprbuild -s "-j0" "-p" "-P"
"/home/olegs/.emacs.d/elpa/ada-mode-8.0.5/emacs_ada_mode_8.0.5_ecfdcfb4/alire/cache/dependencies/wisitoken_4.1.0_f9cd282e/build/wisitoken_alire.gpr"
wisitoken_alire.gpr:8:06: imported project file
"standard_common_alire" not found
wisitoken_alire.gpr:28:43: unknown package or project "Standard_Common_Alire"
wisitoken_alire.gpr:28:43: wrong expression kind for attribute
"default_switches"
wisitoken_alire.gpr:28:84: unknown package or project "Standard_Common_Alire"
wisitoken_alire.gpr:31:43: unknown package or project "Standard_Common_Alire"
wisitoken_alire.gpr:31:43: wrong expression kind for attribute
"default_switches"
wisitoken_alire.gpr:31:82: unknown package or project "Standard_Common_Alire"
wisitoken_alire.gpr:35:41: unknown package or project "Standard_Common_Alire"
wisitoken_config.gpr:3:06: imported project file
"stephes_ada_library.gpr" not found
wisitoken_config.gpr:3:06: imported by
"/home/olegs/.emacs.d/elpa/ada-mode-8.0.5/emacs_ada_mode_8.0.5_ecfdcfb4/alire/cache/dependencies/wisitoken_4.1.0_f9cd282e/config/wisitoken_config.gpr"
wisitoken_config.gpr:3:06: imported by
"/home/olegs/.emacs.d/elpa/ada-mode-8.0.5/emacs_ada_mode_8.0.5_ecfdcfb4/alire/cache/dependencies/wisitoken_4.1.0_f9cd282e/build/wisitoken_alire.gpr"
gprbuild: "/home/olegs/.emacs.d/elpa/ada-mode-8.0.5/emacs_ada_mode_8.0.5_ecfdcfb4/alire/cache/dependencies/wisitoken_4.1.0_f9cd282e/build/wisitoken_alire.gpr"
processing failed

But when I run:

❯ gprbuild --version
GPRBUILD Pro 24.0w (20230430) (x86_64-pc-linux-gnu)
Copyright (C) 2004-2023, AdaCore
This is free software; see the source for copying conditions.
See your AdaCore support agreement for details of warranty and support.
If you do not have a current support agreement, then there is absolutely
no warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.

So, it looks like maybe the version I selected through Alire is ignored?

Should I perhaps uninstall distribution-installed Ada-related packages
and re-try with only Alire-installed ones?

Thanks!

Oleg

On Fri, Sep 22, 2023 at 4:29 PM Stephen Leake
<stephen_leake <at> stephe-leake.org> wrote:
>
> Left Right <olegsivokon <at> gmail.com> writes:
>
> > Hello Stephen, you wrote:
> >
> >> This indicates you are using a compiler external to Alire, with a newer version
> >> than the internal one; I only test with Alire internal compilers, for
> >> consistency.
> >
> >> Please configure the internal Alire compiler.
> >
> >> I will add the tested Alire version to the documentation.
> >
> > I don't know what to do with Alire, but I will try to figure out.
>
> Run "alr toolchain", select the internal Ada compiler.
>
> > But please consider that anyone trying to install Ada on Linux will
> > firstly try to go through the process recommended by the distro
> > maintainers.
>
> Alire is supposed to replace that process, but it's not quite there yet.
>
> > In my case, it's a combination of using pacman to install gcc-ada and
> > AUR (auxiliary packages not directly maintained by Arch distribution)
> > to install gprbuild, adaxml, alire etc. All I've done so far to
> > install Ada was to install packages from these sources.
> > (Unfortunately, both documentation and execution here are lacking, and
> > the process is quite complicated and error-prone).
>
> Apparently this ended up with Alire being configured for the external
> distro Ada compiler, rather than the internal one. That should not
> happen by default; perhaps you ran "alr toolchain" at some point?
>
> > It seems like you want me to install what gcc-ada would install, but
> > through Alire.
>
> No, just use the default compiler provided by the default Alire installation.
>
> > Am I right? In other words, something that isn't provided and managed
> > by the Linux distribution I'm using. This seems like a process that
> > requires a lot more expertise from an average user (building any GCC
> > compiler is not an easy task). Why is this the prefered choice of
> > environment?
>
> It is supposed to require less expertise. Unfortunately, when it fails, it
> is confusing and hard to diagnose.
>
> Part of the reason to start using Alire is to avoid version conflicts
> like this! Apparently that doesn't really work. Sigh.
>
> > As for the documentation: it seems we are reading two different
> > documentations. Is the one you are referring to available online?
> >
> > I was reading this:
> >
> https://www.gnu.org/software/emacs/manual/html_mono/ada-mode.html#Installation
>
> Sigh. That document is dated 2019 (see the Top node). The upstream
> source has been updated since then.
>
> > This documentation has no mention of how to build Ada mode, nor
> > anything about how Ada compiler and toolchain are meant to be set up
> > etc.
>
> The current version refers to ELPA.
>
> --
> -- Stephe




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66017; Package emacs. (Sat, 23 Sep 2023 18:57:02 GMT) Full text and rfc822 format available.

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

From: Left Right <olegsivokon <at> gmail.com>
To: Stephen Leake <stephen_leake <at> stephe-leake.org>
Cc: 66017 <at> debbugs.gnu.org
Subject: Re: bug#66017: Cannot install Ada mode
Date: Sat, 23 Sep 2023 20:55:32 +0200
I tried to uninstall every other Ada-related package I installed from
my distro packages, including Alire. Downloaded Alire binary afresh
and used it to install the toolchain.

So, I don't think that when I try to run gprbuild command I get the
same output Alire gets when it runs it. It must be running it in some
other environment. The thing is: I don't have *any* globally available
gprbuild now. But the command Alire runs somehow exits with code 4,
whereas if it couldn't find the command, it would have to exit with
code 1. It fails for some other reason, but I cannot find a way to
make the build more verbose so that it would print the stderr / stdout
of the failing command.

On Sat, Sep 23, 2023 at 6:28 PM Left Right <olegsivokon <at> gmail.com> wrote:
>
> > Run "alr toolchain", select the internal Ada compiler.
>
> Only the external compiler had ever been installed. If I run (I never
> ran this before):
>
> ❯ alr toolchain
> CRATE         VERSION STATUS  NOTES
> gnat_external 13.2.1  Default Detected at /usr/bin/gnat
>
> This is what I get.
>
> Here's what I did afterwards:
>
> 1. Installed "gnat_native".
> 2. Ran `alr toolchain --select` and interactively selected a version
> of "gnat_native" and "gprbuild" so that it looks like this:
>
> ❯ alr toolchain
> CRATE         VERSION STATUS    NOTES
> gprbuild      22.0.1  Default
> gnat_native   13.1.0  Default
> gnat_external 13.2.1  Available Detected at /usr/bin/gnat
>
> Afterwards, I re-ran build.sh, and I get the same (?) error:
>
> wisitoken-followed_by.adb:222:07: warning: "Generate_Data" is not
> modified, could be declared constant [-gnatwk]
> gnatcoll-projects.adb:38:09: warning: unit "Ada.Unchecked_Conversion"
> is not referenced [-gnatwu]
>
>    compilation of wisitoken-followed_by.adb failed
>
> gprbuild: *** compilation phase failed
> error: Command ["gprbuild", "-s", "-j0", "-p", "-P",
> "/home/olegs/.emacs.d/elpa/ada-mode-8.0.5/emacs_ada_mode_8.0.5_ecfdcfb4/alire/cache/dependencies/wisitoken_4.1.0_f9cd282e/build/wisitoken_alire.gpr"]
> exited with code 4
> error: Compilation failed.
>
> And if I re-run the failed command:
>
> ❯ gprbuild -s "-j0" "-p" "-P"
> "/home/olegs/.emacs.d/elpa/ada-mode-8.0.5/emacs_ada_mode_8.0.5_ecfdcfb4/alire/cache/dependencies/wisitoken_4.1.0_f9cd282e/build/wisitoken_alire.gpr"
> wisitoken_alire.gpr:8:06: imported project file
> "standard_common_alire" not found
> wisitoken_alire.gpr:28:43: unknown package or project "Standard_Common_Alire"
> wisitoken_alire.gpr:28:43: wrong expression kind for attribute
> "default_switches"
> wisitoken_alire.gpr:28:84: unknown package or project "Standard_Common_Alire"
> wisitoken_alire.gpr:31:43: unknown package or project "Standard_Common_Alire"
> wisitoken_alire.gpr:31:43: wrong expression kind for attribute
> "default_switches"
> wisitoken_alire.gpr:31:82: unknown package or project "Standard_Common_Alire"
> wisitoken_alire.gpr:35:41: unknown package or project "Standard_Common_Alire"
> wisitoken_config.gpr:3:06: imported project file
> "stephes_ada_library.gpr" not found
> wisitoken_config.gpr:3:06: imported by
> "/home/olegs/.emacs.d/elpa/ada-mode-8.0.5/emacs_ada_mode_8.0.5_ecfdcfb4/alire/cache/dependencies/wisitoken_4.1.0_f9cd282e/config/wisitoken_config.gpr"
> wisitoken_config.gpr:3:06: imported by
> "/home/olegs/.emacs.d/elpa/ada-mode-8.0.5/emacs_ada_mode_8.0.5_ecfdcfb4/alire/cache/dependencies/wisitoken_4.1.0_f9cd282e/build/wisitoken_alire.gpr"
> gprbuild: "/home/olegs/.emacs.d/elpa/ada-mode-8.0.5/emacs_ada_mode_8.0.5_ecfdcfb4/alire/cache/dependencies/wisitoken_4.1.0_f9cd282e/build/wisitoken_alire.gpr"
> processing failed
>
> But when I run:
>
> ❯ gprbuild --version
> GPRBUILD Pro 24.0w (20230430) (x86_64-pc-linux-gnu)
> Copyright (C) 2004-2023, AdaCore
> This is free software; see the source for copying conditions.
> See your AdaCore support agreement for details of warranty and support.
> If you do not have a current support agreement, then there is absolutely
> no warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
> PURPOSE.
>
> So, it looks like maybe the version I selected through Alire is ignored?
>
> Should I perhaps uninstall distribution-installed Ada-related packages
> and re-try with only Alire-installed ones?
>
> Thanks!
>
> Oleg
>
> On Fri, Sep 22, 2023 at 4:29 PM Stephen Leake
> <stephen_leake <at> stephe-leake.org> wrote:
> >
> > Left Right <olegsivokon <at> gmail.com> writes:
> >
> > > Hello Stephen, you wrote:
> > >
> > >> This indicates you are using a compiler external to Alire, with a newer version
> > >> than the internal one; I only test with Alire internal compilers, for
> > >> consistency.
> > >
> > >> Please configure the internal Alire compiler.
> > >
> > >> I will add the tested Alire version to the documentation.
> > >
> > > I don't know what to do with Alire, but I will try to figure out.
> >
> > Run "alr toolchain", select the internal Ada compiler.
> >
> > > But please consider that anyone trying to install Ada on Linux will
> > > firstly try to go through the process recommended by the distro
> > > maintainers.
> >
> > Alire is supposed to replace that process, but it's not quite there yet.
> >
> > > In my case, it's a combination of using pacman to install gcc-ada and
> > > AUR (auxiliary packages not directly maintained by Arch distribution)
> > > to install gprbuild, adaxml, alire etc. All I've done so far to
> > > install Ada was to install packages from these sources.
> > > (Unfortunately, both documentation and execution here are lacking, and
> > > the process is quite complicated and error-prone).
> >
> > Apparently this ended up with Alire being configured for the external
> > distro Ada compiler, rather than the internal one. That should not
> > happen by default; perhaps you ran "alr toolchain" at some point?
> >
> > > It seems like you want me to install what gcc-ada would install, but
> > > through Alire.
> >
> > No, just use the default compiler provided by the default Alire installation.
> >
> > > Am I right? In other words, something that isn't provided and managed
> > > by the Linux distribution I'm using. This seems like a process that
> > > requires a lot more expertise from an average user (building any GCC
> > > compiler is not an easy task). Why is this the prefered choice of
> > > environment?
> >
> > It is supposed to require less expertise. Unfortunately, when it fails, it
> > is confusing and hard to diagnose.
> >
> > Part of the reason to start using Alire is to avoid version conflicts
> > like this! Apparently that doesn't really work. Sigh.
> >
> > > As for the documentation: it seems we are reading two different
> > > documentations. Is the one you are referring to available online?
> > >
> > > I was reading this:
> > >
> > https://www.gnu.org/software/emacs/manual/html_mono/ada-mode.html#Installation
> >
> > Sigh. That document is dated 2019 (see the Top node). The upstream
> > source has been updated since then.
> >
> > > This documentation has no mention of how to build Ada mode, nor
> > > anything about how Ada compiler and toolchain are meant to be set up
> > > etc.
> >
> > The current version refers to ELPA.
> >
> > --
> > -- Stephe




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66017; Package emacs. (Sat, 23 Sep 2023 19:06:02 GMT) Full text and rfc822 format available.

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

From: Left Right <olegsivokon <at> gmail.com>
To: Stephen Leake <stephen_leake <at> stephe-leake.org>
Cc: 66017 <at> debbugs.gnu.org
Subject: Re: bug#66017: Cannot install Ada mode
Date: Sat, 23 Sep 2023 21:04:39 +0200
Sorry for making too much noise. Here's what I tried:

❯ alr printenv > alrenv
❯ . ./alrenv
❯ gprbuild -s "-j0" "-p" "-P"
"/home/olegs/.emacs.d/elpa/ada-mode-8.0.5/emacs_ada_mode_8.0.5_ecfdcfb4/alire/cache/depe
ndencies/wisitoken_4.1.0_f9cd282e/build/wisitoken_alire.gpr"
gnatcoll.gpr:254:07: warning: value "windows" is not used as label
Compile
   [Ada]          wisitoken-followed_by.adb
   [Ada]          wisitoken_grammar_runtime.adb
wisitoken-followed_by.adb:222:07: warning: "Generate_Data" is not
modified, could be declared constant [-gnatwk]
wisitoken_grammar_runtime.adb:197:13: warning: unreachable code
[enabled by default]

   compilation of wisitoken_grammar_runtime.adb failed
   compilation of wisitoken-followed_by.adb failed

gprbuild: *** compilation phase failed

This seems to be the actual error.

On Sat, Sep 23, 2023 at 8:55 PM Left Right <olegsivokon <at> gmail.com> wrote:
>
> I tried to uninstall every other Ada-related package I installed from
> my distro packages, including Alire. Downloaded Alire binary afresh
> and used it to install the toolchain.
>
> So, I don't think that when I try to run gprbuild command I get the
> same output Alire gets when it runs it. It must be running it in some
> other environment. The thing is: I don't have *any* globally available
> gprbuild now. But the command Alire runs somehow exits with code 4,
> whereas if it couldn't find the command, it would have to exit with
> code 1. It fails for some other reason, but I cannot find a way to
> make the build more verbose so that it would print the stderr / stdout
> of the failing command.
>
> On Sat, Sep 23, 2023 at 6:28 PM Left Right <olegsivokon <at> gmail.com> wrote:
> >
> > > Run "alr toolchain", select the internal Ada compiler.
> >
> > Only the external compiler had ever been installed. If I run (I never
> > ran this before):
> >
> > ❯ alr toolchain
> > CRATE         VERSION STATUS  NOTES
> > gnat_external 13.2.1  Default Detected at /usr/bin/gnat
> >
> > This is what I get.
> >
> > Here's what I did afterwards:
> >
> > 1. Installed "gnat_native".
> > 2. Ran `alr toolchain --select` and interactively selected a version
> > of "gnat_native" and "gprbuild" so that it looks like this:
> >
> > ❯ alr toolchain
> > CRATE         VERSION STATUS    NOTES
> > gprbuild      22.0.1  Default
> > gnat_native   13.1.0  Default
> > gnat_external 13.2.1  Available Detected at /usr/bin/gnat
> >
> > Afterwards, I re-ran build.sh, and I get the same (?) error:
> >
> > wisitoken-followed_by.adb:222:07: warning: "Generate_Data" is not
> > modified, could be declared constant [-gnatwk]
> > gnatcoll-projects.adb:38:09: warning: unit "Ada.Unchecked_Conversion"
> > is not referenced [-gnatwu]
> >
> >    compilation of wisitoken-followed_by.adb failed
> >
> > gprbuild: *** compilation phase failed
> > error: Command ["gprbuild", "-s", "-j0", "-p", "-P",
> > "/home/olegs/.emacs.d/elpa/ada-mode-8.0.5/emacs_ada_mode_8.0.5_ecfdcfb4/alire/cache/dependencies/wisitoken_4.1.0_f9cd282e/build/wisitoken_alire.gpr"]
> > exited with code 4
> > error: Compilation failed.
> >
> > And if I re-run the failed command:
> >
> > ❯ gprbuild -s "-j0" "-p" "-P"
> > "/home/olegs/.emacs.d/elpa/ada-mode-8.0.5/emacs_ada_mode_8.0.5_ecfdcfb4/alire/cache/dependencies/wisitoken_4.1.0_f9cd282e/build/wisitoken_alire.gpr"
> > wisitoken_alire.gpr:8:06: imported project file
> > "standard_common_alire" not found
> > wisitoken_alire.gpr:28:43: unknown package or project "Standard_Common_Alire"
> > wisitoken_alire.gpr:28:43: wrong expression kind for attribute
> > "default_switches"
> > wisitoken_alire.gpr:28:84: unknown package or project "Standard_Common_Alire"
> > wisitoken_alire.gpr:31:43: unknown package or project "Standard_Common_Alire"
> > wisitoken_alire.gpr:31:43: wrong expression kind for attribute
> > "default_switches"
> > wisitoken_alire.gpr:31:82: unknown package or project "Standard_Common_Alire"
> > wisitoken_alire.gpr:35:41: unknown package or project "Standard_Common_Alire"
> > wisitoken_config.gpr:3:06: imported project file
> > "stephes_ada_library.gpr" not found
> > wisitoken_config.gpr:3:06: imported by
> > "/home/olegs/.emacs.d/elpa/ada-mode-8.0.5/emacs_ada_mode_8.0.5_ecfdcfb4/alire/cache/dependencies/wisitoken_4.1.0_f9cd282e/config/wisitoken_config.gpr"
> > wisitoken_config.gpr:3:06: imported by
> > "/home/olegs/.emacs.d/elpa/ada-mode-8.0.5/emacs_ada_mode_8.0.5_ecfdcfb4/alire/cache/dependencies/wisitoken_4.1.0_f9cd282e/build/wisitoken_alire.gpr"
> > gprbuild: "/home/olegs/.emacs.d/elpa/ada-mode-8.0.5/emacs_ada_mode_8.0.5_ecfdcfb4/alire/cache/dependencies/wisitoken_4.1.0_f9cd282e/build/wisitoken_alire.gpr"
> > processing failed
> >
> > But when I run:
> >
> > ❯ gprbuild --version
> > GPRBUILD Pro 24.0w (20230430) (x86_64-pc-linux-gnu)
> > Copyright (C) 2004-2023, AdaCore
> > This is free software; see the source for copying conditions.
> > See your AdaCore support agreement for details of warranty and support.
> > If you do not have a current support agreement, then there is absolutely
> > no warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
> > PURPOSE.
> >
> > So, it looks like maybe the version I selected through Alire is ignored?
> >
> > Should I perhaps uninstall distribution-installed Ada-related packages
> > and re-try with only Alire-installed ones?
> >
> > Thanks!
> >
> > Oleg
> >
> > On Fri, Sep 22, 2023 at 4:29 PM Stephen Leake
> > <stephen_leake <at> stephe-leake.org> wrote:
> > >
> > > Left Right <olegsivokon <at> gmail.com> writes:
> > >
> > > > Hello Stephen, you wrote:
> > > >
> > > >> This indicates you are using a compiler external to Alire, with a newer version
> > > >> than the internal one; I only test with Alire internal compilers, for
> > > >> consistency.
> > > >
> > > >> Please configure the internal Alire compiler.
> > > >
> > > >> I will add the tested Alire version to the documentation.
> > > >
> > > > I don't know what to do with Alire, but I will try to figure out.
> > >
> > > Run "alr toolchain", select the internal Ada compiler.
> > >
> > > > But please consider that anyone trying to install Ada on Linux will
> > > > firstly try to go through the process recommended by the distro
> > > > maintainers.
> > >
> > > Alire is supposed to replace that process, but it's not quite there yet.
> > >
> > > > In my case, it's a combination of using pacman to install gcc-ada and
> > > > AUR (auxiliary packages not directly maintained by Arch distribution)
> > > > to install gprbuild, adaxml, alire etc. All I've done so far to
> > > > install Ada was to install packages from these sources.
> > > > (Unfortunately, both documentation and execution here are lacking, and
> > > > the process is quite complicated and error-prone).
> > >
> > > Apparently this ended up with Alire being configured for the external
> > > distro Ada compiler, rather than the internal one. That should not
> > > happen by default; perhaps you ran "alr toolchain" at some point?
> > >
> > > > It seems like you want me to install what gcc-ada would install, but
> > > > through Alire.
> > >
> > > No, just use the default compiler provided by the default Alire installation.
> > >
> > > > Am I right? In other words, something that isn't provided and managed
> > > > by the Linux distribution I'm using. This seems like a process that
> > > > requires a lot more expertise from an average user (building any GCC
> > > > compiler is not an easy task). Why is this the prefered choice of
> > > > environment?
> > >
> > > It is supposed to require less expertise. Unfortunately, when it fails, it
> > > is confusing and hard to diagnose.
> > >
> > > Part of the reason to start using Alire is to avoid version conflicts
> > > like this! Apparently that doesn't really work. Sigh.
> > >
> > > > As for the documentation: it seems we are reading two different
> > > > documentations. Is the one you are referring to available online?
> > > >
> > > > I was reading this:
> > > >
> > > https://www.gnu.org/software/emacs/manual/html_mono/ada-mode.html#Installation
> > >
> > > Sigh. That document is dated 2019 (see the Top node). The upstream
> > > source has been updated since then.
> > >
> > > > This documentation has no mention of how to build Ada mode, nor
> > > > anything about how Ada compiler and toolchain are meant to be set up
> > > > etc.
> > >
> > > The current version refers to ELPA.
> > >
> > > --
> > > -- Stephe




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66017; Package emacs. (Sun, 24 Sep 2023 17:24:01 GMT) Full text and rfc822 format available.

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

From: Left Right <olegsivokon <at> gmail.com>
To: Stephen Leake <stephen_leake <at> stephe-leake.org>
Cc: 66017 <at> debbugs.gnu.org
Subject: Re: bug#66017: Cannot install Ada mode
Date: Sun, 24 Sep 2023 19:22:31 +0200
Oh, and, finally, I realized that warnings here must've been
interpreted as errors. Whoa.

So, what I tried to do is to blindly follow what the warnings said.

In wisitoken-followed_by.adb

I changed

Generate_Data : aliased WisiToken.BNF.Generate_Utils.Generate_Data :=

to

Generate_Data : constant WisiToken.BNF.Generate_Utils.Generate_Data :=

and in wisitoken_grammar_runtime.adb:

            WisiToken.Syntax_Trees.LR_Utils.Raise_Programmer_Error
              ("Get_RHS: " & Exception_Name (E) & ": " &
Exception_Message (E), Tree, Token);
              -- WORKAROUND; GNAT pro_22.0w-20201222 ignores 'pragma
no_return' on Raise_Programmer_Error
            raise;

to

            WisiToken.Syntax_Trees.LR_Utils.Raise_Programmer_Error
              ("Get_RHS: " & Exception_Name (E) & ": " &
Exception_Message (E), Tree, Token);
              -- WORKAROUND; GNAT pro_22.0w-20201222 ignores 'pragma
no_return' on Raise_Programmer_Error
            pragma Warnings (off, "unreachable code");
            raise;
            pragma Warnings (on, "unreachable code");

I don't know if there are any negative consequences to what I've done,
but at least this allowed me to run both build.sh and install.sh.

On Sat, Sep 23, 2023 at 9:04 PM Left Right <olegsivokon <at> gmail.com> wrote:
>
> Sorry for making too much noise. Here's what I tried:
>
> ❯ alr printenv > alrenv
> ❯ . ./alrenv
> ❯ gprbuild -s "-j0" "-p" "-P"
> "/home/olegs/.emacs.d/elpa/ada-mode-8.0.5/emacs_ada_mode_8.0.5_ecfdcfb4/alire/cache/depe
> ndencies/wisitoken_4.1.0_f9cd282e/build/wisitoken_alire.gpr"
> gnatcoll.gpr:254:07: warning: value "windows" is not used as label
> Compile
>    [Ada]          wisitoken-followed_by.adb
>    [Ada]          wisitoken_grammar_runtime.adb
> wisitoken-followed_by.adb:222:07: warning: "Generate_Data" is not
> modified, could be declared constant [-gnatwk]
> wisitoken_grammar_runtime.adb:197:13: warning: unreachable code
> [enabled by default]
>
>    compilation of wisitoken_grammar_runtime.adb failed
>    compilation of wisitoken-followed_by.adb failed
>
> gprbuild: *** compilation phase failed
>
> This seems to be the actual error.
>
> On Sat, Sep 23, 2023 at 8:55 PM Left Right <olegsivokon <at> gmail.com> wrote:
> >
> > I tried to uninstall every other Ada-related package I installed from
> > my distro packages, including Alire. Downloaded Alire binary afresh
> > and used it to install the toolchain.
> >
> > So, I don't think that when I try to run gprbuild command I get the
> > same output Alire gets when it runs it. It must be running it in some
> > other environment. The thing is: I don't have *any* globally available
> > gprbuild now. But the command Alire runs somehow exits with code 4,
> > whereas if it couldn't find the command, it would have to exit with
> > code 1. It fails for some other reason, but I cannot find a way to
> > make the build more verbose so that it would print the stderr / stdout
> > of the failing command.
> >
> > On Sat, Sep 23, 2023 at 6:28 PM Left Right <olegsivokon <at> gmail.com> wrote:
> > >
> > > > Run "alr toolchain", select the internal Ada compiler.
> > >
> > > Only the external compiler had ever been installed. If I run (I never
> > > ran this before):
> > >
> > > ❯ alr toolchain
> > > CRATE         VERSION STATUS  NOTES
> > > gnat_external 13.2.1  Default Detected at /usr/bin/gnat
> > >
> > > This is what I get.
> > >
> > > Here's what I did afterwards:
> > >
> > > 1. Installed "gnat_native".
> > > 2. Ran `alr toolchain --select` and interactively selected a version
> > > of "gnat_native" and "gprbuild" so that it looks like this:
> > >
> > > ❯ alr toolchain
> > > CRATE         VERSION STATUS    NOTES
> > > gprbuild      22.0.1  Default
> > > gnat_native   13.1.0  Default
> > > gnat_external 13.2.1  Available Detected at /usr/bin/gnat
> > >
> > > Afterwards, I re-ran build.sh, and I get the same (?) error:
> > >
> > > wisitoken-followed_by.adb:222:07: warning: "Generate_Data" is not
> > > modified, could be declared constant [-gnatwk]
> > > gnatcoll-projects.adb:38:09: warning: unit "Ada.Unchecked_Conversion"
> > > is not referenced [-gnatwu]
> > >
> > >    compilation of wisitoken-followed_by.adb failed
> > >
> > > gprbuild: *** compilation phase failed
> > > error: Command ["gprbuild", "-s", "-j0", "-p", "-P",
> > > "/home/olegs/.emacs.d/elpa/ada-mode-8.0.5/emacs_ada_mode_8.0.5_ecfdcfb4/alire/cache/dependencies/wisitoken_4.1.0_f9cd282e/build/wisitoken_alire.gpr"]
> > > exited with code 4
> > > error: Compilation failed.
> > >
> > > And if I re-run the failed command:
> > >
> > > ❯ gprbuild -s "-j0" "-p" "-P"
> > > "/home/olegs/.emacs.d/elpa/ada-mode-8.0.5/emacs_ada_mode_8.0.5_ecfdcfb4/alire/cache/dependencies/wisitoken_4.1.0_f9cd282e/build/wisitoken_alire.gpr"
> > > wisitoken_alire.gpr:8:06: imported project file
> > > "standard_common_alire" not found
> > > wisitoken_alire.gpr:28:43: unknown package or project "Standard_Common_Alire"
> > > wisitoken_alire.gpr:28:43: wrong expression kind for attribute
> > > "default_switches"
> > > wisitoken_alire.gpr:28:84: unknown package or project "Standard_Common_Alire"
> > > wisitoken_alire.gpr:31:43: unknown package or project "Standard_Common_Alire"
> > > wisitoken_alire.gpr:31:43: wrong expression kind for attribute
> > > "default_switches"
> > > wisitoken_alire.gpr:31:82: unknown package or project "Standard_Common_Alire"
> > > wisitoken_alire.gpr:35:41: unknown package or project "Standard_Common_Alire"
> > > wisitoken_config.gpr:3:06: imported project file
> > > "stephes_ada_library.gpr" not found
> > > wisitoken_config.gpr:3:06: imported by
> > > "/home/olegs/.emacs.d/elpa/ada-mode-8.0.5/emacs_ada_mode_8.0.5_ecfdcfb4/alire/cache/dependencies/wisitoken_4.1.0_f9cd282e/config/wisitoken_config.gpr"
> > > wisitoken_config.gpr:3:06: imported by
> > > "/home/olegs/.emacs.d/elpa/ada-mode-8.0.5/emacs_ada_mode_8.0.5_ecfdcfb4/alire/cache/dependencies/wisitoken_4.1.0_f9cd282e/build/wisitoken_alire.gpr"
> > > gprbuild: "/home/olegs/.emacs.d/elpa/ada-mode-8.0.5/emacs_ada_mode_8.0.5_ecfdcfb4/alire/cache/dependencies/wisitoken_4.1.0_f9cd282e/build/wisitoken_alire.gpr"
> > > processing failed
> > >
> > > But when I run:
> > >
> > > ❯ gprbuild --version
> > > GPRBUILD Pro 24.0w (20230430) (x86_64-pc-linux-gnu)
> > > Copyright (C) 2004-2023, AdaCore
> > > This is free software; see the source for copying conditions.
> > > See your AdaCore support agreement for details of warranty and support.
> > > If you do not have a current support agreement, then there is absolutely
> > > no warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
> > > PURPOSE.
> > >
> > > So, it looks like maybe the version I selected through Alire is ignored?
> > >
> > > Should I perhaps uninstall distribution-installed Ada-related packages
> > > and re-try with only Alire-installed ones?
> > >
> > > Thanks!
> > >
> > > Oleg
> > >
> > > On Fri, Sep 22, 2023 at 4:29 PM Stephen Leake
> > > <stephen_leake <at> stephe-leake.org> wrote:
> > > >
> > > > Left Right <olegsivokon <at> gmail.com> writes:
> > > >
> > > > > Hello Stephen, you wrote:
> > > > >
> > > > >> This indicates you are using a compiler external to Alire, with a newer version
> > > > >> than the internal one; I only test with Alire internal compilers, for
> > > > >> consistency.
> > > > >
> > > > >> Please configure the internal Alire compiler.
> > > > >
> > > > >> I will add the tested Alire version to the documentation.
> > > > >
> > > > > I don't know what to do with Alire, but I will try to figure out.
> > > >
> > > > Run "alr toolchain", select the internal Ada compiler.
> > > >
> > > > > But please consider that anyone trying to install Ada on Linux will
> > > > > firstly try to go through the process recommended by the distro
> > > > > maintainers.
> > > >
> > > > Alire is supposed to replace that process, but it's not quite there yet.
> > > >
> > > > > In my case, it's a combination of using pacman to install gcc-ada and
> > > > > AUR (auxiliary packages not directly maintained by Arch distribution)
> > > > > to install gprbuild, adaxml, alire etc. All I've done so far to
> > > > > install Ada was to install packages from these sources.
> > > > > (Unfortunately, both documentation and execution here are lacking, and
> > > > > the process is quite complicated and error-prone).
> > > >
> > > > Apparently this ended up with Alire being configured for the external
> > > > distro Ada compiler, rather than the internal one. That should not
> > > > happen by default; perhaps you ran "alr toolchain" at some point?
> > > >
> > > > > It seems like you want me to install what gcc-ada would install, but
> > > > > through Alire.
> > > >
> > > > No, just use the default compiler provided by the default Alire installation.
> > > >
> > > > > Am I right? In other words, something that isn't provided and managed
> > > > > by the Linux distribution I'm using. This seems like a process that
> > > > > requires a lot more expertise from an average user (building any GCC
> > > > > compiler is not an easy task). Why is this the prefered choice of
> > > > > environment?
> > > >
> > > > It is supposed to require less expertise. Unfortunately, when it fails, it
> > > > is confusing and hard to diagnose.
> > > >
> > > > Part of the reason to start using Alire is to avoid version conflicts
> > > > like this! Apparently that doesn't really work. Sigh.
> > > >
> > > > > As for the documentation: it seems we are reading two different
> > > > > documentations. Is the one you are referring to available online?
> > > > >
> > > > > I was reading this:
> > > > >
> > > > https://www.gnu.org/software/emacs/manual/html_mono/ada-mode.html#Installation
> > > >
> > > > Sigh. That document is dated 2019 (see the Top node). The upstream
> > > > source has been updated since then.
> > > >
> > > > > This documentation has no mention of how to build Ada mode, nor
> > > > > anything about how Ada compiler and toolchain are meant to be set up
> > > > > etc.
> > > >
> > > > The current version refers to ELPA.
> > > >
> > > > --
> > > > -- Stephe




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66017; Package emacs. (Thu, 28 Sep 2023 17:26:01 GMT) Full text and rfc822 format available.

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

From: Stephen Leake <stephen_leake <at> stephe-leake.org>
To: Left Right <olegsivokon <at> gmail.com>
Cc: 66017 <at> debbugs.gnu.org
Subject: Re: bug#66017: Cannot install Ada mode
Date: Thu, 28 Sep 2023 10:25:25 -0700
Left Right <olegsivokon <at> gmail.com> writes:

>> Run "alr toolchain", select the internal Ada compiler.
>
> Only the external compiler had ever been installed. If I run (I never
> ran this before):
>
> ❯ alr toolchain
> CRATE         VERSION STATUS  NOTES
> gnat_external 13.2.1  Default Detected at /usr/bin/gnat
>
> This is what I get.
>
> Here's what I did afterwards:
>
> 1. Installed "gnat_native".
> 2. Ran `alr toolchain --select` and interactively selected a version
> of "gnat_native" and "gprbuild" so that it looks like this:
>
> ❯ alr toolchain
> CRATE         VERSION STATUS    NOTES
> gprbuild      22.0.1  Default
> gnat_native   13.1.0  Default
> gnat_external 13.2.1  Available Detected at /usr/bin/gnat

Ok.

Apparently the version of gnat in alr has been updated since my last
release.

I've updated my Alire index, and have now reproduced this error.

If the --select list has gnat 12, selecting that would be the simplest
workaround. You can change it back to external or internal 13 after
finishing ada-mode install.

> Afterwards, I re-ran build.sh, and I get the same (?) error:
>
> wisitoken-followed_by.adb:222:07: warning: "Generate_Data" is not
> modified, could be declared constant [-gnatwk]
> gnatcoll-projects.adb:38:09: warning: unit "Ada.Unchecked_Conversion"
> is not referenced [-gnatwu]

As Simon pointed out, if the compilation options allowed ignoring
warnings, this would not be a problem. I'll do that in the next release.

One workaround is to edit the release options in your alire workspace for
ada-mode:

edit ~/.emacs.d/elpa/ada-mode-8.0.5/emacs_ada_mode_8.0.5_ecfdcfb4/alire/cache/dependencies/stephes_ada_library_3.7.2_2b6a88f9/build/standard_common_alire.gpr

    (note that is a _very_ long file name!)
    
delete "e" from Common_Switches; it's currently in "-gnatwaBCeJL". Full
patch for that file attached below.

rerun build.sh

That worked for me.

Another workaround is to edit the code to eliminate the warning; see the
patches below. This will be in the next release.

> And if I re-run the failed command:
>
> ❯ gprbuild -s "-j0" "-p" "-P"
> "/home/olegs/.emacs.d/elpa/ada-mode-8.0.5/emacs_ada_mode_8.0.5_ecfdcfb4/alire/cache/dependencies/wisitoken_4.1.0_f9cd282e/build/wisitoken_alire.gpr"
> wisitoken_alire.gpr:8:06: imported project file
> "standard_common_alire" not found
> wisitoken_alire.gpr:28:43: unknown package or project "Standard_Common_Alire"
> wisitoken_alire.gpr:28:43: wrong expression kind for attribute
> "default_switches"
> wisitoken_alire.gpr:28:84: unknown package or project "Standard_Common_Alire"
> wisitoken_alire.gpr:31:43: unknown package or project "Standard_Common_Alire"
> wisitoken_alire.gpr:31:43: wrong expression kind for attribute
> "default_switches"
> wisitoken_alire.gpr:31:82: unknown package or project "Standard_Common_Alire"
> wisitoken_alire.gpr:35:41: unknown package or project "Standard_Common_Alire"
> wisitoken_config.gpr:3:06: imported project file
> "stephes_ada_library.gpr" not found

> So, it looks like maybe the version I selected through Alire is
> ignored?

This fails because it doesn't have the environment variables defined by
alire to point to the toolchain and dependencies. You can use "alr exec"
to try this, but I've not had much success with that.

> Should I perhaps uninstall distribution-installed Ada-related packages
> and re-try with only Alire-installed ones?

No need to uninstall anything.

--
-- Stephe

diff --git a/build/standard_common_alire.gpr b/build/standard_common_alire.gpr
index daf13a3e..c9b64f7c 100644
--- a/build/standard_common_alire.gpr
+++ b/build/standard_common_alire.gpr
@@ -7,7 +7,7 @@
 --  [build-switches] in alire.toml. That is harder to maintain than
 --  this file.
 --
---  Copyright (C) 2018 - 2022 Free Software Foundation, Inc.
+--  Copyright (C) 2018 - 2023 Free Software Foundation, Inc.
 --
 --  This program is free software; you can redistribute it and/or
 --  modify it under terms of the GNU General Public License as
@@ -48,11 +48,11 @@ project Standard_Common_Alire is
       "-g",
       "-gnatfqQ", -- f = all error messages, qQ = process semantics, generate .ali if syntax errors
       "-gnatw.d", -- warnings about tags
-      "-gnatwaBCeJL"
+      "-gnatwaBCJL"
      -- wa = most warnings
      -- wB = no warn on bad fixed values
      -- wC = no warn on conditionals
-     -- we = error on warning
+     -- we = error on warning; only in debug, so released code still compiles with newer gnat
      -- wJ = no warn on obsolescent (including () for array indices!)
      -- wL = no warn on elaboration
      );
@@ -64,7 +64,7 @@ project Standard_Common_Alire is
       "-O0", --  we don't use -Og because that causes gdb to report incorrect results in some cases in Ada.
       "-gnatVa", -- validity checks
       "-gnateE", -- extra info in exceptions
-      "-gnatwP", -- no warn on Inline
+      "-gnatweP", -- error on warn, no warn on Inline
       "-gnata"  -- assertions, pre/post-conditions
      );


diff --git a/wisitoken-followed_by.adb b/wisitoken-followed_by.adb
index 04c9aed5..098b262f 100644
--- a/wisitoken-followed_by.adb
+++ b/wisitoken-followed_by.adb
@@ -30,7 +30,7 @@
 --  expand               : C2: simple_expression : 'new' subtype_indication + primary ;
 --  that's the derivation we are looking for.
 
---  Copyright (C) 2020, 2022 Stephen Leake All Rights Reserved.
+--  Copyright (C) 2020, 2022, 2023 Stephen Leake All Rights Reserved.
 --
 --  This library is free software;  you can redistribute it and/or modify it
 --  under terms of the  GNU General Public License  as published by the Free
@@ -219,7 +219,7 @@ begin
       Input_Data : aliased WisiToken_Grammar_Runtime.User_Data_Type;
       Trace : WisiToken.Text_IO_Trace.Trace;
 
-      Generate_Data : aliased WisiToken.BNF.Generate_Utils.Generate_Data :=
+      Generate_Data : aliased constant WisiToken.BNF.Generate_Utils.Generate_Data :=
         WisiToken.BNF.Generate_Utils.Parse_Grammar_File
           (-Grammar_File_Name, Input_Data'Unchecked_Access, BNF.LALR, BNF.re2c_Lexer, Trace, Ignore_Conflicts => True);
       --  Builds Generate_Data.Descriptor, Generate_Data.Grammar


diff --git a/wisitoken_grammar_runtime.adb b/wisitoken_grammar_runtime.adb
index dc2f3a72..8972f29e 100644
--- a/wisitoken_grammar_runtime.adb
+++ b/wisitoken_grammar_runtime.adb
@@ -242,7 +242,12 @@ package body WisiToken_Grammar_Runtime is
          begin
             WisiToken.Syntax_Trees.LR_Utils.Raise_Programmer_Error
               ("Get_RHS: " & Exception_Name (E) & ": " & Exception_Message (E), Tree, Token);
-            raise; -- WORKAROUND; GNAT pro_22.0w-20201222 ignores 'pragma no_return' on Raise_Programmer_Error
+
+            --  WORKAROUND; GNAT pro_22.0w-20201222 ignores 'pragma
+            --  no_return' on Raise_Programmer_Error; uncomment 'raise' for that
+            --  compiler.
+            --
+            --  raise;
          end;
       end if;
    end Get_RHS;




This bug report was last modified 1 year and 259 days ago.

Previous Next


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