Attempting to link `LibFido2Swift` to `xcodes` by hi2gage · Pull Request #387 · XcodesOrg/xcodes

Do not merge

I'm looking for some help linking LibFido2Swift to the xcodes executableTarget.

The project builds, it will run as expected if running within Xcode.

Screenshot 2024-10-18 at 12 58 51 PM

but as soon as I go to run that exact same build from the command line
/Users/gage/Library/Developer/Xcode/DerivedData/xcodes-eftbhwhateverlfqcanhgofyytinnj/Build/Products/Debug/xcodes list

I get this error

dyld[86238]: Library not loaded: @rpath/libcrypto.3.dylib
  Referenced from: <BBAB7C02-49D7-3938-BC1C-CB4BF14387FB> /Users/gage/Library/Developer/Xcode/DerivedData/xcodes-eftbhsfbyqplfqcanhgofyytinnj/Build/Products/Debug/xcodes
  Reason: tried: '/Users/gage/Library/Developer/Xcode/DerivedData/xcodes-eftbhsfbyqplfqcanhgofyytinnj/Build/Products/Debug/PackageFrameworks/libcrypto.3.dylib' (no such file),
'/System/Volumes/Preboot/Cryptexes/OS/Users/gage/Library/Developer/Xcode/DerivedData/xcodes-eftbhsfbyqplfqcanhgofyytinnj/Build/Products/Debug/PackageFrameworks/libcrypto.3.dylib' (no such file),
 '/Users/gage/Library/Developer/Xcode/DerivedData/xcodes-eftbhsfbyqplfqcanhgofyytinnj/Build/Products/lib/libcrypto.3.dylib' (no such file),
 '/Users/gage/Library/Developer/Xcode/DerivedData/xcodes-eftbhsfbyqplfqcanhgofyytinnj/Build/Products/Debug/PackageFrameworks/libcrypto.3.dylib' (no such file),
 '/System/Volumes/Preboot/Cryptexes/OS/Users/gage/Library/Developer/Xcode/DerivedData/xcodes-eftbhsfbyqplfqcanhgofyytinnj/Build/Products/Debug/PackageFrameworks/libcrypto.3.dylib' (no such file),
 '/Users/gage/Library/Developer/Xcode/DerivedData/xcodes-eftbhsfbyqplfqcanhgofyytinnj/Build/Products/lib/libcrypto.3.dylib' (no such file)
[1]    86238 abort

At first I thought it was an issue with LibFido2Swift not linking libcrypto but I tried adding

linkerSettings: [
    .linkedFramework("LibCbor"),
    .linkedFramework("LibCrypto"),
    .linkedFramework("libfido2"),
]

but that did not work either.

I then tried to just copy the content LibFido2Swift into this project then create a "local" LibFido2Swift module internally and that didn't work either.

I'm wondering if I'm missing something about the linking binaryTargets to a executable product.

@kinoroy or @MattKiazyk if could take a look at this branch see if I'm missing anything that would be awesome!