ocaml-cross / opam-cross-android

An OCaml cross-toolchain for Android and several useful libraries
105 stars 15 forks source link

opam install fails on Fedora 21 x64 #4

Closed psteckler closed 9 years ago

psteckler commented 9 years ago

Running

"ANDROID_LEVEL=21 ANDROID_ABI=linux_eabi ANDROID_ARCH=armv7 opam install ocaml-android"

gives the following error message:

"# ERROR while installing android-ndk-linux.10d #" "# opam-version 1.2.1~rc2" "# os linux" /home/steck/.opam/packages.dev/android-ndk-linux.10d/android-ndk-r10d-linux-x86.bin is not a valid tar archive.

I can unpack that archive by making it executable and running it. But I can't run tar -x on it by hand.

whitequark commented 9 years ago

Can you try with opam 1.1?

psteckler commented 9 years ago

I'm using the current opam package for Fedora 21. I'd rather not have to build opam specially for a particular package.

whitequark commented 9 years ago

I've filed https://github.com/ocaml/opam/issues/2099 but I'm afraid you have no other choice right now.

psteckler commented 9 years ago

ok

avsm commented 9 years ago

Why not wrap the bin file in a valid tar?

On 3 Apr 2015, at 17:34, whitequark notifications@github.com wrote:

I've filed ocaml/opam#2099 but I'm afraid you have no other choice right now.

— Reply to this email directly or view it on GitHub.

whitequark commented 9 years ago

It's a 600MB download from Google, I'm not re-hosting it

avsm commented 9 years ago

http://www.cl.cam.ac.uk/~avsm2/opam-mirror/android-ndk-r10d-darwin-x86.bin.tgz http://www.cl.cam.ac.uk/~avsm2/opam-mirror/android-ndk-r10d-linux-x86.bin.tgz

(temporarily until the OPAM bug is fixed)

On 3 Apr 2015, at 17:41, whitequark notifications@github.com wrote:

It's a 600MB download from Google, I'm not re-hosting it

— Reply to this email directly or view it on GitHub.

whitequark commented 9 years ago

Thanks! @psteckler I think you can opam pin android-ndk-linux http://www.cl.cam.ac.uk/~avsm2/opam-mirror/android-ndk-r10d-linux-x86.bin.tgz.

cbobed commented 9 years ago

Hi,

I'm trying to install the ocaml crosscompiler and I'm having a similar problem in Ubuntu 14.10. I'm using opam 1.2, and I have pinned the android-ndk-linux to the provided URL by:

opam pin add android-ndk-linux http://www.cl.cam.ac.uk/~avsm2/opam-mirror/android-ndk-r10d-linux-x86.bin.tgz

The problem with the original repo does not happen, but instead:

=== ERROR while installing android-ndk-linux.10d =============================

opam-version 1.2.1 os linux The archive "/home/siduser/.opam/4.02.1+32bit/packages.dev/android-ndk-linux/android-ndk-r10d-linux-x86.bin.tgz" contains multiple root directories.

Am I missing anything? I've also tried to make the .tar.gz on my own, using as .bin file the one for 64 bits architectures, but the same problem arises (I'm not used at using opam and packaging at all ).

Thanks in advance,

whitequark commented 9 years ago

@avsm, ideas?

vouillon commented 9 years ago

opam expects tar files to contain a single directory (and the files below). Here, the tar file contains a single file (not a directory). Hence the error.

The opam error message is confusing because in fact there are not multiple but zero root directories.

cbobed commented 9 years ago

I've delved a little more on this, and, if I first install ocaml-android, the ndk 10b is installed without problems.

Then, I add the opam-android repository, and the problem arises when upgrading to version 10d (ocamlfind is correctly installed): The following actions will be performed: ↗ upgrade android-ndk-linux 10b to 10d [required by ocaml-android32] ∗ install ocaml-android32 4.02.1
↻ recompile ocaml-android 4.01.0 [uses android-ndk-linux]

The results:

=== ERROR while installing android-ndk-linux.10d =============================

opam-version 1.2.1 os linux /home/siduser/.opam/packages.dev/android-ndk-linux.10d/android-ndk-r10d-linux-x86.bin is not a valid tar archive.

=-=- Error report -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= The following actions were aborted ∗ install ocaml-android 4.01.0 ∗ install ocaml-android32 4.02.1 The following actions failed ∗ install android-ndk-linux 10d The following changes have been performed ⊘ remove android-ndk-linux 10b
⊘ remove ocaml-android 4.01.0

cbobed commented 9 years ago

I've installed it by compressing the downloaded .bin and pinning it locally ... now, I've got another problems, but they seem to be related to the gcc version that's installed in my system.

It was the .tgz file, thank you very much for the quick response!

whitequark commented 9 years ago

Your log is bizarre. There is no package ocaml-android.4.01.0 (and never was! I made this repo for 4.02 specifically.) Further I never had r10b, it was r10c and then r10d.

cbobed commented 9 years ago

I've used the repository by @vouillon to install just ocaml-android and those were the versions that were installed. Then, I've added opam-android repository and I was asked to upgrade them (maybe that's the possible confusion).

whitequark commented 9 years ago

These aren't supposed to be used together and they're definitely incompatible. (Though that will not fix your tgz error.)

cbobed commented 9 years ago

I've started with a fresh installation of just opam-android and the comment of @vouillon, which made it possible to install android-ndk-linux-r10d. As soon as I have it working, I'll post the steps I've followed if you consider them interesting :)

whitequark commented 9 years ago

I would really rather see opam fixed but this would help other people meanwhile, so please do.

cbobed commented 9 years ago

Sure! :)

cbobed commented 9 years ago

In the end, meanwhile opam is fixed, these are the steps I've followed: 1) follow the instructions in https://github.com/whitequark/opam-android exactly until the installation of ocaml-android 2) execute as explained: ANDROID_LEVEL=21 ANDROID_ABI=linux_eabi ANDROID_ARCH=armv7 opam install ocaml-android 3) it fails, but you will have the .bin file in .opam/packages.dev/android* (you might have to look on different folders depending on the selected compiler). 4) make a dir (as @vouillon suggested) (e.g. android-ndk-r10d) and put the .bin file into it. 5) compress that directory with tar into a tgz file (e.g., android.tgz) 6) select that file as the source for android-ndk-linux: opam pin add android-ndk-linux ./android.tgz 7) re-execute: ANDROID_LEVEL=21 ANDROID_ABI=linux_eabi ANDROID_ARCH=armv7 opam install ocaml-android

This should suffice to have it working (at least, until the opam install method is fixed).

whitequark commented 9 years ago

I believe this is fixed upstream.