Executables with shared libraries fail to run with err "no such file or directory"

A few questions / observations:

Example 1

With go run, the files are copied to a temporary location, so that’s not weird. Printing the executable path for catsay-go shows the following:

$ go run Catsay.go
/tmp/go-build596412124/b001/exe
 Usage: catsay <Phrase> <Color (1 to 8)>
 Colors:  1  2  3  4  5  6  7  8 
Catsay.go
import (
	"fmt"
	"os"
	"path/filepath"
)

func main() {
	// print current path
	ex, err := os.Executable()
	if err != nil {
		panic(err)
	}
	exPath := filepath.Dir(ex)
	fmt.Println(exPath)
    ...

Could this be an issue with the project? Does it build normally?

Example 2

Mason won’t work normally with Nix, so you need to either install the tools you need in your system or add them to neovim:

Cannot install gopls using mason.nvim - #2 by eljamm

However, don’t forget to remove the tools that have already been downloaded by going to the Mason menu, hovering over them, then pressing X. running :MasonUninstallAll

If you want to share your config between NixOS and other distros, you can do something like this:

NeoVim cannot start lsp because clangd is not found - #4 by eljamm

So in NixOS, nvim will use the system/home-manager tools while in other distros, Mason will install the binaries as usual.

Example 3

This works on my machine. What happens when you delete target/ and run cargo run again?