LucianoPAlmeida / variable-injector

Continuous Integration Tool for Swift Projects
MIT License
100 stars 20 forks source link

lib_InternalSwiftSyntaxParser file not found - Bitrise Xcode 14.0.1 - Version 0.3.7 #28

Closed qobuz-mobiletool closed 2 years ago

qobuz-mobiletool commented 2 years ago

Hello, hope you're doing okay, we recently encountered a problem with your library, HELP and thanks in advance

dyld[3880]: Library not loaded: '@rpath/lib_InternalSwiftSyntaxParser.dylib' Referenced from: '/usr/local/bin/variable-injector' Reason: tried: '/usr/lib/swift/lib_InternalSwiftSyntaxParser.dylib' (no such file), '/usr/local/bin/lib_InternalSwiftSyntaxParser.dylib' (no such file), '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.5/macosx/lib_InternalSwiftSyntaxParser.dylib' (no such file), '/usr/lib/swift/lib_InternalSwiftSyntaxParser.dylib' (no such file), '/usr/local/bin/lib_InternalSwiftSyntaxParser.dylib' (no such file), '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.5/macosx/lib_InternalSwiftSyntaxParser.dylib' (no such file), '/usr/local/lib/lib_InternalSwiftSyntaxParser.dylib' (no such file), '/usr/lib/lib_InternalSwiftSyntaxParser.dylib' (no such file) /var/folders/9l/1ysg9vq51p37q0lgksxhdb9r0000gn/T/bitrise2901359628/step_src/step.sh: line 24: 3880 Abort trap: 6 variable-injector --file ${files} $VERBOSE --ignore ${vars_to_ignore}

LucianoPAlmeida commented 2 years ago

Hey I can take a look in more detail later, but out of those logs it looks weird for it to have "5.5" on log paths. Do you know where that may be coming from?

Ghassen-Ferchichi commented 2 years ago

Hello Lucian, It was me who posted this issue, I'm sorry but unfortunately I have no idea where it comes from, if I can help you in any other way please do not hesitate. Looking forward for your reply.

marcelojunior7 commented 2 years ago

Hello, same problem here. GitHub Actions added the SwiftFormat tool to new mac 12 runner image, I think this is causing this problem in GitHub Actions cases. 🤔

Using 0.3.6 on ci logs this:

Error: The loaded '_InternalSwiftSyntaxParser' library is from a toolchain that is not compatible with this version of SwiftSyntax

Using 0.3.7 on ci logs same error of the @Ghassen-Ferchichi

LucianoPAlmeida commented 2 years ago

Have any of you today tried since today? The announcements https://github.com/actions/runner-images/releases/tag/macOS-12%2F20220929.2 said that the default Xcode would changed to 14 yesterday, so if you were running with the default that is likely to be an issue. Can anyone confirm?

Ghassen-Ferchichi commented 2 years ago

Hello Luciano, I did multiple testing with Bitrise today following your reply, and still no success, here is a list of my test results:

Xcode 14.0.1, on macOS 12.5 (Monterey) - Variable-Injector version 0.3.5

Error: The loaded '_InternalSwiftSyntaxParser' library is from a toolchain that is not compatible with this version of SwiftSyntax

Xcode 14.0.1, on macOS 12.5 (Monterey) - Variable-Injector version 0.3.6

Error: The loaded '_InternalSwiftSyntaxParser' library is from a toolchain that is not compatible with this version of SwiftSyntax

Xcode 14.0.1, on macOS 12.5 (Monterey) - Variable-Injector version 0.3.7

~/git dyld[3447]: Library not loaded: '@rpath/lib_InternalSwiftSyntaxParser.dylib' Referenced from: '/usr/local/bin/variable-injector' Reason: tried: '/usr/lib/swift/lib_InternalSwiftSyntaxParser.dylib' (no such file), '/usr/local/bin/lib_InternalSwiftSyntaxParser.dylib' (no such file), '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.5/macosx/lib_InternalSwiftSyntaxParser.dylib' (no such file), '/usr/lib/swift/lib_InternalSwiftSyntaxParser.dylib' (no such file), '/usr/local/bin/lib_InternalSwiftSyntaxParser.dylib' (no such file), '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.5/macosx/lib_InternalSwiftSyntaxParser.dylib' (no such file), '/usr/local/lib/lib_InternalSwiftSyntaxParser.dylib' (no such file), '/usr/lib/lib_InternalSwiftSyntaxParser.dylib' (no such file) /var/folders/9l/1ysg9vq51p37q0lgksxhdb9r0000gn/T/bitrise4012409838/step_src/step.sh: line 24: 3447 Abort trap: 6 variable-injector --file ${files} $VERBOSE --ignore ${vars_to_ignore}

