FredericJacobs / OpenSSL-Pod

Unmaintained - please fork. Email me to take over the CocoaPod
74 stars 112 forks source link

Problem installing OpenSSL 1.0.208 #32

Closed marcelogoto closed 8 years ago

marcelogoto commented 8 years ago

Hi guys!

I'm currently having some issues trying to install the OpenSSL pod. Oddly this error doesn't always happen, only in some PC's. Can someone shine a light on what may be causing this error?

Thanks!

[!] /bin/bash -c set -e VERSION="1.0.2h" SDKVERSION=xcrun --sdk iphoneos --show-sdk-version 2> /dev/null MIN_SDK_VERSION_FLAG="-miphoneos-version-min=7.0"

BASEPATH="${PWD}" CURRENTPATH="/tmp/openssl" ARCHS="i386 x86_64 armv7 armv7s arm64" DEVELOPER=xcode-select -print-path

mkdir -p "${CURRENTPATH}" mkdir -p "${CURRENTPATH}/bin"

cp "file.tgz" "${CURRENTPATH}/file.tgz" cd "${CURRENTPATH}" tar -xzf file.tgz cd "openssl-${VERSION}"

for ARCH in ${ARCHS} do CONFIGURE_FOR="iphoneos-cross"

if [ "${ARCH}" == "i386" ] || [ "${ARCH}" == "x86_64" ] ; then PLATFORM="iPhoneSimulator" if [ "${ARCH}" == "x86_64" ] ; then CONFIGURE_FOR="darwin64-x86_64-cc" fi else sed -ie "s!static volatile sig_atomic_t intr_signal;!static volatile intr_signal;!" "crypto/ui/ui_openssl.c" PLATFORM="iPhoneOS" fi

export CROSS_TOP="${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer" export CROSS_SDK="${PLATFORM}${SDKVERSION}.sdk"

echo "Building openssl-${VERSION} for ${PLATFORM} ${SDKVERSION} ${ARCH}" echo "Please stand by..."

export CC="${DEVELOPER}/usr/bin/gcc -arch ${ARCH} ${MIN_SDK_VERSION_FLAG}" mkdir -p "${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk" LOG="${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk/build-openssl-${VERSION}.log"

LIPO_LIBSSL="${LIPO_LIBSSL} ${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk/lib/libssl.a" LIPO_LIBCRYPTO="${LIPO_LIBCRYPTO} ${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk/lib/libcrypto.a"

./Configure ${CONFIGURE_FOR} --openssldir="${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk" > "${LOG}" 2>&1 sed -ie "s!^CFLAG=!CFLAG=-isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} !" "Makefile"

make >> "${LOG}" 2>&1 make all install_sw >> "${LOG}" 2>&1 make clean >> "${LOG}" 2>&1 done

echo "Build library..." rm -rf "${BASEPATH}/lib/" mkdir -p "${BASEPATH}/lib/" lipo -create ${LIPO_LIBSSL} -output "${BASEPATH}/lib/libssl.a" lipo -create ${LIPO_LIBCRYPTO} -output "${BASEPATH}/lib/libcrypto.a"

echo "Copying headers..." rm -rf "${BASEPATH}/opensslIncludes/" mkdir -p "${BASEPATH}/opensslIncludes/" cp -RL "${CURRENTPATH}/openssl-${VERSION}/include/openssl" "${BASEPATH}/opensslIncludes/"

cd "${BASEPATH}" echo "Building done."

echo "Cleaning up..." rm -rf "${CURRENTPATH}" echo "Done."

Building openssl-1.0.2h for iPhoneSimulator 9.2 i386 Please stand by…

FredericJacobs commented 8 years ago

Do you have enough room on your disk?

marcelogoto commented 8 years ago

Yes...pretty sure.

FarAndHeight commented 8 years ago

@marcelogoto Could be a different issue, but I had an existing /tmp/openssl from a previously aborted attempt which was causing the same behavior. Deleting it and re-running pod install worked for me.

goodbless commented 8 years ago

@marcelogoto i come to exactly the same issue as yours. @FarAndHeight where is the /tmp/openssl folder?

