alire
alire copied to clipboard
Alire isn't happy with getting gtkada
PS C:\Users\Chris> alr get gtkada Warning: Warning: New solution is incomplete. Warning: +~ libgtk3 >=3.24.24 (new,external) Warning: +~ make * (new,external) Warning: + pkg_config 2.1.0 (new) Warning: Warning: Could not find a complete solution for gtkada=24.0.0 Build will fail unless externals are made available, do you want to continue? [Y] Yes [N] No (default is No) Yes Note: Deploying gtkada=24.0.0... File not found - C:\Users\Chris\alr-azyz.tmp* File not found - C:\Users\Chris\alr-azyz.tmp* ERROR: Command ["curl", "https://github.com/AdaCore/gtkada/archive/v24.0.0/gtkada-24.0.0.zip", "--location", "--progress-bar", "--output", "C:\Users\Chris\alr-azyz.tmp\gtkada-24.0.0.zip"] exited with code -1
I keep getting stuff like this on Windows and Alire. Here is my system info:
APPLICATION
alr version: 1.2.2
libalire version: 1.2.2
compilation date: 2023-01-12 20:53:29
compiler version: Community 2021 (20210519-103)
CONFIGURATION
config folder: C:\Users\Chris.config\alire
force flag: FALSE
non-interactive flag: FALSE
community index branch: stable-1.2.1
compatible index versions: ^1.1 & <=1.2.1
indexes folder: C:\Users\Chris.config\alire\indexes
indexes metadata: OK
index #1: (community) git+https://github.com/alire-project/alire-index#stable-1.2.1
toolchain assistant: disabled
tool #1 gnat: gnat_external=13.2.0
tool #2 gprbuild: gprbuild=22.0.0
WORKSPACE
root status: OUTSIDE
root release: N/A
root load error: N/A
root folder: N/A
current folder: C:\Users\Chris
SYSTEM
distribution: DISTRO_UNKNOWN
host-arch: X86_64
os: WINDOWS
target: NATIVE
toolchain: USER
word-size: BITS_64
I seem to have less issues on Linux but I want to do this on WIndows too.
Hi @MrAda, I just tried on my setup and the download was fine.
I guess there is an issue with curl and your network, or a bad installation of MSYS2.
Can you try to run alr exec -- curl
inside an alire crate folder? E.g.
alr init -bin plop
cd plop
alr exec -- curl
I am trying to follow your directions and each time I get an error with the -bin:
PS C:\Users\Chris\hello_1.0.2_5715870b> alr exec -- curl
ERROR: Not installed: gprbuild=22.0.0
ERROR: alr encountered an unexpected error, re-run with -d for details.
PS C:\Users\Chris\hello_1.0.2_5715870b> cd ..
PS C:\Users\Chris> alr init -bin plop
ERROR: Unrecognized option '-b' (command/topic "init").
ERROR: try "alr help init" for more information.
PS C:\Users\Chris> alr init -bin plop
ERROR: Unrecognized option '-b' (command/topic "init").
ERROR: try "alr help init" for more information.
PS C:\Users\Chris> cd .\hello_1.0.2_5715870b
PS C:\Users\Chris\hello_1.0.2_5715870b> alr init -bin plop
ERROR: Unrecognized option '-b' (command/topic "init").
ERROR: try "alr help init" for more information.
By the way I have install gprbuild so I don't know what that is about.
Chris@Lucy MINGW64 ~ $ gprbuild --version GPRBUILD 2024.0.0 (20240107) (x86_64-w64-mingw32) Copyright (C) 2004-2024, AdaCore This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Maybe do a clean install of Alr and get rid of any files it created up to this point?
The -bin
should be --bin
The ERROR: Not installed: gprbuild=22.0.0
message should have been fixed by #1533 and hints at a toolchain having been removed at some point. Running alr toolchain --select
and reselecting should fix that.
Hi @MrAda, I just tried on my setup and the download was fine.
I guess there is an issue with curl and your network, or a bad installation of MSYS2.
Can you try to run
alr exec -- curl
inside an alire crate folder? E.g.alr init -bin plop cd plop alr exec -- curl
Thanks to mosteo's acute vision!
PS C:\Users\Chris> alr init --bin plob Success: plob initialized successfully. PS C:\Users\Chris> cd plob PS C:\Users\Chris\plob> alr exec -- curl Note: Synchronizing workspace... Nothing to update. ERROR: Not installed: gprbuild=22.0.0 ERROR: alr encountered an unexpected error, re-run with -d for details. PS C:\Users\Chris\plob>
The
ERROR: Not installed: gprbuild=22.0.0
message should have been fixed by #1533 and hints at a toolchain having been removed at some point. Runningalr toolchain --select
and reselecting should fix that.
I ran it and selected gnat_native=13.2.1 and gprbuild=22.0.1
got this: Note: Selected tool version gprbuild=22.0.1 Note: Deploying gprbuild=22.0.1... File not found - C:\Users\Chris.config\alire\cache\dependencies\alr-ughk.tmp* File not found - C:\Users\Chris.config\alire\cache\dependencies\alr-ughk.tmp* ERROR: Command ["curl", "https://github.com/alire-project/GNAT-FSF-builds/releases/download/gprbuild-22.0.0-1/gprbuild-x86_64-windows64-22.0.0-1.tar.gz", "--location", "--progress-bar", "--output", "C:\Users\Chris.config\alire\cache\dependencies\alr-ughk.tmp\gprbuild-x86_64-windows64-22.0.0-1.tar.gz"] exited with code -1
Hi @MrAda , this is with alr 1.2.2
, right? I cannot reproduce with a fresh install of 1.2.2
on Windows. Would you mind trying with a pristine configuration? (E.g. exporting ALR_CONFIG
pointing to a new location.)
Yes the stable version. I don't see ALR_CONFIG in my Environment Variables window. I did notice that it started off in my C:\Users\Chris folder which is odd for me as I never develop out of there. I did do a fresh install so that didn't help. I will try again, but where can I found ALR_CONFIG?
So I did the alr toolchain --select and I let it default to what it can find and I got: Note: Selected tool version gprbuild=22.0.1 Note: Deploying gprbuild=22.0.1... File not found - C:\Users\Chris.config\alire\cache\dependencies\alr-nuaa.tmp* File not found - C:\Users\Chris.config\alire\cache\dependencies\alr-nuaa.tmp* ERROR: Command ["curl", "https://github.com/alire-project/GNAT-FSF-builds/releases/download/gprbuild-22.0.0-1/gprbuild-x86_64-windows64-22.0.0-1.tar.gz", "--location", "--progress-bar", "--output", "C:\Users\Chris.config\alire\cache\dependencies\alr-nuaa.tmp\gprbuild-x86_64-windows64-22.0.0-1.tar.gz"] exited with code -1
Ok. So I updated my Msys2 packages, which seem to help because I was able to select my toolset because I can see that the compilers I have installed in Msys. Those are what I chose. I think prefer to have the tools done with Msys and then have Alire go use them. Get things downloaded from Alire has been a problem when it comes to tool sets.
Hi @MrAda, I just tried on my setup and the download was fine.
I guess there is an issue with curl and your network, or a bad installation of MSYS2.
Can you try to run
alr exec -- curl
inside an alire crate folder? E.g. when I go into MSYS2 I did this:
$ pacman -Q | grep curl curl 8.5.0-1 libcurl 8.5.0-1
Is this the correct version that works with Alire? I see in pacman there are many curl's to choose from...
Looks like there's an issue with curl or your network.
Can you try to run this in our Msys2 shell?
curl https://github.com/alire-project/GNAT-FSF-builds/releases/download/gprbuild-22.0.0-1/gprbuild-x86_64-windows64-22.0.0-1.tar.gz --location --progress-bar --output gprbuild-x86_64-windows64-22.0.0-1.tar.gz
ALR_CONFIG
is unset by default. If you export it pointing to a new folder, the effect is similar to reinstalling alr
from scratch, as it will use that folder for configuration and downloads. So it's a way to make sure that a pristine environment exhibits the same problem.
Looks like there's an issue with curl or your network.
Can you try to run this in our Msys2 shell?
curl https://github.com/alire-project/GNAT-FSF-builds/releases/download/gprbuild-22.0.0-1/gprbuild-x86_64-windows64-22.0.0-1.tar.gz --location --progress-bar --output gprbuild-x86_64-windows64-22.0.0-1.tar.gz
$ curl https://github.com/alire-project/GNAT-FSF-builds/releases/download/gprbuild-22.0.0-1/gprbuild-x86_64-windows64-22.0.0-1.tar.gz --location --progress-bar --output gprbuild-x86_64-windows64-22.0.0-1.tar.gz curl: (60) SSL certificate problem: unable to get local issuer certificate More details here: https://curl.se/docs/sslcerts.html
curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.
ALR_CONFIG
is unset by default. If you export it pointing to a new folder, the effect is similar to reinstallingalr
from scratch, as it will use that folder for configuration and downloads. So it's a way to make sure that a pristine environment exhibits the same problem.
Since I am doing this on Windows, just go into the Environment settings and set it?
Since I am doing this on Windows, just go into the Environment settings and set it?
I think so, but since you seem to be using Power Shell, I would try first:
PS> $env:ALR_CONFIG="abs\path\to\dir"
PS> alr version
and check the paths being reported by alr
.
Note that the quotes are mandatory and the path must be absolute.
That's temporary to your shell session, though.
Also, the target config dir must exist before you run alr
.
Since I am doing this on Windows, just go into the Environment settings and set it?
I think so, but since you seem to be using Power Shell, I would try first:
PS> $env:ALR_CONFIG="abs\path\to\dir" PS> alr version
and check the paths being reported by
alr
.Note that the quotes are mandatory and the path must be absolute.
That's temporary to your shell session, though.
PS C:\Users\Chris> $env:ALR_CONFIG="c:\Users\Chris\Alire" PS C:\Users\Chris> alr version APPLICATION alr version: 1.2.2 libalire version: 1.2.2 compilation date: 2023-01-12 20:53:29 compiler version: Community 2021 (20210519-103)
CONFIGURATION config folder: c:\Users\Chris\Alire force flag: FALSE non-interactive flag: FALSE community index branch: stable-1.2.1 compatible index versions: ^1.1 & <=1.2.1 indexes folder: c:\Users\Chris\Alire\indexes indexes metadata: OK toolchain assistant: enabled tool #1 gnat: not configured tool #2 gprbuild: not configured
WORKSPACE root status: OUTSIDE root release: N/A root load error: N/A root folder: N/A current folder: C:\Users\Chris
SYSTEM distribution: DISTRO_UNKNOWN host-arch: X86_64 os: WINDOWS target: NATIVE toolchain: USER word-size: BITS_64
So there was another folder the config was pointing to but I guess deleted it. It was C:\Users\Chris.alire....
So I did an alr get hello cd hello... alr build picked my gnat and gprbuild and this what it did:
Note: Selected tool version gprbuild=22.0.1 Note: Deploying gprbuild=22.0.1... File not found - C:\Users\Chris\Alire\cache\dependencies\alr-qjnw.tmp* File not found - C:\Users\Chris\Alire\cache\dependencies\alr-qjnw.tmp* ERROR: Command ["curl", "https://github.com/alire-project/GNAT-FSF-builds/releases/download/gprbuild-22.0.0-1/gprbuild-x86_64-windows64-22.0.0-1.tar.gz", "--location", "--progress-bar", "--output", "C:\Users\Chris\Alire\cache\dependencies\alr-qjnw.tmp\gprbuild-x86_64-windows64-22.0.0-1.tar.gz"] exited with code -1
This is infuriating that nothing works well on WIndows.
$ curl https://github.com/alire-project/GNAT-FSF-builds/releases/download/gprbuild-22.0.0-1/gprbuild-x86_64-windows64-22.0.0-1.tar.gz --location --progress-bar --output gprbuild-x86_64-windows64-22.0.0-1.tar.gz curl: (60) SSL certificate problem: unable to get local issuer certificate More details here: https://curl.se/docs/sslcerts.html
OK so the issue is not with Alire here. You have to fix the problem with curl before. Maybe something with your network configuration (firewall, proxy, etc.).
When you tried in a pristine configuration, did Alire prompt to install msys2? If not, you have another msys2 in your path (Alire looks for an executable pacman
in path) and the problem may be coming from that side.
When you tried in a pristine configuration, did Alire prompt to install msys2? If not, you have another msys2 in your path (Alire looks for an executable
pacman
in path) and the problem may be coming from that side.
Actually I saw that Alire wanted to install msys2 a while back so I did it and hence I also used pacman to install any remaining things I could think of because of the curl issue I have.
$ curl https://github.com/alire-project/GNAT-FSF-builds/releases/download/gprbuild-22.0.0-1/gprbuild-x86_64-windows64-22.0.0-1.tar.gz --location --progress-bar --output gprbuild-x86_64-windows64-22.0.0-1.tar.gz curl: (60) SSL certificate problem: unable to get local issuer certificate More details here: https://curl.se/docs/sslcerts.html
OK so the issue is not with Alire here. You have to fix the problem with curl before. Maybe something with your network configuration (firewall, proxy, etc.).
I only got the SSL certification issue once. I went into MSYS and did a curl -V and it complained that the lib and curl didn't match. So installed both libcurl and curl. I ran alr toolchain --select again and got the same error messages.
I am still getting "File not found" withing the .\config\alire\cache\dependencies\alr-*.tmp folders along with the curl issue which I suspect is due to the missing folders, not curl. That is a guess at this point. If there is a clear/concise/accurate of how to get started with Alire I am interested. I feel I have been piece-mealing this too much to the point that it is a mess on my PC.
@Fabien-Chouteau So I did a search on my PC to see if I had more than one curl installed and it seems I do. One in the windows area and one in my msys area. I don't know which one Alire is trying to use but I am guessing the windows one.
so I fixed my PATH env var and it didn't make a difference.
@MrAda, I gave you partial information before. To ensure you use a pristine configuration with fresh msys2, you need to do two things (assuming PowerShell syntax):
- Export config location, e.g.
$env:ALR_CONFIG="/path/to/config"
- Change Msys2 install location:
alr config --global --set msys2.install_dir /path/to/new/msys2
But, take into account that if you have another msys2 already in your path not installed by Alire, it will be detected and Alire won't try to reinstall msys2.
@mosteo I am not a PowerShell user so I am not sure if I am doing things right. I did as you said above and I still have the file not found issues. I don't know why we just don't use msys2's bash shell instead of powershell.
@mosteo I am not a PowerShell user so I am not sure if I am doing things right. I did as you said above and I still have the file not found issues. I don't know why we just don't use msys2's bash shell instead of powershell.
I talked about PowerShell (PS) because the Alire Windows installer sets up a menu entry that launches a PS command window with Alire in its path, and I thought that would be your situation. Also, the first log you pasted shows the PS prompt, which made think that you were using it:
PS C:\Users\Chris> alr get gtkada
If you're using a msys2 bash shell, then I suspect that that shell comes from a different msys2 installation, and launching Alire inside it for sure will detect it in the path and use it, so tweaking Alire will not help if the trouble is with the enclosing msys2 installation.
In other words, to isolate the trouble and discard possible culprits, Alire should be run from a shell that has no pacman.exe
in its path.
You can run alr from an msys2 shell, but be sure to the mingw64.exe shell.
I appreciate the help. I used PS because that is that the installation required me to use. I never intentionally wanted to use it. To address @Fabien-Chouteau 's comment, alr is not seen from my MINGW64 shell. But then again according to @mosteo 's comment, pacman is visible. So I feel I have gone in a circle.ls -
@MrAda, I gave you partial information before. To ensure you use a pristine configuration with fresh msys2, you need to do two things (assuming PowerShell syntax):
* Export config location, e.g. `$env:ALR_CONFIG="/path/to/config"` * Change Msys2 install location: `alr config --global --set msys2.install_dir /path/to/new/msys2`
But, take into account that if you have another msys2 already in your path not installed by Alire, it will be detected and Alire won't try to reinstall msys2.
I retried the 2 commands above in my PS shell and this time it worked. So hello seems to be working. I guess the next thing to do is create a new crate and see if I can build/run another app to make sure the changes took.
Well I am able to get through doing the myproj example and follow along with the documentation online. I guess the two commands above are the key. I am wondering why the documentation just didn't say that up front. Wasted a lot of time trying to get this to work. My goal is to integrate alire, etc into a project at work since community versions no long will be created. If I cannot make it work then we won't be updating.