Xcode 13.4, on macOS 12.4 (Monterey) - Variable-Injector version 0.3.6

No problem

Xcode 13.4, on macOS 12.4 (Monterey) - Variable-Injector version 0.3.7

dyld[3181]: Library not loaded: @rpath/lib_InternalSwiftSyntaxParser.dylib Referenced from: /usr/local/bin/variable-injector Reason: tried: '/usr/lib/swift/lib_InternalSwiftSyntaxParser.dylib' (no such file), '/usr/local/bin/lib_InternalSwiftSyntaxParser.dylib' (no such file), '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.5/macosx/lib_InternalSwiftSyntaxParser.dylib' (no such file), '/usr/lib/swift/lib_InternalSwiftSyntaxParser.dylib' (no such file), '/usr/local/bin/lib_InternalSwiftSyntaxParser.dylib' (no such file), '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.5/macosx/lib_InternalSwiftSyntaxParser.dylib' (no such file), '/usr/local/lib/lib_InternalSwiftSyntaxParser.dylib' (no such file), '/usr/lib/lib_InternalSwiftSyntaxParser.dylib' (no such file) /var/folders/11/nh0v1jld7zd7b9zqm1774gtm0000gn/T/bitrise3117147685/step_src/step.sh: line 24: 3181 Abort trap: 6 variable-injector --file ${files} $VERBOSE --ignore ${vars_to_ignore}

So, these were all the test cases with different xcode versions and your lib version, our goal is to start using Xcode 14 in our CI, we are delaying until this problem is fixed. Thanks in advance

marcelojunior7 commented 2 years ago

Our cases in Github Actions:

1: Variable Injector: 0.3.5 Image: macos-11 (version: 20220925.1) XCode: 13.2.1 (13C100)

Success ✅

2: Variable Injector: 0.3.6 Image: macos-12 (version: 20220929.2) XCode: 13.4.1 (13F100)

Error ❌

Error: The loaded '_InternalSwiftSyntaxParser' library is from a toolchain that is not compatible with this version of SwiftSyntax

3: Variable Injector: 0.3.7 Image: macos-12 (version: 20220929.2) XCode: 13.4.1 or 14.0.1

Error ❌

dyld[3181]: Library not loaded: @rpath/lib_InternalSwiftSyntaxParser.dylib
Referenced from: /usr/local/bin/variable-injector
Reason: tried: '/usr/lib/swift/lib_InternalSwiftSyntaxParser.dylib' (no such file), '/usr/local/bin/lib_InternalSwiftSyntaxParser.dylib' (no such file), '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.5/macosx/lib_InternalSwiftSyntaxParser.dylib' (no such file), '/usr/lib/swift/lib_InternalSwiftSyntaxParser.dylib' (no such file), '/usr/local/bin/lib_InternalSwiftSyntaxParser.dylib' (no such file), '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.5/macosx/lib_InternalSwiftSyntaxParser.dylib' (no such file), '/usr/local/lib/lib_InternalSwiftSyntaxParser.dylib' (no such file), '/usr/lib/lib_InternalSwiftSyntaxParser.dylib' (no such file)
/var/folders/11/nh0v1jld7zd7b9zqm1774gtm0000gn/T/bitrise3117147685/step_src/step.sh: line 24: 3181 Abort trap: 6 variable-injector --file {vars_to_ignore}

However, we would like to use 13.4 at least, it is worth saying that before this image update by GH Actions, case 2 was ok too (20220917.1).

LucianoPAlmeida commented 2 years ago

Thank you for the details! I have a hint on what is the issue and how to fix it, will give it a shot as soon as possible(probably the weekend)

Ghassen-Ferchichi commented 2 years ago

Fingers crossed, good luck and thank you

LucianoPAlmeida commented 2 years ago

@marcelojunior7 Are you using it on github actions not on bitrise? If that is the case how are you invoking the tool?

marcelojunior7 commented 2 years ago

@marcelojunior7 Are you using it on github actions not on bitrise? If that is the case how are you invoking the tool?

Hello @LucianoPAlmeida , we are using on Github Actions

We are using it this way:

generate_environment_keys.sh

# Installing 
CURRENT_DIR="$PWD"
cd /tmp
curl -OL https://github.com/LucianoPAlmeida/variable-injector/releases/download/0.3.6/x86_64-apple-macosx.zip
unzip x86_64-apple-macosx.zip
cp -f ./x86_64-apple-macosx/release/variable-injector /usr/local/bin/variable-injector
rm ./x86_64-apple-macosx.zip
rm -rf ./x86_64-apple-macosx
rm -rf ./__MACOSX/
cd "$CURRENT_DIR"

#Running 
variable-injector --file $(pwd)/SecretsManager/CIKeys.swift

On Github Actions step

