comp.lang.ada
 help / color / mirror / Atom feed
* GNAT GPL 2017 gnatcoll.xref disappeared?
@ 2017-06-22 17:35 Stephen Leake
  2017-06-22 19:27 ` Simon Wright
  2017-06-23  8:03 ` Simon Wright
  0 siblings, 2 replies; 7+ messages in thread
From: Stephen Leake @ 2017-06-22 17:35 UTC (permalink / raw)


I'm trying to upgrade to GNAT GPL 2017 (from 2016). I'm running on Windows 8.1.

One application uses gnatcoll.xref.

In 2016, that's found in:

gnat/include/gnatcoll/gnatcoll_sqlite.static/gnatcoll-xref.ads

However, the file is not found in the 2017 install. Note that the 'gnat-...-bin.exe' installer for 2017 includes gnatcoll, while in 2016 it's a separate install.

The gnatcoll user guide for 2017 (share/doc/gnatcoll/GNATColl.pdf) chapter 25 says gnatcoll.xref should be there (it is used in the example code).

Has anyone else run into this? And is there a fix/workaround?

-- Stephe

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

* Re: GNAT GPL 2017 gnatcoll.xref disappeared?
  2017-06-22 17:35 GNAT GPL 2017 gnatcoll.xref disappeared? Stephen Leake
@ 2017-06-22 19:27 ` Simon Wright
  2017-06-22 20:01   ` Simon Wright
  2017-06-23  8:03 ` Simon Wright
  1 sibling, 1 reply; 7+ messages in thread
From: Simon Wright @ 2017-06-22 19:27 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 744 bytes --]

Stephen Leake <stephen_leake@stephe-leake.org> writes:

> I'm trying to upgrade to GNAT GPL 2017 (from 2016). I'm running on
> Windows 8.1.
>
> One application uses gnatcoll.xref.
>
> In 2016, that's found in:
>
> gnat/include/gnatcoll/gnatcoll_sqlite.static/gnatcoll-xref.ads
>
> However, the file is not found in the 2017 install. Note that the
> 'gnat-...-bin.exe' installer for 2017 includes gnatcoll, while in 2016
> it's a separate install.
>
> The gnatcoll user guide for 2017 (share/doc/gnatcoll/GNATColl.pdf)
> chapter 25 says gnatcoll.xref should be there (it is used in the
> example code).
>
> Has anyone else run into this? And is there a fix/workaround?

Assuming you're working on ada-mode .. these patches should do the
trick!


[-- Attachment #2: Patch for new gnatcoll.xref location --]
[-- Type: text/plain, Size: 1201 bytes --]

diff --git a/ada_mode_gps_indent.gpr b/ada_mode_gps_indent.gpr
index 3667edfc..a6656059 100644
--- a/ada_mode_gps_indent.gpr
+++ b/ada_mode_gps_indent.gpr
@@ -19,6 +19,7 @@
 with "gnat_util";
 with "gnatcoll_sqlite";
 with "gnatcoll_iconv";
+with "gnatcoll_xref";
 project Ada_Mode_GPS_Indent is
    for Main use ("ada_mode_gps_indent.adb");
 
diff --git a/gpr_query.adb b/gpr_query.adb
index d53a622d..7737b798 100644
--- a/gpr_query.adb
+++ b/gpr_query.adb
@@ -444,8 +444,7 @@ procedure Gpr_Query is
       pragma Unreferenced (Args);
    begin
       Xref.Parse_All_LI_Files
-        (Tree                => Tree,
-         Project             => Tree.Root_Project,
+        (Project             => Tree.Root_Project,
          Parse_Runtime_Files => False, --  True encounters bug in gnatcoll.projects; null pointer
          Show_Progress       => Progress_Reporter,
          ALI_Encoding        => ALI_Encoding.all,
diff --git a/gpr_query.gpr b/gpr_query.gpr
index 6e57ee13..fcb9c655 100644
--- a/gpr_query.gpr
+++ b/gpr_query.gpr
@@ -18,6 +18,7 @@
 
 with "gnatcoll";
 with "gnatcoll_sqlite";
+with "gnatcoll_xref";
 with "gnat_util";
 project Gpr_query is
    for Main use ("gpr_query.adb");

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

* Re: GNAT GPL 2017 gnatcoll.xref disappeared?
  2017-06-22 19:27 ` Simon Wright
@ 2017-06-22 20:01   ` Simon Wright
  2017-06-22 23:35     ` Stephen Leake
  0 siblings, 1 reply; 7+ messages in thread
From: Simon Wright @ 2017-06-22 20:01 UTC (permalink / raw)


Simon Wright <simon@pushface.org> writes:

> Assuming you're working on ada-mode .. these patches should do the
> trick!

Sorry, they don't. They would if you had a full installation of gnatcoll
(as I have, with FSF GCC 7.1.0 for macOS).

Looks as though you need the source (from libre? certainly from github),
and provided your gnatcoll has projects, iconv and sqlite enabled it
should select xref automatically.

