Anyone familiar enough with Alire to help provide some steps to manually install a toolchain for Alire by hand. I was looking to get it running on my work computer. I finally got it approved through our IT process, but Alire fails to install any toolchains. I initially thought it was a permissions issue, so I installed Alire to a local folder and changed the settings so that the cache folder was made locally to that folder as well (instead of in AppData).
It still failed to install the toolchain, so it probably uses a temp directory somewhere I cannot control. So my next thought was to just manually install GCC. I took a look at the alire index to see where it got the toolchains from, but when I inspected the ZIP files linked there, they didn’t contain everything that my home computer’s alire toolchains had, so I think Alire generates some extra stuff when installing the toolchain.
Any direction on where to get the additional files needed to hand install the toolchains? Or any instructions that could help?
Fetch corresponding archive from GitHub release. Take, for instance, gnat-x86_64-windows64-14.2.0-1.tar.gz and gprbuild-x86_64-windows64-22.0.0-1.tar.gz
unzip it some where and add bin folders to the PATH. On Linux/Mac OS X Alire 2.0.2 unpack it to ~/.local/share/alire/toolchains. I don’t remember the Windows case.
If you have bin folders of the gnat you can configure alire with alr toolchain --select and choose “external” toolchain.
My main problem was I couldn’t install indexed compilers (assuming this means the ones in the cache/toolchains folder?) via Alire (it fails with an exception thrown, but only on my work computer, so probably a security setting, verified it wasn’t a permissions issue at least as it failed in a folder I had complete permissions on), so I was trying to manually create the indexed myself but manaully downloading, unzipping, and then putting in the ancillary files myself but I didn’t know how to do that myself. I was kinda hoping I could find the templates for the extra files generated for those installations so I could do them myself (since I cannot get alire to complete the process).
For example, on the successful install of GCC 14 on my home computer, alire takes the zipped files from github, unpacks the, then adds an alire.toml and an alire folder (which are not present in the zipped versions of the compiler files). I was looking for more info on how to get those files and the rules behind them so I can manually create them on my work computer in addition to any other changes I need to make for alire to “think” it installed those. I think Max’s last post has some of that in it (thanks!)
I’ll definitely look into what you and Max mentioned about external compiler setup. Thanks for the tips!
The error might be related to a temporary location rather than the final destination, so you could take a look at the logic on temporary folders in Alire.Platforms.Folders. If you can provide the error message I can try to help.
About the details of these files/folders: if you can do an install on another computer, I presume you can simply copy the manifest and alire folder. Recreating them by hand is probably going to be too fragile.
I would still try first to just download the compiler manually or with alr get, put it in path, and configure Alire to use the external compiler.
Yep, my initial plan was to copy those over. It’s a bit difficult because of the IT situation here, but it’s definitely my fall back option. My hope was I could find the templates alire used for those so I could set myself up a small program to generate them on this side and save me from the transfer process here at work.
I asked back on gitter back in August about it, but I traced the exception to the function Deploy_Steps. It raises an exception with the message: “ERROR: Deployment of <stuff>”
The is just my abbreviation of all the folder paths and stuff, cause copy/paste between work and home computer is tough. It was a case statement based on OS and referenced a tar.gz file deployment to my local directory (I moved the cache folder to my local director incase there were permission issues with AppData and subfolders).
Full message:
preformatted text copy if that is easier to deal with:
Note: Deploying gprbuild=22.0.1...
################################################################################################################# 100.0%
ERROR: Deployment of (case OS is Linux => (case Host_Arch is X86_64 => binary archive gprbuild-x86_64-linux-22.0.0-1.tar.gz at https://github.com/alire-project/GNAT-FSF-builds/releases/download/gprbuild-22.0.0-1/gprbuild-x86_64-linux-22.0.0-1.tar.gz), Macos => (case Host_Arch is X86_64 => binary archive gprbuild-x86_64-darwin-22.0.0-1.tar.gz at https://github.com/alire-project/GNAT-FSF-builds/releases/download/gprbuild-22.0.0-1/gprbuild-x86_64-darwin-22.0.0-1.tar.gz), Windows => (case Host_Arch is X86_64 => binary archive gprbuild-x86_64-windows64-22.0.0-1.tar.gz at 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)) with hash sha256:c842bbc58b28ad0f1c1f7ba147d59e2c9fc4b8f74355ac734831bc779159b47e to D:\Program_Files\alire\cache\toolchains\gprbuild_22.0.1_c842bbc5 failed
Note that I got the same failure when my cache was in AppData (just a different path in the error).
My Initial guess is that we have some sort of security rule that impedes some methods of unzipping. I can manually unzip files, but even Cargo from rust failed due to being unable to unpack their zip files.
About templates, there’s no such thing at present in Alire, the alire.toml file is regenerated from the data read from the index. Typically, it will contain the same information present in you local index manifest, except for the origin, which is either omitted or resolved to the current platform (for binary crates).
Yep unfortunately, I always have to crawl with the tools they give me at work. Ok thanks! I’ll see if I can make my own templates for it then and maybe an external program to manage it. Thanks!!