Skip to content

Commit

Permalink
Force creation of missing soft link
Browse files Browse the repository at this point in the history
  • Loading branch information
mosteo committed Mar 18, 2024
1 parent 2b663e8 commit 1c95a02
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
14 changes: 14 additions & 0 deletions .github/workflows/ci-toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,20 @@ jobs:
with:
crates: gnat_native^${{matrix.gcc_version}} gprbuild

# Superstrange occurrence in which a softlink is missing at the installed
# destination. The link is there when using `alr get`, and also when using
# `alr install` in my machines. Being a softlink the one missing, it could
# have something with the order in which files are enumerated and GNATCOLL
# implementation. Will have to dig further but this should be a temporary
# fix.
- name: GNAT 10 fix
if: runner.os == 'Linux' && matrix.gcc_version == 10
run: |
PREFIX=/home/runner/work/alire/alire/alire_prefix/libexec/gcc/x86_64-pc-linux-gnu/10.3.0
ln -sf \
$PREFIX/liblto_plugin.so.0.0.0 \
$PREFIX/liblto_plugin.so
- name: Build alr with default toolchain
shell: bash
run: dev/build.sh
Expand Down
4 changes: 3 additions & 1 deletion src/alire/alire-directories.adb
Original file line number Diff line number Diff line change
Expand Up @@ -865,12 +865,14 @@ package body Alire.Directories is
OK : Boolean := False;
begin
if VF.Is_Symbolic_Link then
Trace.Debug (" Merge (softlink): " & Src);

if Remove_From_Source then
VF.Rename (VFS.New_Virtual_File (Dst), OK);
else
VF.Copy (VFS.Filesystem_String (Dst), OK);
end if;
if not OK then
if not OK or else not GNAT.OS_Lib.Is_Symbolic_Link (Dst) then
Raise_Checked_Error ("Failed to copy/move softlink: "
& TTY.URL (Src));
end if;
Expand Down

0 comments on commit 1c95a02

Please sign in to comment.