comp.lang.ada
 help / color / mirror / Atom feed
* compiling GPS (aka GNAT Studio!) from source
@ 2019-10-25 16:37 Stephen Leake
  2019-10-25 16:59 ` Stephen Leake
  2019-10-25 19:12 ` Dmitry A. Kazakov
  0 siblings, 2 replies; 10+ messages in thread
From: Stephen Leake @ 2019-10-25 16:37 UTC (permalink / raw)


I'm trying to compile GPS from source, so I can understand how it uses libadalang, and specifically whether it uses libadalang for indentation (so I can compare it to the current Emacs ada-mode).

I've downloaded a tarball from the 19.2 branch on github, and I'm compiling with gnat pro 19.2 on Debian.

After satisfying configure, there are references to "../ada_language_server/*" in some gpr files; that directory does not exist in the GPS sources. 

After commenting those out, there is a "with Glib.Utils;", but there is no glib-utils.ads.

The gtkada package (installed) includes many glib-*, but not glib-utils.

Apparently there is a version/release mismatch here. Does anyone know what version of gtkada (or some other package) includes glib.utils?

Has anyone succeeded in compiling gps from source?

-- Stephe


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: compiling GPS (aka GNAT Studio!) from source
  2019-10-25 16:37 compiling GPS (aka GNAT Studio!) from source Stephen Leake
@ 2019-10-25 16:59 ` Stephen Leake
  2019-10-25 19:12 ` Dmitry A. Kazakov
  1 sibling, 0 replies; 10+ messages in thread
From: Stephen Leake @ 2019-10-25 16:59 UTC (permalink / raw)


On Friday, October 25, 2019 at 9:37:03 AM UTC-7, Stephen Leake wrote:
> I'm trying to compile GPS from source, so I can understand how it uses libadalang, and specifically whether it uses libadalang for indentation (so I can compare it to the current Emacs ada-mode).
> 

Using grep-find, I found gps-20.1/lal/core/lal-ada_languages.ads; apparently GPS is using libadalang for indentation.

I'm particularly interested in how well it handles syntax errors, compared to Emacs ada-mode. I have a test suite with syntax errors for Emacs ada-mode; I'll see how GPS handles that. If anyone has any annecdotes/comments in this area, please let me know.

I'd still like to compile gps from source, so I can trace into the libadalang syntax error handling and indent compute more easily.

-- Stephe

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: compiling GPS (aka GNAT Studio!) from source
  2019-10-25 16:37 compiling GPS (aka GNAT Studio!) from source Stephen Leake
  2019-10-25 16:59 ` Stephen Leake
@ 2019-10-25 19:12 ` Dmitry A. Kazakov
  2019-10-26  7:16   ` briot.emmanuel
  2019-10-26 23:55   ` Steve Johnson
  1 sibling, 2 replies; 10+ messages in thread
From: Dmitry A. Kazakov @ 2019-10-25 19:12 UTC (permalink / raw)


On 2019-10-25 18:37, Stephen Leake wrote:

> Has anyone succeeded in compiling gps from source?

I tried once and failed. If you manage, please post somewhere instructions.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: compiling GPS (aka GNAT Studio!) from source
  2019-10-25 19:12 ` Dmitry A. Kazakov
@ 2019-10-26  7:16   ` briot.emmanuel
  2019-10-26 10:01     ` Stephen Leake
  2019-10-26 23:55   ` Steve Johnson
  1 sibling, 1 reply; 10+ messages in thread
From: briot.emmanuel @ 2019-10-26  7:16 UTC (permalink / raw)



Stephen,

I think GPS is the wrong starting point here.
Instead, most of the work is now done by
   https://github.com/AdaCore/ada_language_server

GPS uses the Language Server Protocol initially defined by Microsoft to communicate with that server (the github page lists exactly what that server can do for Ada code, not all features from GPS are supported yet).
I am now using that server from vim, so I also have cross-references from vi.

I am also sure Emacs already have a language server client, might be worth experimenting.