- name: Variable injector environment keys into project
      run: |
         chmod +x ./scripts/generate_environment_keys.sh
         ./scripts/generate_environment_keys.sh
      shell: bash

Tks

LucianoPAlmeida commented 2 years ago

Awesome, this may be easier to fix in your case then. I'm on my phone now but after work I'll send a updated script that you can try and see if that fixes it :)

LucianoPAlmeida commented 2 years ago

@marcelojunior7 Are you using it on github actions not on bitrise? If that is the case how are you invoking the tool?

Hello @LucianoPAlmeida , we are using on Github Actions

We are using it this way:

generate_environment_keys.sh

# Installing 
CURRENT_DIR="$PWD"
cd /tmp
curl -OL https://github.com/LucianoPAlmeida/variable-injector/releases/download/0.3.6/x86_64-apple-macosx.zip
unzip x86_64-apple-macosx.zip
cp -f ./x86_64-apple-macosx/release/variable-injector /usr/local/bin/variable-injector
rm ./x86_64-apple-macosx.zip
rm -rf ./x86_64-apple-macosx
rm -rf ./__MACOSX/
cd "$CURRENT_DIR"

#Running 
variable-injector --file $(pwd)/SecretsManager/CIKeys.swift

On Github Actions step

- name: Variable injector environment keys into project
      run: |
         chmod +x ./scripts/generate_environment_keys.sh
         ./scripts/generate_environment_keys.sh
      shell: bash

Tks

Ok so right after unzip x86_64-apple-macosx.zip

Could you also add this to the script

if [[ -e ./x86_64-apple-macosx/release/lib_InternalSwiftSyntaxParser.dylib ]]; then
    cp -f ./x86_64-apple-macosx/release/lib_InternalSwiftSyntaxParser.dylib /usr/local/bin/lib_InternalSwiftSyntaxParser.dylib
fi;

This should work

LucianoPAlmeida commented 2 years ago

For people using bitwise step it may be a little bit more complicated, changes are already made into the code but to publish a new step we have to go through a process.

Ghassen-Ferchichi commented 2 years ago

Good news, thank you for your hard work, can't wait

marcelojunior7 commented 2 years ago

@marcelojunior7 Are you using it on github actions not on bitrise? If that is the case how are you invoking the tool?

Hello @LucianoPAlmeida , we are using on Github Actions We are using it this way: generate_environment_keys.sh

# Installing 
CURRENT_DIR="$PWD"
cd /tmp
curl -OL https://github.com/LucianoPAlmeida/variable-injector/releases/download/0.3.6/x86_64-apple-macosx.zip
unzip x86_64-apple-macosx.zip
cp -f ./x86_64-apple-macosx/release/variable-injector /usr/local/bin/variable-injector
rm ./x86_64-apple-macosx.zip
rm -rf ./x86_64-apple-macosx
rm -rf ./__MACOSX/
cd "$CURRENT_DIR"

#Running 
variable-injector --file $(pwd)/SecretsManager/CIKeys.swift

On Github Actions step

- name: Variable injector environment keys into project
      run: |
         chmod +x ./scripts/generate_environment_keys.sh
         ./scripts/generate_environment_keys.sh
      shell: bash

Tks

Ok so right after unzip x86_64-apple-macosx.zip

Could you also add this to the script

if [[ -e ./x86_64-apple-macosx/release/lib_InternalSwiftSyntaxParser.dylib ]]; then
    cp -f ./x86_64-apple-macosx/release/lib_InternalSwiftSyntaxParser.dylib /usr/local/bin/lib_InternalSwiftSyntaxParser.dylib
fi;

This should work

Solved ✅

Thank you @LucianoPAlmeida

LucianoPAlmeida commented 2 years ago

Solved ✅

Thank you @LucianoPAlmeida

Awesome!

hatched-krzysztof commented 2 years ago

For people using bitwise step it may be a little bit more complicated, changes are already made into the code but to publish a new step we have to go through a process.

@LucianoPAlmeida Do you know when fix will be available for Bitrise step?

LucianoPAlmeida commented 2 years ago

We have to go through the process to update a step in bitrise. I'll give a try tomorrow or in the weekend

LucianoPAlmeida commented 2 years ago

For people using bitwise step it may be a little bit more complicated, changes are already made into the code but to publish a new step we have to go through a process.

@LucianoPAlmeida Do you know when fix will be available for Bitrise step?

Ok now we just have to wait for 0.1.2 land, for reference: https://github.com/bitrise-io/bitrise-steplib/pull/3635

LucianoPAlmeida commented 2 years ago

0.1.2 is in, so you can update to that version of step

hatched-krzysztof commented 2 years ago

0.1.2 is in, so you can update to that version of step

Thank you very much

Ghassen-Ferchichi commented 2 years ago

Thank you very much, it works ✅ !