Symbolic links to source files and finding relative files?

From the GitHub ticket its seems that the OP is invoking main.pl
with she bang (#!) and not manually with command line option of
swipl. For example from JavaScript I know that import.meta.url and

process.argv[1] have different values. Usually import.meta.url
shows the real path, and process.argv[1] shows the command
line input. So yes, there are programming languages which

compute real paths for their modules, demonstrably for scripts passed
via she bang (#!). JavaScript is among them, here an example, using the
Windows command line, the command line that a she bang (#!) generates:

/* nodeJS called with a file symbolic link */
>node.exe <dir>\foo\jsdog.mjs

And this is what one can observe inside the .mjs file:

process.argv[1]=<dir>\foo\jsdog.mjs
import.meta.url=<dir2>\player\drawer\index.mjs

Edit 14.10.2023
Please be patient, managed only to investigate JavaScript. For Python
one has for example to check what is the custom for __file__, is it a
real path or not? One could then figure out whether there are more

programming languages that compute a real path for their modules,
especially in the she bang (#!) launch phase.