Emmanuel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: compiling GPS (aka GNAT Studio!) from source
  2019-10-26  7:16   ` briot.emmanuel
@ 2019-10-26 10:01     ` Stephen Leake
  2019-10-26 12:11       ` briot.emmanuel
  0 siblings, 1 reply; 10+ messages in thread
From: Stephen Leake @ 2019-10-26 10:01 UTC (permalink / raw)


On Saturday, October 26, 2019 at 12:16:41 AM UTC-7, briot....@gmail.com wrote:

> Instead, most of the work is now done by
>    https://github.com/AdaCore/ada_language_server
> 

I found the indent code; it's in https://github.com/AdaCore/libadalang-tools src/pp-actions.adb

> I am also sure Emacs already have a language server client, might be worth experimenting.

Yes, but LSP does not support indent, face (as documented in ada-mode.info). I don't remember if it supports all the cross-reference actions used by ada-mode.

I should be able to implement an ada-mode backend using libadalang-tools.

-- Stephe


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: compiling GPS (aka GNAT Studio!) from source
  2019-10-26 10:01     ` Stephen Leake
@ 2019-10-26 12:11       ` briot.emmanuel
  2019-10-27 16:07         ` Stephen Leake
  0 siblings, 1 reply; 10+ messages in thread
From: briot.emmanuel @ 2019-10-26 12:11 UTC (permalink / raw)


> I found the indent code; it's in https://github.com/AdaCore/libadalang-tools src/pp-actions.adb

Likely it is the same code used by gnatpp, which was rewritten last year
to use libadalang, I believe. It likely has far less configuration options
than the Emacs ada-mode does, but it would be nice to share the code nonetheless, and perhaps suggest new configs to AdaCore.

Ultimately, the language server protocol also supports "formatting", and I
think the GNAT Studio team intends to use that for GPS down the line.
It would be awesome if all tools supported the same indentation engine and
switches, that would allow users to better switch editors (even vim supports
the Language Server Protocol, via multiple plugins).

> Yes, but LSP does not support indent, face (as documented in ada-mode.info). I don't remember if it supports all the cross-reference actions used by ada-mode.

I think it does, if you check https://langserver.org/.
"indent" is called "formatting". Of course the Ada server doesn't yet support everything...

I have been using libadalang extensively to parse our 2+ million lines of code and generate input/output subprograms for out types, and I think there was one case where it wasn't able to resolve a type, and this is with a few months old libadalang. So I am really hopeful this is the right technology, even when the sources do not compile yet.

> I should be able to implement an ada-mode backend using libadalang-tools.

What are the Emacs plugins for the Language Server Protocol ?

Emmanuel


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: compiling GPS (aka GNAT Studio!) from source
  2019-10-25 19:12 ` Dmitry A. Kazakov
  2019-10-26  7:16   ` briot.emmanuel
@ 2019-10-26 23:55   ` Steve Johnson
  2019-10-27  0:10     ` Keith Thompson
  2019-10-27  5:24     ` Keith Thompson
  1 sibling, 2 replies; 10+ messages in thread
From: Steve Johnson @ 2019-10-26 23:55 UTC (permalink / raw)


On Friday, October 25, 2019 at 12:12:57 PM UTC-7, Dmitry A. Kazakov wrote:
> 
> I tried once and failed. If you manage, please post somewhere instructions.

You might want to take a look at https://github.com/steve-cs/gnat-builder

The README.md is out of date, but the Makefile should yield clues on how I build gps and spark2014 from source on Ubuntu Bionic. It follows fairly closely the READMEs from the AdaCore github repositories.

Be careful as the default install directory is /usr/local and things like "make release" will clear that (sudo rm -rf /usr/local/*) before building, installing, and tar'ing up a release.  "make -n release | less" will let you see what is happening.

-Steve

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: compiling GPS (aka GNAT Studio!) from source
  2019-10-26 23:55   ` Steve Johnson
@ 2019-10-27  0:10     ` Keith Thompson
  2019-10-27  5:24     ` Keith Thompson
  1 sibling, 0 replies; 10+ messages in thread
From: Keith Thompson @ 2019-10-27  0:10 UTC (permalink / raw)


