comp.lang.ada
 help / color / mirror / Atom feed
* Got to ask this about GPS: Do others have the same problems with Python?
@ 2020-03-04  0:28 Rick Newbie
  2020-03-04 11:54 ` Markus Schöpflin
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Rick Newbie @ 2020-03-04  0:28 UTC (permalink / raw)


Hello,

I am using the GPS community edition to learn Ada on Win10. So far I 
have overcome the first obstacle but I constantly run into problems with 
Python when doing things in GPS that you would expect should just work 
and which are simply syntax errors in the Python scripts that come with 
GPS.I was able to fix the problems regarding the start of GDB but there 
are many others.

For instance: I create a procedure header in an ADS file then use the 
"Generate Body Of ..." from the context menu and I get this in the 
output window:

Traceback (most recent call last):
   File "D:\GNAT\2019\share\gps\support\core\gps_utils\__init__.py", 
line 352, in do
     r = callback()
   File "D:\GNAT\2019\share\gps\support\core\gnatstub.py", line 173, in 
generate_plain_body
     generate_body(as_separate=False)
   File "D:\GNAT\2019\share\gps\support\core\gnatstub.py", line 153, in 
generate_body
     command += x_args + [file.path, file.directory()]
AttributeError: 'NoneType' object has no attribute 'path'


I mean this is clearly a programming error in the Python scrip, right? 
How come they deliver GPS with obvious errors that should jump into 
everybody's face when using the IDE? Or is it just my installation and 
something is wrong on my end? Does it work better on Linux?

I mean I can work around this, but this really puzzles me. If it were 
some rare and esoteric bugs, OK, that happens to everybody but these are 
really too obvious

Thanks

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

* Re: Got to ask this about GPS: Do others have the same problems with Python?
  2020-03-04  0:28 Got to ask this about GPS: Do others have the same problems with Python? Rick Newbie
@ 2020-03-04 11:54 ` Markus Schöpflin
  2020-03-24  3:53   ` Rick Newbie
  2020-03-04 15:04 ` Simon Wright
  2020-03-05  2:26 ` Anh Vo
  2 siblings, 1 reply; 6+ messages in thread
From: Markus Schöpflin @ 2020-03-04 11:54 UTC (permalink / raw)


On 2020-03-04 01:28, Rick Newbie wrote:

> For instance: I create a procedure header in an ADS file then use the 
> "Generate Body Of ..." from the context menu and I get this in the output window:

[snip]

Did you set up the PATH environment variable correctly? If yes, can you please 
show its contents? (Open a command prompt and type "echo %PATH%".)

-- 
Markus

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

* Re: Got to ask this about GPS: Do others have the same problems with Python?
  2020-03-04  0:28 Got to ask this about GPS: Do others have the same problems with Python? Rick Newbie
  2020-03-04 11:54 ` Markus Schöpflin
@ 2020-03-04 15:04 ` Simon Wright
  2020-03-05  2:26 ` Anh Vo
  2 siblings, 0 replies; 6+ messages in thread
From: Simon Wright @ 2020-03-04 15:04 UTC (permalink / raw)


Rick Newbie <nuttin@nuttn.nowhere> writes:

> For instance: I create a procedure header in an ADS file then use the
> "Generate Body Of ..." from the context menu and I get this in the
> output window:

