Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CocoaPods] Add podspec #5

Merged
merged 12 commits into from
Jan 26, 2024
Merged

[CocoaPods] Add podspec #5

merged 12 commits into from
Jan 26, 2024

Conversation

ncooke3
Copy link
Member

@ncooke3 ncooke3 commented Jan 26, 2024

@paulb777
Copy link
Member

Why the HEADER_SEARCH_PATHS change?

Would you add a pod lib lint test to CI?

@ncooke3
Copy link
Member Author

ncooke3 commented Jan 26, 2024

Yep, working on the CI stuff..


Why the HEADER_SEARCH_PATHS change?

This was tricky to figure out. With the old diff, the library would not build due to missing header errors. Example:

/Applications/Xcode_15.2_beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -ivfsstatcache /Users/nickcooke/Library/Developer/Xcode/DerivedData/SDKStatCaches.noindex/iphonesimulator17.2-21C52-b646cba0f94cc4f20d32c5ef8835441c.sdkstatcache -target x86_64-apple-ios11.0-simulator -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -fno-color-diagnostics -std=gnu++14 -stdlib=libc++ -fmodules -gmodules -fmodules-cache-path=/Users/nickcooke/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/Users/nickcooke/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -fmodule-name=leveldb -Wno-trigraphs -fpascal-strings -O0 -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wdocumentation -Wunreachable-code -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wno-newline-eof -Wno-c++11-extensions -Wno-implicit-fallthrough -DPOD_CONFIGURATION_DEBUG=1 -DDEBUG=1 -DCOCOAPODS=1 -DLEVELDB_IS_BIG_ENDIAN=0 -DLEVELDB_PLATFORM_POSIX -DHAVE_FULLFSYNC=1 -isysroot /Applications/Xcode_15.2_beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.2.sdk -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -g -fvisibility-inlines-hidden -Wno-sign-conversion -Winfinite-recursion -Wmove -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wrange-loop-analysis -Wno-semicolon-before-method-body -Wunguarded-availability -index-store-path /Users/nickcooke/Library/Developer/Xcode/DerivedData/App-gcssipvupdfahxfjslngudteqcuq/Index.noindex/DataStore -I/Users/nickcooke/Library/Developer/Xcode/DerivedData/App-gcssipvupdfahxfjslngudteqcuq/Build/Products/Debug-iphonesimulator/leveldb-library/include -I/var/folders/hz/7v68p4h95sb2ypb614xp20jc00r7sc/T/CocoaPods-Lint-20240125-29599-16udks9-leveldb-library/Pods/leveldb-library -I/var/folders/hz/7v68p4h95sb2ypb614xp20jc00r7sc/T/CocoaPods-Lint-20240125-29599-16udks9-leveldb-library/Pods/leveldb-library/foo -I/var/folders/hz/7v68p4h95sb2ypb614xp20jc00r7sc/T/CocoaPods-Lint-20240125-29599-16udks9-leveldb-library/Pods/leveldb-library/include -I/Users/nickcooke/Library/Developer/Xcode/DerivedData/App-gcssipvupdfahxfjslngudteqcuq/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/leveldb-library.build/DerivedSources-normal/x86_64 -I/Users/nickcooke/Library/Developer/Xcode/DerivedData/App-gcssipvupdfahxfjslngudteqcuq/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/leveldb-library.build/DerivedSources/x86_64 -I/Users/nickcooke/Library/Developer/Xcode/DerivedData/App-gcssipvupdfahxfjslngudteqcuq/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/leveldb-library.build/DerivedSources -Wno-shorten-64-to-32 -Wno-comma -Wno-unreachable-code -Wno-conditional-uninitialized -Wno-deprecated-declarations -F/Users/nickcooke/Library/Developer/Xcode/DerivedData/App-gcssipvupdfahxfjslngudteqcuq/Build/Products/Debug-iphonesimulator/leveldb-library -Wincomplete-umbrella -fno-objc-arc -include /var/folders/hz/7v68p4h95sb2ypb614xp20jc00r7sc/T/CocoaPods-Lint-20240125-29599-16udks9-leveldb-library/Pods/Target\ Support\ Files/leveldb-library/leveldb-library-prefix.pch -MMD -MT dependencies -MF /Users/nickcooke/Library/Developer/Xcode/DerivedData/App-gcssipvupdfahxfjslngudteqcuq/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/leveldb-library.build/Objects-normal/x86_64/arena.d --serialize-diagnostics /Users/nickcooke/Library/Developer/Xcode/DerivedData/App-gcssipvupdfahxfjslngudteqcuq/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/leveldb-library.build/Objects-normal/x86_64/arena.dia -c /Users/nickcooke/Developer/leveldb/util/arena.cc -o /Users/nickcooke/Library/Developer/Xcode/DerivedData/App-gcssipvupdfahxfjslngudteqcuq/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/leveldb-library.build/Objects-normal/x86_64/arena.o -index-unit-output-path /Pods.build/Debug-iphonesimulator/leveldb-library.build/Objects-normal/x86_64/arena.o
/Users/nickcooke/Developer/leveldb/util/arena.cc:5:10: fatal error: 'util/arena.h' file not found
#include "util/arena.h"
^~~~~~~~~~~~~~
1 error generated.

The values passed to HEADER_SEARCH_PATHS in the podspec can be seen in the above command. I added the path with foo (via '"${PODS_ROOT}/leveldb-library/foo" ') to track down where/how the PODS_ROOT gets expanded. Here's them in a formatted snippet:

