alr index --update-all
to update your local index
alr build
If I create a crate with alr init --lib
, do I have to choose the name such the lib doesn't conflict with system libs?
gprbuild
has during linking is what will happen, I suspect that your lib would be used as it will be passed explicitly, but I'm not sure right now.
if I have a crate that creates a binary, can I 'install' that binary in a folder like ~/.local/bin/ so that I can access it from anywhere?
Not yet. We've talked about this, with a new alr install
command. See e.g., alire-project/alire#482 and alire-project/alire#628. It will happen eventually I think, particularly if there are expressions of interest like yours.
I also would like to create a lib crate that calls this binary to generate code and then to build that code with
alr build
I think this is already doable, if clumsily: crate A that builds the exe must add the relative path to it with an environment
entry, using something like ${CRATE_ROOT}/path/to/exe
. Crate B, the lib, uses the exe normally with a post-fetch
or pre-build
action. Then crate B with the lib is built normally. But see alire-project/alire#633 in regard to this.
@mosteo I have the following crates:
wayland_ada_info
wayland_protocols_ada
wayland_ada_scanner (build dependency)
wayland_client_ada
wayland_ada_scanner (build dependency)
wayland_egl_ada
wayland_client_ada
wayland_ada_scanner (build dependency)
I can successfully build scanner, client, and egl, but protocols fails:
wayland_client_ada.gpr:1:09: "obj" cannot relocate deeper than object directory
gprbuild: "wayland_protocols_ada.gpr" processing failed
error: Command ["gprbuild", "-gnatwU", "-j0", "-p", "-P", "wayland_protocols_ada.gpr", "--root-dir=.", "--relocate-build-tree=alire/build"] exited with code 4
error: Compilation failed.
So protocols and info fail currently.
Also I tried to add scanner as a dependency to protocols (alr with wayland_ada_scanner^0.1.0 --use ../wayland_ada_scanner
), but alr refused: error: Not adding wayland_ada_scanner because wayland_ada_scanner^0.1.0 is already a dependency
alr pin --use
instead of alr with
(or you could remove it first and re-add it, of course). But I fear you may run in the same relocate error.
alr edit
, running the program doesn't work using the buttons (at least for my gtkada project, compiles though) but when running alr run
from a shell, all works. Is it possible to run from GPS? Maybe I botched something? :D Otherwise it's fine, but debugging would be easier from GPS.
it seems to be a linking issue:
home/henrik/opt/GNAT/2020/bin/../libexec/gcc/x86_64-pc-linux-gnu/9.3.1/ld: /lib/x86_64-linux-gnu/libpng16.so.16: undefined reference to inflateValidate@ZLIB_1.2.9'
/home/henrik/opt/GNAT/2020/bin/../libexec/gcc/x86_64-pc-linux-gnu/9.3.1/ld: /usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so: undefined reference to
pango_fc_font_map_get_config'
/home/henrik/opt/GNAT/2020/bin/../libexec/gcc/x86_64-pc-linux-gnu/9.3.1/ld: /usr/lib/x86_64-linux-gnu/libgtk-3.so: undefined reference to `pango_fc_font_map_config_changed'
collect2: error: ld returned 1 exit status
alr run
, it fails for the same error. would that suggest that GPS sets some ENV variable incorrectly or similar?
alr printenv
?