I suppose I must have iconv installed; anyway, the notes are as below
(adjust for obvious mac-isms! and you probably won't want/have gmp)

========================================================================
GNATColl built without changes. It was configured as below, which is
minimal apart from GNU Readline, GMP and Projects being enabled and
PostGres being disabled. Users may wish to reconfigure for their own
requirements.

  ./configure \
    --prefix=/opt/gcc-7.1.0 \
    --build=x86_64-apple-darwin15 \
    --enable-gpl \
    --with-gmp \
    --without-postgresql

(I'm not sure that --with-gmp is needed if the library is found)
resulting in

  Shared libraries:       yes (default: static)
  Gtk+:                   no (requires pkg-config and gtkada.gpr)
  Python:                 yes /System/Library/Frameworks/Python.framework/Versions/2.7 (see --with-python)
  PyGtk:                  no  (see --enable-pygtk)
  PyGObject:              no (see --enable-pygobject)
  Syslog:                 yes (see --enable-syslog)
  Readline (GPL license): yes (see --with-readline --enable-gpl)
  gmp:                    yes (see --with-gmp)
  PostgreSQL:             no (see --with-postgresql)
  Sqlite:                 embedded  (see --with-sqlite)
  Iconv:                  yes (see --with-iconv)
  Projects:               yes

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

* Re: GNAT GPL 2017 gnatcoll.xref disappeared?
  2017-06-22 20:01   ` Simon Wright
@ 2017-06-22 23:35     ` Stephen Leake
  2017-06-23  8:11       ` Simon Wright
  2017-06-23 16:42       ` Stephen Leake
  0 siblings, 2 replies; 7+ messages in thread
From: Stephen Leake @ 2017-06-22 23:35 UTC (permalink / raw)


On Thursday, June 22, 2017 at 3:01:39 PM UTC-5, Simon Wright wrote:
> Simon Wright writes:
> 
> > Assuming you're working on ada-mode .. these patches should do the
> > trick!
> 
> Sorry, they don't. They would if you had a full installation of gnatcoll
> (as I have, with FSF GCC 7.1.0 for macOS).

Right. I fixed it by installing gnatcoll from source, overwriting the binary install. gnatcoll.xref now requires iconv (2016 did not), so I had to install that in mingw32, and convince gnat to use it. took a while.

It would be interesting to go back and see if the binary install now installs gnatcoll.xref, since iconv is now available. But I'm not going to spend time on that.

Then I reinvented the patches you show above. Plus I deleted a use of "Prj"; I don't remember where that came from, but it doesn't seem important.

To be compatible with both 2016 and 2107, I split out process_refresh into a separate subunit, and added gnatprep #if to select the proper syntax. Got to verify that ada-mode gnatprep indent works :).

(I also posted this on stackoverflow; answered here first :).

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

* Re: GNAT GPL 2017 gnatcoll.xref disappeared?
  2017-06-22 17:35 GNAT GPL 2017 gnatcoll.xref disappeared? Stephen Leake
  2017-06-22 19:27 ` Simon Wright
@ 2017-06-23  8:03 ` Simon Wright
  1 sibling, 0 replies; 7+ messages in thread
From: Simon Wright @ 2017-06-23  8:03 UTC (permalink / raw)


Stephen Leake <stephen_leake@stephe-leake.org> writes:

> However, the file is not found in the 2017 install. Note that the
> 'gnat-...-bin.exe' installer for 2017 includes gnatcoll, while in 2016
> it's a separate install.

I raised the problem with AdaCore, they are looking into it.

Also, see https://github.com/AdaCore/gnatcoll/issues/13

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

* Re: GNAT GPL 2017 gnatcoll.xref disappeared?
  2017-06-22 23:35     ` Stephen Leake
@ 2017-06-23  8:11       ` Simon Wright
  2017-06-23 16:42       ` Stephen Leake
  1 sibling, 0 replies; 7+ messages in thread
From: Simon Wright @ 2017-06-23  8:11 UTC (permalink / raw)


Stephen Leake <stephen_leake@stephe-leake.org> writes:

> It would be interesting to go back and see if the binary install now
> installs gnatcoll.xref, since iconv is now available. But I'm not
> going to spend time on that.

I'd be very surprised if it did; the doinstall process is very much a
matter of copying, some compiler internals (fixincludes?) aside.

And I have iconv on the Mac; gpl 2017 installed without xref anyway.


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

* Re: GNAT GPL 2017 gnatcoll.xref disappeared?
  2017-06-22 23:35     ` Stephen Leake
  2017-06-23  8:11       ` Simon Wright
@ 2017-06-23 16:42       ` Stephen Leake
  1 sibling, 0 replies; 7+ messages in thread
From: Stephen Leake @ 2017-06-23 16:42 UTC (permalink / raw)


On Thursday, June 22, 2017 at 6:35:19 PM UTC-5, Stephen Leake wrote:
> Right. I fixed it by installing gnatcoll from source, overwriting the binary 
> install. gnatcoll.xref now requires iconv (2016 did not), so I had to install 
> that in mingw32, and convince gnat to use it. took a while.

Posted too soon; that compiles, but it doesn't run.

It crashes (as in Windows says "application terminated in unusual way") when it tries to spawn gnatls in gnatcoll.xref.load.

I gather you don't get that crash on Mac; I'll try Debian.

Also, ensuring the mingw32 iconv dll is in PATH at gpr_query runtime is annoying; how can I get that to link statically?


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

end of thread, other threads:[~2017-06-23 16:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-22 17:35 GNAT GPL 2017 gnatcoll.xref disappeared? Stephen Leake
2017-06-22 19:27 ` Simon Wright
2017-06-22 20:01   ` Simon Wright
2017-06-22 23:35     ` Stephen Leake
2017-06-23  8:11       ` Simon Wright
2017-06-23 16:42       ` Stephen Leake
2017-06-23  8:03 ` Simon Wright

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