Not just Windows! On macOS, the first time I tried it (on a spec that
shouldn't have had a body) I got

   gnat stub -P/Users/simon/tmp/so/rules.gpr /Users/simon/tmp/so/rules.ads /Users/simon/tmp/so/

but no .adb.

The second time, I got the same output as you describe (modulo Windows
vs Unix).

The third time, after I added a subprogram (so a body was valid), it
worked.

The fourth time, after I removed the subprogram, back we are with your
error!

Traceback (most recent call last):
  File "/opt/gnat-ce-2019/share/gps/support/core/gps_utils/__init__.py", line 352, in do
    r = callback()
  File "/opt/gnat-ce-2019/share/gps/support/core/gnatstub.py", line 173, in generate_plain_body
    generate_body(as_separate=False)
  File "/opt/gnat-ce-2019/share/gps/support/core/gnatstub.py", line 153, in generate_body
    command += x_args + [file.path, file.directory()]
AttributeError: 'NoneType' object has no attribute 'path'

If I run the command that GPS says it's executing by hand, I get

$ gnat stub -P/Users/simon/tmp/so/rules.gpr /Users/simon/tmp/so/rules.ads /Users/simon/tmp/so/
gnatstub: tree file rules.adt already exists use -r or -t to reuse or to overwrite it

so I use -t and get

$ gnat stub -t -P/Users/simon/tmp/so/rules.gpr /Users/simon/tmp/so/rules.ads /Users/simon/tmp/so/
gnatstub: Compilation unit Rules does not require a body

(and rules.adt has been deleted, so I don't need to use -t next time).

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

* Re: Got to ask this about GPS: Do others have the same problems with Python?
  2020-03-04  0:28 Got to ask this about GPS: Do others have the same problems with Python? Rick Newbie
  2020-03-04 11:54 ` Markus Schöpflin
  2020-03-04 15:04 ` Simon Wright
@ 2020-03-05  2:26 ` Anh Vo
  2 siblings, 0 replies; 6+ messages in thread
From: Anh Vo @ 2020-03-05  2:26 UTC (permalink / raw)


On Tuesday, March 3, 2020 at 4:28:35 PM UTC-8, Rick Newbie wrote:
> Hello,
> 
> I am using the GPS community edition to learn Ada on Win10. So far I 
> have overcome the first obstacle but I constantly run into problems with 
> Python when doing things in GPS that you would expect should just work 
> and which are simply syntax errors in the Python scripts that come with 
> GPS.I was able to fix the problems regarding the start of GDB but there 
> are many others.
> 
> For instance: I create a procedure header in an ADS file then use the 
> "Generate Body Of ..." from the context menu and I get this in the 
> output window:
> 
> Traceback (most recent call last):
>    File "D:\GNAT\2019\share\gps\support\core\gps_utils\__init__.py", 
> line 352, in do
>      r = callback()
>    File "D:\GNAT\2019\share\gps\support\core\gnatstub.py", line 173, in 
> generate_plain_body
>      generate_body(as_separate=False)
>    File "D:\GNAT\2019\share\gps\support\core\gnatstub.py", line 153, in 
> generate_body
>      command += x_args + [file.path, file.directory()]
> AttributeError: 'NoneType' object has no attribute 'path'
> 
> 
> I mean this is clearly a programming error in the Python scrip, right? 
> How come they deliver GPS with obvious errors that should jump into 
> everybody's face when using the IDE? Or is it just my installation and 
> something is wrong on my end? Does it work better on Linux?
> 
> I mean I can work around this, but this really puzzles me. If it were 
> some rare and esoteric bugs, OK, that happens to everybody but these are 
> really too obvious

I also run GPS 19.1 (20190106) hosted on x86_64-pc-mingw32
GNAT Community 2019 (20190517-83) on Windows 10, and I had no problem generating package body stub for package specification needing package body. For a package specification needing no package body, no package body stub will be generated.

Anh Vo 


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

* Re: Got to ask this about GPS: Do others have the same problems with Python?
  2020-03-04 11:54 ` Markus Schöpflin
@ 2020-03-24  3:53   ` Rick Newbie
  2020-03-24  7:25     ` Markus Schöpflin
  0 siblings, 1 reply; 6+ messages in thread
From: Rick Newbie @ 2020-03-24  3:53 UTC (permalink / raw)


On 3/4/2020 3:54 AM, Markus Schöpflin wrote:
> On 2020-03-04 01:28, Rick Newbie wrote:
> 
>> For instance: I create a procedure header in an ADS file then use the 
>> "Generate Body Of ..." from the context menu and I get this in the 
>> output window:
> 
> [snip]
> 
> Did you set up the PATH environment variable correctly? If yes, can you 
> please show its contents? (Open a command prompt and type "echo %PATH%".)
> 

Here you go


C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS 
Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program 
Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program 
Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files 
(x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program 
Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files 
(x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program 
Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Common 
Files\Autodesk Shared\;C:\Program Files 
(x86)\Autodesk\Backburner\;C:\Program Files (x86)\Bitvise SSH 
Client;D:\Program Files\Perforce;D:\Program Files\Perforce\;C:\Program 
Files\Microsoft SQL Server\130\Tools\Binn\;d:\Program 
Files\doxygen\bin;C:\WINDOWS\System32\OpenSSH\;C:\Program Files 
(x86)\Windows Kits\10\Windows Performance 
Toolkit\;D:\GNAT\2019\bin;D:\Program Files\SlickEdit Pro 
23.0.1\win\;C:\Programs\emacs\bin;C:\Users\Rick\AppData\Local\Microsoft\WindowsApps;d:\Program 
Files\Microsoft VS Code\bin;D:\Program Files\Perforce\Server;C:\Program 
Files (x86)\Microsoft Visual 
Studio\2019\Enterprise\Common7\IDE;C:\Program Files (x86)\Windows 
Kits\10\Debuggers\x64;

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

* Re: Got to ask this about GPS: Do others have the same problems with Python?
  2020-03-24  3:53   ` Rick Newbie
@ 2020-03-24  7:25     ` Markus Schöpflin
  0 siblings, 0 replies; 6+ messages in thread
From: Markus Schöpflin @ 2020-03-24  7:25 UTC (permalink / raw)


On 2020-03-24 04:53, Rick Newbie wrote:
> On 3/4/2020 3:54 AM, Markus Schöpflin wrote:

>> Did you set up the PATH environment variable correctly? If yes, can you 
>> please show its contents? (Open a command prompt and type "echo %PATH%".)
>>
> 
> Here you go
> 

Short in the dark: try to put the GNAT path in front and see if it help:

- Open a command prompt
- Type 'set PATH=D:\GNAT\2019\bin;%PATH%'
- Run GPS from that command line by typing 'gps'

It could be that some other Python version gets picked up. Trying it this way 
will ensure that every binary found by GPS is the one delivered by the installer.

Markus

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

end of thread, other threads:[~2020-03-24  7:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-04  0:28 Got to ask this about GPS: Do others have the same problems with Python? Rick Newbie
2020-03-04 11:54 ` Markus Schöpflin
2020-03-24  3:53   ` Rick Newbie
2020-03-24  7:25     ` Markus Schöpflin
2020-03-04 15:04 ` Simon Wright
2020-03-05  2:26 ` Anh Vo

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