Skip to content

Commit 1472a8e

Browse files
committed
fix: drill down in aliases to change core alias
1 parent 1181804 commit 1472a8e

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

nix/ext/pg_cron.nix

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,31 @@ stdenv.mkDerivation {
115115
116116
VERSION=$1
117117
NIX_PROFILE="/var/lib/postgresql/.nix-profile"
118-
LIB_DIR="$out/lib"
118+
119+
# Follow the complete chain of symlinks to find the multi-version directory
120+
CURRENT_LINK="$NIX_PROFILE/lib/pg_cron-$VERSION.so"
121+
echo "Starting with link: $CURRENT_LINK"
122+
123+
while [ -L "$CURRENT_LINK" ]; do
124+
NEXT_LINK=$(readlink "$CURRENT_LINK")
125+
echo "Following link: $NEXT_LINK"
126+
if echo "$NEXT_LINK" | grep -q '^/'; then
127+
CURRENT_LINK="$NEXT_LINK"
128+
else
129+
CURRENT_LINK="$(dirname "$CURRENT_LINK")/$NEXT_LINK"
130+
fi
131+
echo "Current link is now: $CURRENT_LINK"
132+
done
133+
134+
# The final link should be in the multi-version directory
135+
MULTI_VERSION_DIR=$(dirname "$CURRENT_LINK")
136+
echo "Found multi-version directory: $MULTI_VERSION_DIR"
137+
LIB_DIR="$MULTI_VERSION_DIR"
119138
EXTENSION_DIR="$NIX_PROFILE/share/postgresql/extension"
120139
140+
echo "Looking for file: $LIB_DIR/pg_cron-$VERSION${postgresql.dlSuffix}"
141+
ls -la "$LIB_DIR" || true
142+
121143
# Check if version exists
122144
if [ ! -f "$LIB_DIR/pg_cron-$VERSION${postgresql.dlSuffix}" ]; then
123145
echo "Error: Version $VERSION not found"

0 commit comments

Comments
 (0)