Steve Johnson <steve@cunningsystems.com> writes:
> On Friday, October 25, 2019 at 12:12:57 PM UTC-7, Dmitry A. Kazakov wrote:
>> 
>> I tried once and failed. If you manage, please post somewhere instructions.
>
> You might want to take a look at https://github.com/steve-cs/gnat-builder
>
> The README.md is out of date, but the Makefile should yield clues on
> how I build gps and spark2014 from source on Ubuntu Bionic. It follows
> fairly closely the READMEs from the AdaCore github repositories.
>
> Be careful as the default install directory is /usr/local and things
> like "make release" will clear that (sudo rm -rf /usr/local/*) before
> building, installing, and tar'ing up a release.  "make -n release | less"
>  will let you see what is happening.

Nuking /usr/local is *serious* bug.  I certainly wouldn't run it on my
system until that's fixed.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Will write code for food.
void Void(void) { Void(); } /* The recursive call of the void */

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: compiling GPS (aka GNAT Studio!) from source
  2019-10-26 23:55   ` Steve Johnson
  2019-10-27  0:10     ` Keith Thompson
@ 2019-10-27  5:24     ` Keith Thompson
  1 sibling, 0 replies; 10+ messages in thread
From: Keith Thompson @ 2019-10-27  5:24 UTC (permalink / raw)


Steve Johnson <steve@cunningsystems.com> writes:
> On Friday, October 25, 2019 at 12:12:57 PM UTC-7, Dmitry A. Kazakov wrote:
>> 
>> I tried once and failed. If you manage, please post somewhere instructions.
>
> You might want to take a look at https://github.com/steve-cs/gnat-builder
>
> The README.md is out of date, but the Makefile should yield clues on
> how I build gps and spark2014 from source on Ubuntu Bionic. It follows
> fairly closely the READMEs from the AdaCore github repositories.
>
> Be careful as the default install directory is /usr/local and things
> like "make release" will clear that (sudo rm -rf /usr/local/*) before
> building, installing, and tar'ing up a release.  "make -n release | less"
> will let you see what is happening.

DO NOT USE THIS TOOL!

Let me repeat that this Makefile can, if invoked with seemingly
reasonable arguments, invoke sudo to remove your entire /usr/local
directory tree.

For those unfamiliar with UNIX-like systems, /usr/local is a common
place to install third-party software.  This Makefile can delete
that entire directory tree using root (administrative) privileges.
It can seriously damage your system.

(I have not directly confirmed that it does this, but I'll take Steve's
word for it.)

No installation script should delete files and directories that
are unrelated to the thing being installed or uninstalled.

https://github.com/steve-cs/gnat-builder/issues/11

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Will write code for food.
void Void(void) { Void(); } /* The recursive call of the void */

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: compiling GPS (aka GNAT Studio!) from source
  2019-10-26 12:11       ` briot.emmanuel
@ 2019-10-27 16:07         ` Stephen Leake
  0 siblings, 0 replies; 10+ messages in thread
From: Stephen Leake @ 2019-10-27 16:07 UTC (permalink / raw)


On Saturday, October 26, 2019 at 5:11:20 AM UTC-7, briot....@gmail.com wrote:
> 
> > Yes, but LSP does not support indent, face (as documented in ada-mode.info). I don't remember if it supports all the cross-reference actions used by ada-mode.
> 
> I think it does, if you check https://langserver.org/.
> "indent" is called "formatting". 

Ok, I'll have to look at it again.

> What are the Emacs plugins for the Language Server Protocol ?

https://github.com/joaotavora/eglot
https://github.com/emacs-lsp

I have not looked at either.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-10-27 16:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-25 16:37 compiling GPS (aka GNAT Studio!) from source Stephen Leake
2019-10-25 16:59 ` Stephen Leake
2019-10-25 19:12 ` Dmitry A. Kazakov
2019-10-26  7:16   ` briot.emmanuel
2019-10-26 10:01     ` Stephen Leake
2019-10-26 12:11       ` briot.emmanuel
2019-10-27 16:07         ` Stephen Leake
2019-10-26 23:55   ` Steve Johnson
2019-10-27  0:10     ` Keith Thompson
2019-10-27  5:24     ` Keith Thompson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox