From edbfa99a485a292029802c56b2335151687adc09 Mon Sep 17 00:00:00 2001 From: Robert Debug Date: Fri, 7 May 2021 10:11:36 +0200 Subject: [PATCH 01/18] build example --- .github/workflows/ci.yml | 147 ++++++++++++++---- .../ios/Flutter/AppFrameworkInfo.plist | 2 +- bindings/dart/example/ios/Podfile.lock | 28 ++++ .../ios/Runner.xcodeproj/project.pbxproj | 90 ++++++++++- .../contents.xcworkspacedata | 3 + 5 files changed, 238 insertions(+), 32 deletions(-) create mode 100644 bindings/dart/example/ios/Podfile.lock diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 11ff53d46..488b750ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -387,6 +387,19 @@ jobs: working-directory: ./xayn-ai-ffi-c run: cargo lipo --targets ${{ matrix.target }} + - name: Prepare lib for upload + run: | + dir=target/${{ matrix.target}}/debug + mv $dir/libxayn_ai_ffi_c.a $dir/libxayn_ai_ffi_c_${{ matrix.target }}.a + + - name: Upload library artifacts + uses: actions/upload-artifact@v2 + with: + name: build-ios-${{ matrix.target }}-${{ hashFiles('target/*-apple-ios/debug/libxayn_ai_ffi_c_*-apple-ios.a') }} + retention-days: 1 + if-no-files-found: error + path: target/${{ matrix.target}}/debug/libxayn_ai_ffi_c_${{ matrix.target }}.a + test-wasm-lib: name: test-wasm-lib needs: [registry-cache, test] @@ -431,8 +444,8 @@ jobs: RUSTFLAGS: ${{ env.OPT_TESTS_RUSTFLAGS }} run: wasm-pack test --firefox --chrome --headless - build-xain-ai-lib: - name: build-xain-ai-lib + build-linux-lib: + name: build-linux-lib needs: [registry-cache, test] runs-on: ubuntu-20.04 outputs: @@ -459,28 +472,31 @@ jobs: ~/.cargo/git key: ${{ needs.registry-cache.outputs.cache-key }} - - name: Cache build artifacts - uses: actions/cache@v2 + - name: Restore build artifacts + uses: actions/cache@v2.1.4 with: path: ${{ github.workspace }}/target - key: ${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.rustc }}-build-xain-ai-lib-${{ needs.registry-cache.outputs.cache-date }}-${{ hashFiles('**/Cargo.lock') }} - restore-keys: ${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.rustc }}-build-xain-ai-lib-${{ needs.registry-cache.outputs.cache-date }}- + key: ${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.rustc }}-build-linux-${{ needs.registry-cache.outputs.cache-date }}-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.rustc }}-build-linux-${{ needs.registry-cache.outputs.cache-date }}- - - name: Build xayn-ai-ffi-c lib + - name: Build linux lib run: cargo build - - name: Generate lib cache key + - name: Generate lib artifacts key id: cache-key shell: bash - run: echo "::set-output name=key::$(echo libxayn_ai_ffi_c-${{ hashFiles('target/debug/libxayn_ai_ffi_c.so', 'xayn-ai-ffi-c/ffi.h') }})" + run: echo "::set-output name=key::$(echo build-x86_64-unknown-linux-gnu-${{ hashFiles('target/debug/libxayn_ai_ffi_c.so', 'xayn-ai-ffi-c/ffi.h') }})" - - name: Cache library artifacts - uses: actions/cache@v2 + - name: Upload library artifacts + uses: actions/upload-artifact@v2 with: + name: ${{ steps.cache-key.outputs.key }} + retention-days: 1 + if-no-files-found: error path: | ${{ github.workspace }}/target/debug/libxayn_ai_ffi_c.so ${{ github.workspace }}/xayn-ai-ffi-c/ffi.h - key: ${{ steps.cache-key.outputs.key }} + ${{ env.DART_WORKSPACE }}/ios/Classes/XaynAiFfiDartPlugin.h flutter-format: name: flutter-format @@ -514,7 +530,7 @@ jobs: flutter-analyze: name: flutter-analyze - needs: build-xain-ai-lib + needs: build-linux-lib runs-on: ubuntu-20.04 timeout-minutes: 10 steps: @@ -541,13 +557,17 @@ jobs: with: flutter-version: ${{ env.FLUTTER_VERSION }} - - name: Restore ${{ needs.build-xain-ai-lib.outputs.cache-key }} cache - uses: actions/cache@v2.1.4 + - name: Download ${{ needs.build-linux-lib.outputs.cache-key }} artifacts + uses: actions/download-artifact@v2 with: - path: | - ${{ github.workspace }}/target/debug/libxayn_ai_ffi_c.so - ${{ github.workspace }}/xayn-ai-ffi-c/ffi.h - key: ${{ needs.build-xain-ai-lib.outputs.cache-key }} + name: ${{ needs.build-linux-lib.outputs.cache-key }} + path: ${{ runner.temp }}/${{ needs.build-linux-lib.outputs.cache-key }} + + - name: Move C-header and linux lib + working-directory: ${{ runner.temp }}/${{ needs.build-linux-lib.outputs.cache-key }} + run: | + mv xayn-ai-ffi-c/ffi.h ${{ github.workspace }}/xayn-ai-ffi-c/ffi.h + cp -r target ${{ github.workspace }} - name: Download data run: sh download_data.sh @@ -566,7 +586,7 @@ jobs: flutter-test: name: flutter-test - needs: build-xain-ai-lib + needs: build-linux-lib runs-on: ubuntu-20.04 timeout-minutes: 10 steps: @@ -592,13 +612,17 @@ jobs: with: flutter-version: ${{ env.FLUTTER_VERSION }} - - name: Restore ${{ needs.build-xain-ai-lib.outputs.cache-key }} cache - uses: actions/cache@v2.1.4 + - name: Download ${{ needs.build-linux-lib.outputs.cache-key }} artifacts + uses: actions/download-artifact@v2 with: - path: | - ${{ github.workspace }}/target/debug/libxayn_ai_ffi_c.so - ${{ github.workspace }}/xayn-ai-ffi-c/ffi.h - key: ${{ needs.build-xain-ai-lib.outputs.cache-key }} + name: ${{ needs.build-linux-lib.outputs.cache-key }} + path: ${{ runner.temp }}/${{ needs.build-linux-lib.outputs.cache-key }} + + - name: Move C-header and linux lib + working-directory: ${{ runner.temp }}/${{ needs.build-linux-lib.outputs.cache-key }} + run: | + mv xayn-ai-ffi-c/ffi.h ${{ github.workspace }}/xayn-ai-ffi-c/ffi.h + cp -r target ${{ github.workspace }} - name: Install flutter dependencies working-directory: ${{ env.DART_WORKSPACE }} @@ -614,3 +638,74 @@ jobs: - name: Run flutter tests working-directory: ${{ env.DART_WORKSPACE }} run: flutter test + + flutter-build-example: + name: flutter-build-example + needs: [build-linux-lib, build-ios-libs] + runs-on: ${{ matrix.os }} + timeout-minutes: 20 + strategy: + fail-fast: false + matrix: + os: [ubuntu-20.04, macos-10.15] + include: + - os: ubuntu-20.04 + cmd: flutter build apk --debug --split-per-abi + - os: macos-10.15 + cmd: flutter build ios --debug --no-codesign + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Setup java ${{ env.JAVA_VERSION }} + uses: actions/setup-java@v1 + with: + java-version: ${{ env.JAVA_VERSION }} + + - name: Install libclang-10-dev + if: matrix.os == 'ubuntu-20.04' + run: sudo apt-get install libclang-10-dev + + - name: Download ${{ needs.build-linux-lib.outputs.cache-key }} artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ needs.build-linux-lib.outputs.cache-key }} + path: ${{ runner.temp }}/${{ needs.build-linux-lib.outputs.cache-key }} + + - name: Move C-header + working-directory: ${{ runner.temp }}/${{ needs.build-linux-lib.outputs.cache-key }} + run: mv xayn-ai-ffi-c/ffi.h ${{ github.workspace }}/xayn-ai-ffi-c/ffi.h + + - name: Download all artifacts + # https://github.com/actions/download-artifact/issues/6 + if: matrix.os == 'macos-10.15' + uses: actions/download-artifact@v2 + with: + path: ${{ runner.temp }}/all-artifacts/ + + - name: Move iOS libs + if: matrix.os == 'macos-10.15' + working-directory: ${{ runner.temp }}/all-artifacts/ + run: | + find build-x86_64-unknown-linux-gnu-*/bindings/dart/ios/Classes/XaynAiFfiDartPlugin.h -exec cp \{\} ${{ env.DART_WORKSPACE }}/ios/Classes/XaynAiFfiDartPlugin.h \; + find build-ios-*/ -iname '*.a' -exec cp \{\} ${{ env.DART_WORKSPACE }}/ios \; + + - name: Set path or install flutter + uses: subosito/flutter-action@v1 + with: + flutter-version: ${{ env.FLUTTER_VERSION }} + + - name: Install flutter dependencies + working-directory: ${{ env.DART_WORKSPACE }} + run: flutter pub get + + - name: Generate flutter ffi + working-directory: ${{ env.DART_WORKSPACE }} + run: flutter pub run ffigen + + - name: Download data + run: sh download_data.sh + + - name: Build flutter example + working-directory: ${{ env.DART_WORKSPACE }}/example + run: ${{ matrix.cmd }} diff --git a/bindings/dart/example/ios/Flutter/AppFrameworkInfo.plist b/bindings/dart/example/ios/Flutter/AppFrameworkInfo.plist index 9367d483e..8d4492f97 100644 --- a/bindings/dart/example/ios/Flutter/AppFrameworkInfo.plist +++ b/bindings/dart/example/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 8.0 + 9.0 diff --git a/bindings/dart/example/ios/Podfile.lock b/bindings/dart/example/ios/Podfile.lock new file mode 100644 index 000000000..1ec748d05 --- /dev/null +++ b/bindings/dart/example/ios/Podfile.lock @@ -0,0 +1,28 @@ +PODS: + - Flutter (1.0.0) + - path_provider (0.0.1): + - Flutter + - xayn_ai_ffi_dart (0.0.1): + - Flutter + +DEPENDENCIES: + - Flutter (from `Flutter`) + - path_provider (from `.symlinks/plugins/path_provider/ios`) + - xayn_ai_ffi_dart (from `.symlinks/plugins/xayn_ai_ffi_dart/ios`) + +EXTERNAL SOURCES: + Flutter: + :path: Flutter + path_provider: + :path: ".symlinks/plugins/path_provider/ios" + xayn_ai_ffi_dart: + :path: ".symlinks/plugins/xayn_ai_ffi_dart/ios" + +SPEC CHECKSUMS: + Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c + path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c + xayn_ai_ffi_dart: 286b391bc1afb0c5b9c3d3e15cf1a54df623ffda + +PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c + +COCOAPODS: 1.10.1 diff --git a/bindings/dart/example/ios/Runner.xcodeproj/project.pbxproj b/bindings/dart/example/ios/Runner.xcodeproj/project.pbxproj index 333be0052..0ba6d0038 100644 --- a/bindings/dart/example/ios/Runner.xcodeproj/project.pbxproj +++ b/bindings/dart/example/ios/Runner.xcodeproj/project.pbxproj @@ -3,11 +3,12 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 51; objects = { /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 14F764374C373ED746426B37 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A13A379E4DE37007A513E7A5 /* Pods_Runner.framework */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; @@ -31,10 +32,12 @@ /* Begin PBXFileReference section */ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 182DC7CA0B8D8F10F2C92F12 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 9495182DD6E4ED01CBE0290B /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -42,6 +45,8 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + A13A379E4DE37007A513E7A5 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + A77E8A7D3C3AA1D10841451C /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -49,12 +54,23 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 14F764374C373ED746426B37 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 8571A5BCB307047FA9DBF794 /* Pods */ = { + isa = PBXGroup; + children = ( + 9495182DD6E4ED01CBE0290B /* Pods-Runner.debug.xcconfig */, + 182DC7CA0B8D8F10F2C92F12 /* Pods-Runner.release.xcconfig */, + A77E8A7D3C3AA1D10841451C /* Pods-Runner.profile.xcconfig */, + ); + path = Pods; + sourceTree = ""; + }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( @@ -72,6 +88,8 @@ 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, + 8571A5BCB307047FA9DBF794 /* Pods */, + DF2A10E29DEAFE52F681A812 /* Frameworks */, ); sourceTree = ""; }; @@ -98,6 +116,14 @@ path = Runner; sourceTree = ""; }; + DF2A10E29DEAFE52F681A812 /* Frameworks */ = { + isa = PBXGroup; + children = ( + A13A379E4DE37007A513E7A5 /* Pods_Runner.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -105,12 +131,14 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( + C0FFA9F57681AFC7BB7E2A51 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + 6508B95EF1E1E9DFFD25E3DD /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -183,6 +211,23 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; + 6508B95EF1E1E9DFFD25E3DD /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -197,6 +242,28 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; + C0FFA9F57681AFC7BB7E2A51 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -235,6 +302,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = arm64; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -290,7 +358,10 @@ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = com.xayn.xaynAiFfiDartExample; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -303,6 +374,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = arm64; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -358,6 +430,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = arm64; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -399,7 +472,8 @@ MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; @@ -414,7 +488,10 @@ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = com.xayn.xaynAiFfiDartExample; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -433,7 +510,10 @@ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = com.xayn.xaynAiFfiDartExample; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; diff --git a/bindings/dart/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/bindings/dart/example/ios/Runner.xcworkspace/contents.xcworkspacedata index 1d526a16e..21a3cc14c 100644 --- a/bindings/dart/example/ios/Runner.xcworkspace/contents.xcworkspacedata +++ b/bindings/dart/example/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -4,4 +4,7 @@ + + From 698e3e629bca383db12335915b7caa12a9d28ac8 Mon Sep 17 00:00:00 2001 From: Robert Steiner Date: Wed, 12 May 2021 13:48:35 +0200 Subject: [PATCH 02/18] Update .github/workflows/ci.yml [skip ci] Co-authored-by: janpetschexain <58227040+janpetschexain@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 488b750ee..664c7c564 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -389,7 +389,7 @@ jobs: - name: Prepare lib for upload run: | - dir=target/${{ matrix.target}}/debug + dir=target/${{ matrix.target }}/debug mv $dir/libxayn_ai_ffi_c.a $dir/libxayn_ai_ffi_c_${{ matrix.target }}.a - name: Upload library artifacts From 925e8629684f0a0282e681cc7431a84513195397 Mon Sep 17 00:00:00 2001 From: Robert Steiner Date: Wed, 12 May 2021 13:55:24 +0200 Subject: [PATCH 03/18] Update .github/workflows/ci.yml [skip ci] Co-authored-by: janpetschexain <58227040+janpetschexain@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 664c7c564..7e32612ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -567,7 +567,7 @@ jobs: working-directory: ${{ runner.temp }}/${{ needs.build-linux-lib.outputs.cache-key }} run: | mv xayn-ai-ffi-c/ffi.h ${{ github.workspace }}/xayn-ai-ffi-c/ffi.h - cp -r target ${{ github.workspace }} + cp -R target ${{ github.workspace }} - name: Download data run: sh download_data.sh From 2d25c6599221e865592646a02edd96f344dd9398 Mon Sep 17 00:00:00 2001 From: Robert Debug Date: Wed, 12 May 2021 13:56:50 +0200 Subject: [PATCH 04/18] fix cp cmd --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7e32612ee..47755e8f6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -622,7 +622,7 @@ jobs: working-directory: ${{ runner.temp }}/${{ needs.build-linux-lib.outputs.cache-key }} run: | mv xayn-ai-ffi-c/ffi.h ${{ github.workspace }}/xayn-ai-ffi-c/ffi.h - cp -r target ${{ github.workspace }} + cp -R target ${{ github.workspace }} - name: Install flutter dependencies working-directory: ${{ env.DART_WORKSPACE }} From 8df22c08bd2128ebf80ea161c67db4fd716b43b2 Mon Sep 17 00:00:00 2001 From: Robert Debug Date: Wed, 12 May 2021 14:44:52 +0200 Subject: [PATCH 05/18] add comment to github issue link [skip ci] --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 47755e8f6..afed7a57a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -677,7 +677,10 @@ jobs: run: mv xayn-ai-ffi-c/ffi.h ${{ github.workspace }}/xayn-ai-ffi-c/ffi.h - name: Download all artifacts - # https://github.com/actions/download-artifact/issues/6 + # Currently we can only download all artifacts. Using wildcards is not + # yet supported. https://github.com/actions/download-artifact/issues/6 + # That said, we're downloading the Linux artifacts twice, but doing it + # in two download steps would be a bit overkill. if: matrix.os == 'macos-10.15' uses: actions/download-artifact@v2 with: From 525ab9e2e67e04c713cf8575fd7b3326557048fc Mon Sep 17 00:00:00 2001 From: Robert Debug Date: Mon, 17 May 2021 12:42:46 +0200 Subject: [PATCH 06/18] add build archive step --- .github/workflows/ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index afed7a57a..441f79fd3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -711,4 +711,9 @@ jobs: - name: Build flutter example working-directory: ${{ env.DART_WORKSPACE }}/example - run: ${{ matrix.cmd }} + run: ${{ matrix.cmd }} + + - name: Build archive + if: matrix.os == 'macos-10.15' + working-directory: ${{ env.DART_WORKSPACE }}/example + run: xcodebuild -workspace ios/Runner.xcworkspace -scheme Runner archive -configuration release -archivePath build/Runner.xcarchive From 038f2a70dd1fd6a04d6a861daed3734d2c5e63f3 Mon Sep 17 00:00:00 2001 From: Robert Debug Date: Mon, 17 May 2021 13:24:06 +0200 Subject: [PATCH 07/18] disable code sign --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 441f79fd3..f221958b4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -716,4 +716,4 @@ jobs: - name: Build archive if: matrix.os == 'macos-10.15' working-directory: ${{ env.DART_WORKSPACE }}/example - run: xcodebuild -workspace ios/Runner.xcworkspace -scheme Runner archive -configuration release -archivePath build/Runner.xcarchive + run: xcodebuild -workspace ios/Runner.xcworkspace -scheme Runner archive -configuration release -archivePath build/Runner.xcarchive CODE_SIGNING_ALLOWED="NO" From 1d642d513fdf796ad42b215c3fbfbed7057b177c Mon Sep 17 00:00:00 2001 From: Robert Debug Date: Mon, 17 May 2021 16:25:30 +0200 Subject: [PATCH 08/18] update flutter --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f221958b4..5d1f0dcf0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ env: # takes a considerable amount of time if it is compiled with the default opt-level # for tests. Therefore, we compile them with a higher opt-level to run them faster. OPT_TESTS_RUSTFLAGS: '-C opt-level=3 -C debug-assertions=yes -D warnings' - FLUTTER_VERSION: '2.0.0' + FLUTTER_VERSION: '2.0.6' JAVA_VERSION: '12.x' DART_WORKSPACE: ${{ github.workspace }}/bindings/dart CARGO_INCREMENTAL: 0 From 9955f7cf193baee17bfad539cabc79d8e87f6b49 Mon Sep 17 00:00:00 2001 From: Robert Debug Date: Mon, 17 May 2021 18:28:59 +0200 Subject: [PATCH 09/18] pin xcode version to 12.2 --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5d1f0dcf0..f6fdc0582 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -666,6 +666,10 @@ jobs: if: matrix.os == 'ubuntu-20.04' run: sudo apt-get install libclang-10-dev + - name: Set XCode version to 12.2 + if: matrix.os == 'macos-10.15' + run: sudo xcode-select -s /Applications/Xcode_12.2.app/Contents/Developer + - name: Download ${{ needs.build-linux-lib.outputs.cache-key }} artifacts uses: actions/download-artifact@v2 with: From 0917705134ca4d3798a28eef814b3e80818243fd Mon Sep 17 00:00:00 2001 From: Robert Debug Date: Mon, 17 May 2021 18:55:42 +0200 Subject: [PATCH 10/18] Revert xcode changes --- .../ios/Flutter/AppFrameworkInfo.plist | 2 +- .../dart/example/ios/Flutter/Debug.xcconfig | 1 - .../dart/example/ios/Flutter/Release.xcconfig | 1 - bindings/dart/example/ios/Podfile | 41 --------- bindings/dart/example/ios/Podfile.lock | 28 ------ .../ios/Runner.xcodeproj/project.pbxproj | 90 ++----------------- .../contents.xcworkspacedata | 3 - 7 files changed, 6 insertions(+), 160 deletions(-) delete mode 100644 bindings/dart/example/ios/Podfile delete mode 100644 bindings/dart/example/ios/Podfile.lock diff --git a/bindings/dart/example/ios/Flutter/AppFrameworkInfo.plist b/bindings/dart/example/ios/Flutter/AppFrameworkInfo.plist index 8d4492f97..9367d483e 100644 --- a/bindings/dart/example/ios/Flutter/AppFrameworkInfo.plist +++ b/bindings/dart/example/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 9.0 + 8.0 diff --git a/bindings/dart/example/ios/Flutter/Debug.xcconfig b/bindings/dart/example/ios/Flutter/Debug.xcconfig index ec97fc6f3..592ceee85 100644 --- a/bindings/dart/example/ios/Flutter/Debug.xcconfig +++ b/bindings/dart/example/ios/Flutter/Debug.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/bindings/dart/example/ios/Flutter/Release.xcconfig b/bindings/dart/example/ios/Flutter/Release.xcconfig index c4855bfe2..592ceee85 100644 --- a/bindings/dart/example/ios/Flutter/Release.xcconfig +++ b/bindings/dart/example/ios/Flutter/Release.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/bindings/dart/example/ios/Podfile b/bindings/dart/example/ios/Podfile deleted file mode 100644 index 1e8c3c90a..000000000 --- a/bindings/dart/example/ios/Podfile +++ /dev/null @@ -1,41 +0,0 @@ -# Uncomment this line to define a global platform for your project -# platform :ios, '9.0' - -# CocoaPods analytics sends network stats synchronously affecting flutter build latency. -ENV['COCOAPODS_DISABLE_STATS'] = 'true' - -project 'Runner', { - 'Debug' => :debug, - 'Profile' => :release, - 'Release' => :release, -} - -def flutter_root - generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) - unless File.exist?(generated_xcode_build_settings_path) - raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" - end - - File.foreach(generated_xcode_build_settings_path) do |line| - matches = line.match(/FLUTTER_ROOT\=(.*)/) - return matches[1].strip if matches - end - raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" -end - -require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) - -flutter_ios_podfile_setup - -target 'Runner' do - use_frameworks! - use_modular_headers! - - flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - flutter_additional_ios_build_settings(target) - end -end diff --git a/bindings/dart/example/ios/Podfile.lock b/bindings/dart/example/ios/Podfile.lock deleted file mode 100644 index 1ec748d05..000000000 --- a/bindings/dart/example/ios/Podfile.lock +++ /dev/null @@ -1,28 +0,0 @@ -PODS: - - Flutter (1.0.0) - - path_provider (0.0.1): - - Flutter - - xayn_ai_ffi_dart (0.0.1): - - Flutter - -DEPENDENCIES: - - Flutter (from `Flutter`) - - path_provider (from `.symlinks/plugins/path_provider/ios`) - - xayn_ai_ffi_dart (from `.symlinks/plugins/xayn_ai_ffi_dart/ios`) - -EXTERNAL SOURCES: - Flutter: - :path: Flutter - path_provider: - :path: ".symlinks/plugins/path_provider/ios" - xayn_ai_ffi_dart: - :path: ".symlinks/plugins/xayn_ai_ffi_dart/ios" - -SPEC CHECKSUMS: - Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c - path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c - xayn_ai_ffi_dart: 286b391bc1afb0c5b9c3d3e15cf1a54df623ffda - -PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c - -COCOAPODS: 1.10.1 diff --git a/bindings/dart/example/ios/Runner.xcodeproj/project.pbxproj b/bindings/dart/example/ios/Runner.xcodeproj/project.pbxproj index 0ba6d0038..333be0052 100644 --- a/bindings/dart/example/ios/Runner.xcodeproj/project.pbxproj +++ b/bindings/dart/example/ios/Runner.xcodeproj/project.pbxproj @@ -3,12 +3,11 @@ archiveVersion = 1; classes = { }; - objectVersion = 51; + objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; - 14F764374C373ED746426B37 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A13A379E4DE37007A513E7A5 /* Pods_Runner.framework */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; @@ -32,12 +31,10 @@ /* Begin PBXFileReference section */ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 182DC7CA0B8D8F10F2C92F12 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 9495182DD6E4ED01CBE0290B /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -45,8 +42,6 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - A13A379E4DE37007A513E7A5 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - A77E8A7D3C3AA1D10841451C /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -54,23 +49,12 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 14F764374C373ED746426B37 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 8571A5BCB307047FA9DBF794 /* Pods */ = { - isa = PBXGroup; - children = ( - 9495182DD6E4ED01CBE0290B /* Pods-Runner.debug.xcconfig */, - 182DC7CA0B8D8F10F2C92F12 /* Pods-Runner.release.xcconfig */, - A77E8A7D3C3AA1D10841451C /* Pods-Runner.profile.xcconfig */, - ); - path = Pods; - sourceTree = ""; - }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( @@ -88,8 +72,6 @@ 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, - 8571A5BCB307047FA9DBF794 /* Pods */, - DF2A10E29DEAFE52F681A812 /* Frameworks */, ); sourceTree = ""; }; @@ -116,14 +98,6 @@ path = Runner; sourceTree = ""; }; - DF2A10E29DEAFE52F681A812 /* Frameworks */ = { - isa = PBXGroup; - children = ( - A13A379E4DE37007A513E7A5 /* Pods_Runner.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -131,14 +105,12 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - C0FFA9F57681AFC7BB7E2A51 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - 6508B95EF1E1E9DFFD25E3DD /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -211,23 +183,6 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; - 6508B95EF1E1E9DFFD25E3DD /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -242,28 +197,6 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; - C0FFA9F57681AFC7BB7E2A51 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -302,7 +235,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = arm64; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -358,10 +290,7 @@ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.xayn.xaynAiFfiDartExample; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -374,7 +303,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = arm64; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -430,7 +358,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = arm64; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -472,8 +399,7 @@ MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; @@ -488,10 +414,7 @@ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.xayn.xaynAiFfiDartExample; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -510,10 +433,7 @@ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.xayn.xaynAiFfiDartExample; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; diff --git a/bindings/dart/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/bindings/dart/example/ios/Runner.xcworkspace/contents.xcworkspacedata index 21a3cc14c..1d526a16e 100644 --- a/bindings/dart/example/ios/Runner.xcworkspace/contents.xcworkspacedata +++ b/bindings/dart/example/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -4,7 +4,4 @@ - - From 81bf8482f425042511f614670cd40aa01f359720 Mon Sep 17 00:00:00 2001 From: Robert Debug Date: Mon, 17 May 2021 19:23:22 +0200 Subject: [PATCH 11/18] test with embed-bitcode=yes --- .github/workflows/ci.yml | 8 +- .../ios/Flutter/AppFrameworkInfo.plist | 2 +- .../dart/example/ios/Flutter/Debug.xcconfig | 1 + .../dart/example/ios/Flutter/Release.xcconfig | 1 + bindings/dart/example/ios/Podfile | 41 ++++++++ bindings/dart/example/ios/Podfile.lock | 28 ++++++ .../ios/Runner.xcodeproj/project.pbxproj | 93 ++++++++++++++++++- .../xcshareddata/xcschemes/Runner.xcscheme | 10 +- .../contents.xcworkspacedata | 3 + 9 files changed, 171 insertions(+), 16 deletions(-) create mode 100644 bindings/dart/example/ios/Podfile create mode 100644 bindings/dart/example/ios/Podfile.lock diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f6fdc0582..34107f975 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -385,6 +385,8 @@ jobs: - name: Build iOS library ${{ matrix.target }} working-directory: ./xayn-ai-ffi-c + env: + RUSTFLAGS: -Cembed-bitcode=yes run: cargo lipo --targets ${{ matrix.target }} - name: Prepare lib for upload @@ -666,9 +668,9 @@ jobs: if: matrix.os == 'ubuntu-20.04' run: sudo apt-get install libclang-10-dev - - name: Set XCode version to 12.2 - if: matrix.os == 'macos-10.15' - run: sudo xcode-select -s /Applications/Xcode_12.2.app/Contents/Developer + # - name: Set XCode version to 12.2 + # if: matrix.os == 'macos-10.15' + # run: sudo xcode-select -s /Applications/Xcode_12.2.app/Contents/Developer - name: Download ${{ needs.build-linux-lib.outputs.cache-key }} artifacts uses: actions/download-artifact@v2 diff --git a/bindings/dart/example/ios/Flutter/AppFrameworkInfo.plist b/bindings/dart/example/ios/Flutter/AppFrameworkInfo.plist index 9367d483e..8d4492f97 100644 --- a/bindings/dart/example/ios/Flutter/AppFrameworkInfo.plist +++ b/bindings/dart/example/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 8.0 + 9.0 diff --git a/bindings/dart/example/ios/Flutter/Debug.xcconfig b/bindings/dart/example/ios/Flutter/Debug.xcconfig index 592ceee85..ec97fc6f3 100644 --- a/bindings/dart/example/ios/Flutter/Debug.xcconfig +++ b/bindings/dart/example/ios/Flutter/Debug.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/bindings/dart/example/ios/Flutter/Release.xcconfig b/bindings/dart/example/ios/Flutter/Release.xcconfig index 592ceee85..c4855bfe2 100644 --- a/bindings/dart/example/ios/Flutter/Release.xcconfig +++ b/bindings/dart/example/ios/Flutter/Release.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/bindings/dart/example/ios/Podfile b/bindings/dart/example/ios/Podfile new file mode 100644 index 000000000..1e8c3c90a --- /dev/null +++ b/bindings/dart/example/ios/Podfile @@ -0,0 +1,41 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '9.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/bindings/dart/example/ios/Podfile.lock b/bindings/dart/example/ios/Podfile.lock new file mode 100644 index 000000000..1ec748d05 --- /dev/null +++ b/bindings/dart/example/ios/Podfile.lock @@ -0,0 +1,28 @@ +PODS: + - Flutter (1.0.0) + - path_provider (0.0.1): + - Flutter + - xayn_ai_ffi_dart (0.0.1): + - Flutter + +DEPENDENCIES: + - Flutter (from `Flutter`) + - path_provider (from `.symlinks/plugins/path_provider/ios`) + - xayn_ai_ffi_dart (from `.symlinks/plugins/xayn_ai_ffi_dart/ios`) + +EXTERNAL SOURCES: + Flutter: + :path: Flutter + path_provider: + :path: ".symlinks/plugins/path_provider/ios" + xayn_ai_ffi_dart: + :path: ".symlinks/plugins/xayn_ai_ffi_dart/ios" + +SPEC CHECKSUMS: + Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c + path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c + xayn_ai_ffi_dart: 286b391bc1afb0c5b9c3d3e15cf1a54df623ffda + +PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c + +COCOAPODS: 1.10.1 diff --git a/bindings/dart/example/ios/Runner.xcodeproj/project.pbxproj b/bindings/dart/example/ios/Runner.xcodeproj/project.pbxproj index 333be0052..14154f559 100644 --- a/bindings/dart/example/ios/Runner.xcodeproj/project.pbxproj +++ b/bindings/dart/example/ios/Runner.xcodeproj/project.pbxproj @@ -3,12 +3,13 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 51; objects = { /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 72DFB68CF548092F2874C832 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 687EF9772752952388763721 /* Pods_Runner.framework */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; @@ -31,10 +32,13 @@ /* Begin PBXFileReference section */ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 1C235D5BFE26DE2B38DFA443 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 687EF9772752952388763721 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 8244B117EFEC78AF00829994 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -42,6 +46,7 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + A1315991F349B5845D30D06E /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -49,12 +54,31 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 72DFB68CF548092F2874C832 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 4B6746522132B6DE3F9EE2C1 /* Pods */ = { + isa = PBXGroup; + children = ( + 8244B117EFEC78AF00829994 /* Pods-Runner.debug.xcconfig */, + A1315991F349B5845D30D06E /* Pods-Runner.release.xcconfig */, + 1C235D5BFE26DE2B38DFA443 /* Pods-Runner.profile.xcconfig */, + ); + path = Pods; + sourceTree = ""; + }; + 80FC18BEE143DC02F68D3B4F /* Frameworks */ = { + isa = PBXGroup; + children = ( + 687EF9772752952388763721 /* Pods_Runner.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( @@ -72,6 +96,8 @@ 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, + 4B6746522132B6DE3F9EE2C1 /* Pods */, + 80FC18BEE143DC02F68D3B4F /* Frameworks */, ); sourceTree = ""; }; @@ -105,12 +131,14 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( + B044492691A10A4D075F8CF7 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + 1882B6A1FC1F068401D8749B /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -169,6 +197,23 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 1882B6A1FC1F068401D8749B /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -197,6 +242,28 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; + B044492691A10A4D075F8CF7 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -235,6 +302,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = arm64; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -288,9 +356,13 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = 57SDG79Y54; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = com.xayn.xaynAiFfiDartExample; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -303,6 +375,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = arm64; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -358,6 +431,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = arm64; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -399,7 +473,8 @@ MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; @@ -412,9 +487,13 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = 57SDG79Y54; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = com.xayn.xaynAiFfiDartExample; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -431,9 +510,13 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = 57SDG79Y54; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = com.xayn.xaynAiFfiDartExample; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; diff --git a/bindings/dart/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/bindings/dart/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index a28140cfd..46d2d0d85 100644 --- a/bindings/dart/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/bindings/dart/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ - - - - + + - - + + From 74fc1528a105c8f5223971e86b9c03969f750c65 Mon Sep 17 00:00:00 2001 From: Robert Debug Date: Mon, 17 May 2021 20:38:24 +0200 Subject: [PATCH 12/18] test -Cdebuginfo=0 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 34107f975..e1df385a6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -386,7 +386,7 @@ jobs: - name: Build iOS library ${{ matrix.target }} working-directory: ./xayn-ai-ffi-c env: - RUSTFLAGS: -Cembed-bitcode=yes + RUSTFLAGS: -Cdebuginfo=0 run: cargo lipo --targets ${{ matrix.target }} - name: Prepare lib for upload From 1bc5994023aaaaffb05e2a99838937ce4f5c0eac Mon Sep 17 00:00:00 2001 From: Robert Debug Date: Wed, 19 May 2021 10:10:31 +0200 Subject: [PATCH 13/18] disable bitcode for pods deps --- .github/workflows/ci.yml | 6 ------ bindings/dart/example/ios/Flutter/AppFrameworkInfo.plist | 2 +- bindings/dart/example/ios/Podfile | 3 +++ bindings/dart/example/ios/Podfile.lock | 2 +- .../dart/example/ios/Runner.xcodeproj/project.pbxproj | 8 +++----- 5 files changed, 8 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e1df385a6..5d1f0dcf0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -385,8 +385,6 @@ jobs: - name: Build iOS library ${{ matrix.target }} working-directory: ./xayn-ai-ffi-c - env: - RUSTFLAGS: -Cdebuginfo=0 run: cargo lipo --targets ${{ matrix.target }} - name: Prepare lib for upload @@ -668,10 +666,6 @@ jobs: if: matrix.os == 'ubuntu-20.04' run: sudo apt-get install libclang-10-dev - # - name: Set XCode version to 12.2 - # if: matrix.os == 'macos-10.15' - # run: sudo xcode-select -s /Applications/Xcode_12.2.app/Contents/Developer - - name: Download ${{ needs.build-linux-lib.outputs.cache-key }} artifacts uses: actions/download-artifact@v2 with: diff --git a/bindings/dart/example/ios/Flutter/AppFrameworkInfo.plist b/bindings/dart/example/ios/Flutter/AppFrameworkInfo.plist index 8d4492f97..ce6237b30 100644 --- a/bindings/dart/example/ios/Flutter/AppFrameworkInfo.plist +++ b/bindings/dart/example/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 9.0 + 12.1 diff --git a/bindings/dart/example/ios/Podfile b/bindings/dart/example/ios/Podfile index 1e8c3c90a..66c23565d 100644 --- a/bindings/dart/example/ios/Podfile +++ b/bindings/dart/example/ios/Podfile @@ -37,5 +37,8 @@ end post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) + target.build_configurations.each do |config| + config.build_settings['ENABLE_BITCODE'] = 'NO' + end end end diff --git a/bindings/dart/example/ios/Podfile.lock b/bindings/dart/example/ios/Podfile.lock index 1ec748d05..aadc1add7 100644 --- a/bindings/dart/example/ios/Podfile.lock +++ b/bindings/dart/example/ios/Podfile.lock @@ -23,6 +23,6 @@ SPEC CHECKSUMS: path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c xayn_ai_ffi_dart: 286b391bc1afb0c5b9c3d3e15cf1a54df623ffda -PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c +PODFILE CHECKSUM: 96a0047845f962487b194a3aa86ff7b33aa09ba1 COCOAPODS: 1.10.1 diff --git a/bindings/dart/example/ios/Runner.xcodeproj/project.pbxproj b/bindings/dart/example/ios/Runner.xcodeproj/project.pbxproj index 14154f559..7e08f8a7d 100644 --- a/bindings/dart/example/ios/Runner.xcodeproj/project.pbxproj +++ b/bindings/dart/example/ios/Runner.xcodeproj/project.pbxproj @@ -340,7 +340,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.1; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -419,7 +419,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.1; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -469,7 +469,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.1; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -487,7 +487,6 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = 57SDG79Y54; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -510,7 +509,6 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = 57SDG79Y54; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( From 5239f78eb6267fef5e9fb23659c2c0c47978f0b0 Mon Sep 17 00:00:00 2001 From: Robert Debug Date: Wed, 19 May 2021 10:49:18 +0200 Subject: [PATCH 14/18] wip --- bindings/dart/example/ios/Podfile | 3 ++- bindings/dart/example/ios/Podfile.lock | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bindings/dart/example/ios/Podfile b/bindings/dart/example/ios/Podfile index 66c23565d..ea9d2f3f8 100644 --- a/bindings/dart/example/ios/Podfile +++ b/bindings/dart/example/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -# platform :ios, '9.0' +platform :ios, '12.1' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' @@ -39,6 +39,7 @@ post_install do |installer| flutter_additional_ios_build_settings(target) target.build_configurations.each do |config| config.build_settings['ENABLE_BITCODE'] = 'NO' + # config.build_settings["EXCLUDED_ARCHS"] = "armv7" end end end diff --git a/bindings/dart/example/ios/Podfile.lock b/bindings/dart/example/ios/Podfile.lock index aadc1add7..a674e9e88 100644 --- a/bindings/dart/example/ios/Podfile.lock +++ b/bindings/dart/example/ios/Podfile.lock @@ -23,6 +23,6 @@ SPEC CHECKSUMS: path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c xayn_ai_ffi_dart: 286b391bc1afb0c5b9c3d3e15cf1a54df623ffda -PODFILE CHECKSUM: 96a0047845f962487b194a3aa86ff7b33aa09ba1 +PODFILE CHECKSUM: 1354d209c78c3d43353f333457f99cc558069f97 COCOAPODS: 1.10.1 From 520b808fae7a6d8226a02f6eb832cb4e63c08efb Mon Sep 17 00:00:00 2001 From: Robert Debug Date: Wed, 19 May 2021 10:52:56 +0200 Subject: [PATCH 15/18] use EXCLUDED_ARCHS instead of ARCHS --- bindings/dart/example/ios/Podfile | 2 +- bindings/dart/example/ios/Podfile.lock | 2 +- bindings/dart/example/ios/Runner.xcodeproj/project.pbxproj | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bindings/dart/example/ios/Podfile b/bindings/dart/example/ios/Podfile index ea9d2f3f8..3b269019b 100644 --- a/bindings/dart/example/ios/Podfile +++ b/bindings/dart/example/ios/Podfile @@ -39,7 +39,7 @@ post_install do |installer| flutter_additional_ios_build_settings(target) target.build_configurations.each do |config| config.build_settings['ENABLE_BITCODE'] = 'NO' - # config.build_settings["EXCLUDED_ARCHS"] = "armv7" + config.build_settings["EXCLUDED_ARCHS"] = "armv7" end end end diff --git a/bindings/dart/example/ios/Podfile.lock b/bindings/dart/example/ios/Podfile.lock index a674e9e88..520de51f0 100644 --- a/bindings/dart/example/ios/Podfile.lock +++ b/bindings/dart/example/ios/Podfile.lock @@ -23,6 +23,6 @@ SPEC CHECKSUMS: path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c xayn_ai_ffi_dart: 286b391bc1afb0c5b9c3d3e15cf1a54df623ffda -PODFILE CHECKSUM: 1354d209c78c3d43353f333457f99cc558069f97 +PODFILE CHECKSUM: 8462e319511eccc6fb15d8c90ec86661a5952ac8 COCOAPODS: 1.10.1 diff --git a/bindings/dart/example/ios/Runner.xcodeproj/project.pbxproj b/bindings/dart/example/ios/Runner.xcodeproj/project.pbxproj index 7e08f8a7d..3b8fc7b71 100644 --- a/bindings/dart/example/ios/Runner.xcodeproj/project.pbxproj +++ b/bindings/dart/example/ios/Runner.xcodeproj/project.pbxproj @@ -302,7 +302,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = arm64; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -332,6 +331,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + EXCLUDED_ARCHS = armv7; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -375,7 +375,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = arm64; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -405,6 +404,7 @@ DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; + EXCLUDED_ARCHS = armv7; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -431,7 +431,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = arm64; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -461,6 +460,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + EXCLUDED_ARCHS = armv7; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; From c0412a1168de0571d865fd49c7cd04044f3cecda Mon Sep 17 00:00:00 2001 From: Robert Debug Date: Wed, 19 May 2021 11:13:58 +0200 Subject: [PATCH 16/18] remove DEVELOPMENT_TEAM --- bindings/dart/example/ios/Runner.xcodeproj/project.pbxproj | 1 - 1 file changed, 1 deletion(-) diff --git a/bindings/dart/example/ios/Runner.xcodeproj/project.pbxproj b/bindings/dart/example/ios/Runner.xcodeproj/project.pbxproj index 3b8fc7b71..6390d899f 100644 --- a/bindings/dart/example/ios/Runner.xcodeproj/project.pbxproj +++ b/bindings/dart/example/ios/Runner.xcodeproj/project.pbxproj @@ -356,7 +356,6 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = 57SDG79Y54; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( From 14f47e7d4dbe8c256414b93adf8972f6f352d171 Mon Sep 17 00:00:00 2001 From: Robert Debug Date: Wed, 19 May 2021 15:34:09 +0200 Subject: [PATCH 17/18] only download ios artifacts --- .github/workflows/ci.yml | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5d1f0dcf0..5430daa45 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -395,7 +395,7 @@ jobs: - name: Upload library artifacts uses: actions/upload-artifact@v2 with: - name: build-ios-${{ matrix.target }}-${{ hashFiles('target/*-apple-ios/debug/libxayn_ai_ffi_c_*-apple-ios.a') }} + name: build-ios-${{ matrix.target }}-${{ github.sha }} retention-days: 1 if-no-files-found: error path: target/${{ matrix.target}}/debug/libxayn_ai_ffi_c_${{ matrix.target }}.a @@ -676,22 +676,27 @@ jobs: working-directory: ${{ runner.temp }}/${{ needs.build-linux-lib.outputs.cache-key }} run: mv xayn-ai-ffi-c/ffi.h ${{ github.workspace }}/xayn-ai-ffi-c/ffi.h - - name: Download all artifacts - # Currently we can only download all artifacts. Using wildcards is not - # yet supported. https://github.com/actions/download-artifact/issues/6 - # That said, we're downloading the Linux artifacts twice, but doing it - # in two download steps would be a bit overkill. + - name: Download iOS aarch64 artifacts if: matrix.os == 'macos-10.15' uses: actions/download-artifact@v2 with: - path: ${{ runner.temp }}/all-artifacts/ + name: build-ios-aarch64-apple-ios-${{ github.sha }} + path: ${{ runner.temp }}/build-ios-${{ github.sha }} - - name: Move iOS libs + - name: Download iOS x84_64 artifacts + if: matrix.os == 'macos-10.15' + uses: actions/download-artifact@v2 + with: + name: build-ios-x86_64-apple-ios-${{ github.sha }} + path: ${{ runner.temp }}/build-ios-${{ github.sha }} + + - name: Move iOS artifacts if: matrix.os == 'macos-10.15' - working-directory: ${{ runner.temp }}/all-artifacts/ run: | - find build-x86_64-unknown-linux-gnu-*/bindings/dart/ios/Classes/XaynAiFfiDartPlugin.h -exec cp \{\} ${{ env.DART_WORKSPACE }}/ios/Classes/XaynAiFfiDartPlugin.h \; - find build-ios-*/ -iname '*.a' -exec cp \{\} ${{ env.DART_WORKSPACE }}/ios \; + cd ${{ runner.temp }}/${{ needs.build-linux-lib.outputs.cache-key }} + cp bindings/dart/ios/Classes/XaynAiFfiDartPlugin.h ${{ env.DART_WORKSPACE }}/ios/Classes/ + cd ${{ runner.temp }}/build-ios-${{ github.sha }} + find . -iname '*.a' -exec cp \{\} ${{ env.DART_WORKSPACE }}/ios \; - name: Set path or install flutter uses: subosito/flutter-action@v1 From 3ec60bea29c1cd5ed00a4af0a9e2a40af0441482 Mon Sep 17 00:00:00 2001 From: Robert Debug Date: Thu, 20 May 2021 10:16:43 +0200 Subject: [PATCH 18/18] use test cache for build lib --- .github/workflows/ci.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5430daa45..e011aa942 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -180,6 +180,8 @@ jobs: needs: [registry-cache, check] runs-on: ubuntu-20.04 timeout-minutes: 20 + outputs: + cache-key: ${{ steps.cache-key.outputs.key }} steps: - name: Checkout repository uses: actions/checkout@v2 @@ -201,11 +203,16 @@ jobs: ~/.cargo/git key: ${{ needs.registry-cache.outputs.cache-key }} + - name: Generate build artifacts key + id: cache-key + shell: bash + run: echo "::set-output name=key::$(echo "${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.rustc }}-tests-${{ needs.registry-cache.outputs.cache-date }}-${{ hashFiles('**/Cargo.lock') }}")" + - name: Cache build artifacts uses: actions/cache@v2 with: path: ${{ github.workspace }}/target - key: ${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.rustc }}-tests-${{ needs.registry-cache.outputs.cache-date }}-${{ hashFiles('**/Cargo.lock') }} + key: ${{ steps.cache-key.outputs.key }} restore-keys: ${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.rustc }}-tests-${{ needs.registry-cache.outputs.cache-date }}- - name: Download data @@ -476,10 +483,14 @@ jobs: uses: actions/cache@v2.1.4 with: path: ${{ github.workspace }}/target - key: ${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.rustc }}-build-linux-${{ needs.registry-cache.outputs.cache-date }}-${{ hashFiles('**/Cargo.lock') }} - restore-keys: ${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.rustc }}-build-linux-${{ needs.registry-cache.outputs.cache-date }}- + key: ${{ needs.test.outputs.cache-key }} - name: Build linux lib + # We have to use the same RUSTFLAGS that are used in the test + # job in order to be able to reuse the cache. If we do not do this, + # the compiler will recompile all the libraries from scratch. + env: + RUSTFLAGS: "-D warnings" run: cargo build - name: Generate lib artifacts key