<-- snip -->
-I/var/folders/hz/7v68p4h95sb2ypb614xp20jc00r7sc/T/CocoaPods-Lint-20240125-29599-16udks9-leveldb-library/Pods/leveldb-library \
-I/var/folders/hz/7v68p4h95sb2ypb614xp20jc00r7sc/T/CocoaPods-Lint-20240125-29599-16udks9-leveldb-library/Pods/leveldb-library/foo \
-I/var/folders/hz/7v68p4h95sb2ypb614xp20jc00r7sc/T/CocoaPods-Lint-20240125-29599-16udks9-leveldb-library/Pods/leveldb-library/include
<-- snip -->

But those directories do not exist:

ls: /var/folders/hz/7v68p4h95sb2ypb614xp20jc00r7sc/T/CocoaPods-Lint-20240125-29599-16udks9-leveldb-library/Pods/leveldb-library: No such file or directory

Here's the tree of that parent directory for this non-existent path:

/var/folders/hz/7v68p4h95sb2ypb614xp20jc00r7sc/T/CocoaPods-Lint-20240125-29599-16udks9-leveldb-library/Pods/
├── Headers
├── Local Podspecs
│   └── leveldb-library.podspec.json
├── Manifest.lock
├── Pods.xcodeproj
│   ├── project.pbxproj
│   └── xcuserdata
│       └── nickcooke.xcuserdatad
│           └── xcschemes
│               ├── Pods-App.xcscheme
│               ├── leveldb-library.xcscheme
│               └── xcschememanagement.plist
└── Target Support Files
    ├── Pods-App
    │   ├── Pods-App-Info.plist
    │   ├── Pods-App-acknowledgements.markdown
    │   ├── Pods-App-acknowledgements.plist
    │   ├── Pods-App-dummy.m
    │   ├── Pods-App-frameworks.sh
    │   ├── Pods-App-umbrella.h
    │   ├── Pods-App.debug.xcconfig
    │   ├── Pods-App.modulemap
    │   └── Pods-App.release.xcconfig
    └── leveldb-library
        ├── leveldb-library-Info.plist
        ├── leveldb-library-dummy.m
        ├── leveldb-library-prefix.pch
        ├── leveldb-library-umbrella.h
        ├── leveldb-library.debug.xcconfig
        ├── leveldb-library.modulemap
        └── leveldb-library.release.xcconfig

9 directories, 22 files

Interestingly, there is an empty Headers directory. But in any case, there are no product headers anywhere to be found, which explains the missing header errors.

I looked at what Firebase podspecs do, and they use the PODS_TARGET_SRCROOT macro instead, so I made that change and it worked.

On my machine, this gets resolved to -I/Users/nickcooke/Developer/leveldb which is my local clone and contains the sources.

I suspect this has something to do with the old diff pointing to sources outside of the repo containing the podspec. That was the only significant difference I could think of.

@paulb777
Copy link
Member

Interesting. Presumably the old podspec never tested with pod lib lint. And could be related to a difference between Pods and Development Pods. We'll need to make sure that the RTDB and Firestore leveldb references still work after staging the podspec.

.github/workflows/spm.yml Outdated Show resolved Hide resolved
leveldb-library.podspec Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
@ncooke3 ncooke3 requested a review from paulb777 January 26, 2024 01:45
@ncooke3
Copy link
Member Author

ncooke3 commented Jan 26, 2024

Post merge, I will tag CocoaPods-1.22.3 and push to specs staging.

Copy link
Member

@paulb777 paulb777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM after fixing CI warnings

.github/workflows/ci.yml Outdated Show resolved Hide resolved
@ncooke3 ncooke3 merged commit e16e489 into spm Jan 26, 2024
11 checks passed
@ncooke3 ncooke3 deleted the nc/add-podspec branch January 26, 2024 02:02
@ncooke3
Copy link
Member Author

ncooke3 commented Jan 26, 2024

Pushed a tag, but ran into problems staging the pod:

pod repo push --skip-tests --use-json --skip-import-validation --verbose staging leveldb-library.podspec

<-- snipped -->

[!] The `leveldb-library.podspec` specification does not validate.

    2024-01-25 21:16:52.163 xcodebuild[57183:40651515] Writing error result bundle to /var/folders/hz/7v68p4h95sb2ypb614xp20jc00r7sc/T/ResultBundle_2024-25-01_21-16-0052.xcresult
    xcodebuild: error: Found no destinations for the scheme 'leveldb-library' and action clean.
 -> leveldb-library (1.22.3)
    - NOTE  | xcodebuild:  note: Using codesigning identity override: -
    - NOTE  | xcodebuild:  note: Building targets in dependency order
    - NOTE  | xcodebuild:  note: Target dependency graph (1 target)
    - NOTE  | xcodebuild:  ld: warning: ignoring duplicate libraries: '-lc++'
    - NOTE  | [iOS] xcodebuild:  Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.2.99. (in target 'leveldb-library' from project 'Pods')
    - NOTE  | xcodebuild:  note: Using codesigning identity override: 
    - ERROR | xcodebuild: Returned an unsuccessful exit code.
    - NOTE  | [tvOS] xcodebuild:  xcodebuild: error: Unable to find a destination matching the provided destination specifier:
    - NOTE  | [watchOS] xcodebuild:  xcodebuild: error: Found no destinations for the scheme 'leveldb-library' and action clean.

[!] The `leveldb-library.podspec` specification does not validate.

Will investigate tomorrow...

@ncooke3
Copy link
Member Author

ncooke3 commented Jan 26, 2024

It appears I needed to quit Xcode 15 before xcode-selecting Xcode 14.1. Without quitting Xcode, my machine was still trying to stage with Xcode 15.

@paulb777
Copy link
Member

@ncooke3 I'm able to run pod spec lint leveldb-library.podspec --verbose --skip-import-validation successfully with Xcode 15.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants