Closed eine closed 5 years ago
The absolute path is the one given by --prefix and is used to locate the vhdl libraries. So even if the libraries are copied by setup.py, they are currently not used.
To use them, just re-enable the 'set the default prefix' part of libghdl/init.py
Sorry, libghdl.py integration/build is still WIP!
The absolute path is the one given by --prefix and is used to locate the vhdl libraries. So even if the libraries are copied by setup.py, they are currently not used.
All makes sense now... Is this built in the shared library or is it defined in the Python part?
Sorry, libghdl.py integration/build is still WIP!
It's ok. I just wanted to make sure that this was a 'bug' and not an error on my side.
This is something to check when libghdl*.so
is made part of GHDL in #840. GHDL itself does not honour the --prefix
I think. At least, it is possible to make install
it to any location, and the package and move that location.
To use them, just re-enable the 'set the default prefix' part of libghdl/init.py
I will try this.
The prefix is built in libghdl.so; but as you noticed ghdl tries to find where it is installed. This is almost required for Windows, a platform where the user may install the ghdl binary at any place.
FTR, setting the prefix in __init__.py
, as suggested by @tgingold, works. Therefore, no 'big' change is requires to fix this. It would be possible to use os.environ.get['LIBGHDL_PREFIX']
, instead of harcoding a True/False.
Moreover, in the current state of the codebase, I think it would be better if the default was ./
. Nevertheless, it is not worth changing it now, becase #840 is almost ready.
The following Dockerfile builds and installs GHDL and the ghdl-language-server VSC extension; and installs libghdl and ghdl-ls. It produces a docker image which VSC can attach to through the
Remote - Containers
extension. As a result, it allows to easily test/use all the tools.Note that in the second container GHDL is installed in
/tmp/ghdl/install-llvm-6.0
, which is theprefix
that was used when GHDL was built (see first container). This should not be required, because libghdl is independent from GHDL for now. However, if GHDL is not available at/tmp/ghdl/install-llvm-6.0
, the VSC extension fails:The relevant part is
raised ERROROUT.OPTION_ERROR : errorout.adb:399
.Surprisingly, this seems to be some kind of startup check. I.e., if the content is available at
/tmp/ghdl/install-llvm-6.0
when a*.vhdl
is opened in VSC, the extension works ok. I can then move or remove the ghdl folder and opening other VHDL files works too. However, if I open a different folder with VSC (which makes it reload the window and reconnect to the container) or I justCtrl+R
, it fails again.As a result, I think that some code in
libghdl*.so
might depend on theprefix
that was used at build time, and not on the current location. I have not guessed which specific resources is it trying to find.The Dockerfile above is based on two images which are not publicly available yet (
ghdl/build:ls-ubuntu
andghdl/run:ls-ubuntu
). This is the source, in case you want to build them: