ghdl-gcc from the official debian package 1.0.0 fails to find installed backend

Asked by Baptiste Petit

In order to checkout the official ghdl-gcc 1.0.0 debian package, I built a docker container based on the docker hub hosted ubuntu:hirsute image.

However I do not seem to be able to use the ghdl executable directly as the command "ghdl --version" returns to me the error "Error: No installed ghdl backend found. Terminating!"

Could this be due to a packaging error? Or is it possibly due to Ubuntu Hirsute being unstable at this point?

I did check and the actual binary /usr/bin/ghdl-gcc searched by the executable script /usr/bin/ghdl is present.

I compared with the same install procedure in a container based on Ubuntu Focal, the ghdl-gcc package is then in version 0.37. There, the same /usr/bin/ghdl executable script is present and seems to be working without any issues.

Here is my Ubuntu Hirsute based container dockerfile contents: https://pastebin.ubuntu.com/p/792SNnjh9f/
Here is my Ubuntu Focal based container dockerfile contents: https://pastebin.ubuntu.com/p/McRm7JHQf6/

Edit: Updated pastebin links due to a copy-paste error

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu ghdl Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

For diagnostic purposes, what is the output of the commands

uname -a
lsb_release -crid
dpkg -l | grep ghdl
echo $GHDL_BACKEND
ghdl --version
ghdl-gcc --version
ghdl-llvm --version
ghdl-mcode --version
which ghdl
which ghdl-gcc
which ghdl-llvm
which ghdl-mcode

Revision history for this message
Baptiste Petit (baptistepetit) said :
#2

No problem, thank you for the suggestion.

Here are the results in the container based on hirsute with ghdl-gcc 1.0.0:
https://pastebin.ubuntu.com/p/XwnCsTQNF4/

For completeness, here are the results in the container based on focal with ghdl-gcc 0.37:
https://pastebin.ubuntu.com/p/pkqnNt4Bcw/

Revision history for this message
Manfred Hampl (m-hampl) said :
#3

This is unexpected:

ghdluser@5377720452b0:/$ ghdl --version
Error: No installed ghdl backend found. Terminating!

ghdluser@5377720452b0:/$ ghdl-gcc --version
GHDL 1.0.0 (Ubuntu 1.0.0+dfsg-1) [Dunoon edition]
 Compiled with GNAT Version: 10.2.1 20210206
 GCC back-end code generator
Written by Tristan Gingold.

Copyright (C) 2003 - 2021 Tristan Gingold.
GHDL is free software, covered by the GNU General Public License. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

ghdluser@5377720452b0:/$ which ghdl
(no output)
ghdluser@5377720452b0:/$ which ghdl-gcc
(no output)

The commands do run, but "which" can't find them?

What output do you receive for
echo $PATH
/usr/bin/ghdl --version

Revision history for this message
Baptiste Petit (baptistepetit) said :
#4

Indeed, it is surprising.

Here is the result, I also printed the return code of the "which" command with "echo $?" in case it helps.

https://pastebin.ubuntu.com/p/zgPdDDFDQG/

Revision history for this message
Baptiste Petit (baptistepetit) said :
#5

Small addition:

I just tested more binaries that should be in my path (apt, bash), "which" is also not outputting their location.

Revision history for this message
Manfred Hampl (m-hampl) said :
#6

What is the output of

sh -x /usr/bin/ghdl --version

Revision history for this message
Baptiste Petit (baptistepetit) said :
#7

Here is the result of "sh -x /usr/bin/ghdl --version":
https://pastebin.ubuntu.com/p/c5fxQTC4V7/

PS: Just in case I tried the "which" command as root as well as a normal user in the container, same same result for both.

Revision history for this message
Manfred Hampl (m-hampl) said :
#8

Something seems to be wrong with your shell.
Which one are you using?

What is the output of

bash -x /usr/bin/ghdl --version

Revision history for this message
Manfred Hampl (m-hampl) said :
#9

And please also provide the output of

ls -l /usr/bin/ghdl*

Revision history for this message
Baptiste Petit (baptistepetit) said :
#10

I was not sure which shell I am using, except it is the default one for docker Ubuntu containers, so I used the command "ps -p $$" to check and it seems to be bash.

Here is that result as well as the other information you asked about:
https://pastebin.ubuntu.com/p/w4tHqtNRdQ/

Revision history for this message
Best Manfred Hampl (m-hampl) said :
#11

You should better put the output directly into this question document and not on a pastebin server, because pastes get deleted after a certain time, and then there will be no possibility to understand this question document any more.

ghdluser@940f0e782080:/$ bash -x /usr/bin/ghdl --version
+ set -e
+ backend=
++ dirname /usr/bin/ghdl
+ bindir=/usr/bin
+ '[' '!' -x /usr/bin/ghdl- ']'
+ '[' -x /usr/bin/ghdl-mcode ']'
+ '[' -x /usr/bin/ghdl-gcc ']'
+ '[' -x /usr/bin/ghdl-llvm ']'
+ echo 'Error: No installed ghdl backend found. Terminating!'
Error: No installed ghdl backend found. Terminating!
+ exit 2

#ghdluser@940f0e782080:/$ ls -l /usr/bin/ghdl*
-rwxr-xr-x 1 root root 393 Dec 13 19:29 /usr/bin/ghdl
-rwxr-xr-x 1 root root 2364840 Feb 11 01:29 /usr/bin/ghdl-gcc

Sorry, I have no clue what there is happening on your system.
The "ls" command shows that /usr/bin/ghdl-gcc exists and is executable, but the test "-x /usr/bin/ghdl-gcc" in the ghdl script does not enter the "true" branch.

I do not think that it is an error in ghdl, because you already wrote that also "which" does not work as expected.

What output do you receive for
GHDL_BACKEND=gcc sh -x /usr/bin/ghdl --version

Revision history for this message
Baptiste Petit (baptistepetit) said :
#12

Good to know about pastebin, thank you!

Yes I am also really confused about what is happening here.

Here is what I get with this last attempt:

ghdluser@1c3f7156c083:/$ GHDL_BACKEND=gcc sh -x /usr/bin/ghdl --version
+ set -e
+ backend=gcc
+ dirname /usr/bin/ghdl
+ bindir=/usr/bin
+ [ ! -x /usr/bin/ghdl-gcc ]
+ [ -x /usr/bin/ghdl-mcode ]
+ [ -x /usr/bin/ghdl-gcc ]
+ [ -x /usr/bin/ghdl-llvm ]
+ echo Error: No installed ghdl backend found. Terminating!
Error: No installed ghdl backend found. Terminating!
+ exit 2

I guess I will wait to see if it still happens after Hirsute gets officially released. Thank you for your time though, appreciate it!

I am pretty new at interacting in launchpad, should I close the question by clicking the "problem solved" button, or is it better to leave it open until I retry with a newer Hirsute image?

Revision history for this message
Baptiste Petit (baptistepetit) said :
#13

Sorry for the delay, today I could confirm that the current image of Hirsute (now that it is released) does not give me this error anymore.

Thank you for your support earlier this year.

Revision history for this message
Baptiste Petit (baptistepetit) said :
#14

Thanks Manfred Hampl, that solved my question.