FarAndHeight commented 8 years ago

@goodbless It's in the root directory.

marcelogoto commented 8 years ago

@FarAndHeight Couldn't find this folder :(

geraldeersteling commented 8 years ago

Uhm, just go to finder and press SHIFT+CMD+G. In the popup enter /tmp, you should be able to find the openssl folder there

marcelogoto commented 8 years ago

@gerald-coddut Thanks, but it didn't worked for me :(

I did found the /tmp folder, but there was no openssl folder there. Tried to run pod install and the folder appeared, but the error still persists...

geraldeersteling commented 8 years ago

Hm..I had that too; commented out the pod 'OpenSSL... in my Podfile, deleted the openssl folder and did a pod install again. Afterwards did a pod install with OpenSSL enabled again.

marcelogoto commented 8 years ago

Finally found what was causing this issue.

The XCode application must be named XCode only. If you rename to anything else (mine was XCode 7.3 because I have different versions of it in my PC) the error will occur. So basically you'll need to set a default XCode and it will work.

Thanks everyone for your time! Hope this helps someone in the future :)

yvsbb95 commented 7 years ago

@marcelogoto I have the same issue. The /tmp/openssl folder is not there , Xcode is named Xcode only, disk is not full. Still the same error. Is there any other reason for why this is happening?

Izakc commented 7 years ago

sudo xcode-select -switch /Applications/Xcode-7.3.1.app and remove /tmp/openssl work's for me

kartickvad commented 7 years ago

We use XCode 8 on macOS Sierra. Does this pod not work with that configuration? Thanks.

marcofeltmann commented 7 years ago

@yvsbb95 @kartickvad There is a solution for Xcode 8 on macOS Sierra. rm -r ${TMPDIR}/openssl/

As seen in the script files are written to CURRENTPATH="${TMPDIR}/openssl" so removing this one will reset the build process.

It really takes a while like 10 minutes or so. Do not interrupt, instead grab some more ☕️

ikrenyi1 commented 6 years ago

In my case I fixed this error by setting the command line tools in xcode -> preferences -> locations. It was blank for some reason

dungeonsnd commented 6 years ago

The following helped me , too. Thanks !

@ikrenyi1 In my case I fixed this error by setting the command line tools in xcode -> preferences -> locations. It was blank for some reason

sidan5 commented 6 years ago

Still having this issue. Any other solution? Trying to install OpenSSL 1.0.210, Cocoapods version 1.5.3

julestburt commented 6 years ago

I too am seeing this issue. I followed these extensive steps: https://stackoverflow.com/questions/49023709/updating-pods-not-working-which-were-working-previously-has-stopped-working?rq=1

but nothing has fixed it...

harshalkhandare commented 6 years ago

As an alternative, use the 'OpenSSL-Universal' pod:

pod 'OpenSSL-Universal', '~> 1.0'

julestburt commented 6 years ago

That is an alternative thanks - however it's another Pod we use that is bringing in OpenSSL...so not an easy switch. Just frustrating that this pod has no issue on our other two machines we develop on - just the Jenkins slave box...

harshalkhandare commented 6 years ago

Downgrade cocoapods-downloader to version 1.2.0 as mentioned in https://github.com/FredericJacobs/OpenSSL-Pod/issues/49

julestburt commented 6 years ago

Hey - I really appreciate your time and comments. @hkhandare It worked as soon as I downgraded cocoa pods-downloader! Now we can continue building - and will work to remove dependency on this pod...

dhadseamit commented 6 years ago

Thanks marcelogoto,

marcelogoto is correct,your Xcode name should be default one i.e "XCode" mine was Xcode 9.2 ,Just rename it to XCode and it works

tristandl commented 5 years ago

@sevenbanks has the correct answer thank you! fyi if you're using bundler, just add:

gem 'cocoapods-downloader', '1.2.0'

to your Gemfile and run bundle update cocoapods-downloader

tristandl commented 5 years ago

(or update open ssl pod and hope it's fixed?)

arcihrayan613 commented 5 years ago

Can't install Open SSL 1.0.2.13 pod in my Xcode Version 9.2 , Please Help me to slove this issue.