ada-mode-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Gnu Emacs Ada mode 8.0.4 released.


From: Rolf Ebert
Subject: Re: Gnu Emacs Ada mode 8.0.4 released.
Date: Fri, 27 Jan 2023 13:52:54 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0

OK, I can reproduce my problem:

Environment: Debian bullseye, Emacs 27.1, re2c not installed but available via apt:

❯ apt search ^re2c
Sorting... Done
Full Text Search... Done
re2c/stable 2.0.3-1 amd64
lexer generator for C, C++ and Go

If I start ./build I get the following output:

❯ ./build.sh
alr is /home/re/.local/bin/alr
building ada-mode executables via Alire
warn:                                                                    
warn:    New solution is incomplete.
warn:    +  emacs_wisi          4.2.0  (new)                      
warn:    +♼ gnat                12.2.1 (new,installed,gnat_native)
warn:    +  gnatcoll            22.0.0 (new,indirect)             
warn:    +  libgpr              22.0.0 (new,indirect)             
warn:    +↪ re2c                >=2.2  (new,external)             
warn:    +  stephes_ada_library 3.7.2  (new)                      
warn:    +  wisitoken           4.1.0  (new)                      
warn:    +  xmlada              22.0.0 (new,indirect)             
warn:
warn: Could not find a complete solution for emacs_ada_mode=8.0.3
Build will fail unless externals are made available, do you want to continue?
[Y] Yes  [N] No  (default is No)

(red bold marking by me)

After starting the build process by hitting y it starts to include a few crates until it shows the warning messages

warn: The following external dependencies are unavailable within Alire:
warn:    re2c>=2.2
warn: They should be made available in the environment by the user.
warn: Generating possibly incomplete configuration because of missing dependencies

And it finally fails as announced since it cannot find re2c

ⓘ Running pre_build actions for emacs_ada_mode=8.0.3...
/home/re/.emacs.d/elpa/ada-mode-8.0.4/emacs_ada_mode_8.0.3_ab552d7b/alire/cache/dependencies/wisitoken_4.1.0_f9cd282e/build/bin/wisitoken-bnf-generate.exe  --output_bnf ada_annex_p.wy
if [ -f ada_annex_p_*parse_table.txt ]; then mkdir -p bin; for file in ada_annex_p_*parse_table.txt; do mv $file bin; done fi
re2c --no-generation-date --debug-output --input custom -W -Werror --utf-8 -o ada_annex_p_re2c.c ada_annex_p.re2c
make: re2c: No such file or directory
make: *** [/home/re/.emacs.d/elpa/ada-mode-8.0.4/emacs_ada_mode_8.0.3_ab552d7b/alire/cache/dependencies/wisitoken_4.1.0_f9cd282e/build/wisitoken_alire_rules.make:28: ada_annex_p_re2c.c] Error 127
rm ada_annex_p.re2c
warn: A pre-build action failed, re-run with -vv -d for details

If I install re2c manually via apt / apt-get I can build a working ada-mode

Perhaps it is a problem of Alire on my computer. If I search for it it is not found, but I can install it!

❯ alr index --update-all
Already up to date.

❯ alr search re2c
No hits

❯ alr show re2c
Not found: re2c*
There are external definitions for the crate. Use --external to show them.
❯ alr show --external re2c
Kind           Description                Details             Available
System package 1 candidate system package Debian: re2c        True
                                          Ubuntu: re2c
                                          Msys2: re2c
                                          Arch: re2c
                                          Rhel: re2c
                                          Centos: re2c
                                          Fedora: re2c
                                          others: unavailable

❯ alr get re2c
The system package 're2c' is about to be installed.
This action might require admin privileges and impact your system installation.
Do you want Alire to install this system package?
[Y] Yes  [N] No  [A] Always  (default is Yes)
Using default: Yes
Selecting previously unselected package re2c.
(Reading database ... 314174 files and directories currently installed.)
Preparing to unpack .../re2c_2.0.3-1_amd64.deb ...
Unpacking re2c (2.0.3-1) ...
Setting up re2c (2.0.3-1) ...
Processing triggers for man-db (2.9.4-2) ...

I don't understand why alr can install re2c if run manually but cannot install it as part of emacs-ada-mode.

Rolf


On 25/01/2023 14:19, Stephen Leake wrote:
Gnu Emacs Ada mode 8.0.4 is now available in GNU ELPA.

All Ada mode executables can now be built with Alire
(https://alire.ada.dev/); this greatly simplifies that process.

gpr-query and gpr-mode are split out into separate GNU ELPA packages.
You must install them separately (Emacs install-package doesn't
support "recommended packages" like Debian does).

Ada mode can now be used with Eglot; this is controlled by new variables:

ada-diagnostics-backend - one of wisi, eglot, none

ada-face-backend - one of wisi, eglot, none

ada-indent-backend - one of wisi, eglot, none

ada-statement-backend - one of wisi, eglot, none

ada-xref-backend - one of gnat, gpr_query, eglot, none

The diagnostic, face, indent, and statement backends default to wisi
if the wisi parser is found in PATH, to eglot if the Ada LSP server is
found, and none otherwise. The xref backend defaults to gpr_query if
the gpr_query executable in PATH, to gnat otherwise.

ada-diagnostics-backend controls the source of compilation error
messages while editing.

ada-statement-backend controls statement motion; forward-sexp,
wisi-goto-statement-end, etc. ada-xref-backend controls
wisi-goto-spec/body and Emacs xref commands.

In addition, name completion is provided by eglot if any of the other
backends are using eglot; eglot completion is always better than wisi.

The current AdaCore language server (version 23) supports face but not
indent. The current version of eglot (1.10) does not support face. The
Language Server Protocol does not support statment motion. So for now,
eglot + ada_language_server only provides xref and completion.

The AdaCore language server ada_language_server is installed with
GNATStudio (which ada-mode will find by default), or can be built with
Alire. If you build it with Alire, either put it in PATH, or set
gnat-lsp-server-exec.

I have not tested ada-mode with lsp-mode. You can set ada-*-backend to
'other to expermiment with that, or tree-sitter, or some other
backend. tree-sitter will be fully supported in the next ada-mode
release.

The required Ada code requires a manual compile step, after the normal
list-packages installation:

cd ~/.emacs.d/elpa/ada-mode-7.3beta*
./build.sh
./install.sh

If you have Alire installed, these scripts use it.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]