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

Fail creating a cdep package for upload #25

Closed
sistr22 opened this issue Jun 28, 2017 · 11 comments
Closed

Fail creating a cdep package for upload #25

sistr22 opened this issue Jun 28, 2017 · 11 comments

Comments

@sistr22
Copy link

sistr22 commented Jun 28, 2017

I tried to follow the doc to create a cdep package and reach the point where I have to check the integrity of the .yml
So I run: ./cdep fetch upload/cdep-manifest.yml (I put the yml also under upload directory like in the doc)
And I have these errors:

FAILURE (170a12c): Cannot create property=android for JavaBean=io.cdep.cdep.yml.cdepmanifest.CDepManifestYml@604ed9f0
 in 'reader', line 1, column 1:
    coordinate:
    ^
Cannot create property=archives for JavaBean=io.cdep.cdep.yml.cdepmanifest.Android@91161c7
 in 'reader', line 14, column 3:
      dependencies:
      ^
Cannot create property=lib for JavaBean=io.cdep.cdep.yml.cdepmanifest.AndroidArchive@5c3bd550
 in 'reader', line 16, column 7:
        - file: jnihelper-libs.zip
          ^
Unable to find property 'lib' on class: io.cdep.cdep.yml.cdepmanifest.AndroidArchive
 in 'reader', line 23, column 12:
          lib: armeabi/libjni-framework.a
               ^

 in 'reader', line 16, column 5:
        - file: jnihelper-libs.zip
        ^

 in 'reader', line 14, column 3:
      dependencies:
      ^

FAILURE (6af7405): Manifest was missing coordinate
FAILURE (8313000): Manifest was missing coordinate.groupId
FAILURE (b495b50): Manifest was missing coordinate.artifactId
FAILURE (31ca81f): Manifest was missing coordinate.version
FAILURE (fa75282): Package ':' has malformed version, expected major.minor.point[-tweak] but there were no dots
FAILURE (71b3ede): Package ':' does not contain any files
FAILURE (6af7405): Manifest was missing coordinate
FAILURE (8313000): Manifest was missing coordinate.groupId
FAILURE (b495b50): Manifest was missing coordinate.artifactId
FAILURE (31ca81f): Manifest was missing coordinate.version
FAILURE (fa75282): Package ':' has malformed version, expected major.minor.point[-tweak] but there were no dots
FAILURE (71b3ede): Package ':' does not contain any files
Fetch complete
13 errors, exiting

I've attached my .yml (rename .txt because of github).
I'm specially worried about the first error:

in 'reader', line 1, column 1:
coordinate:

if "coordinate:" should not be the first line of the .yml, what should it be ?
cdep-manifest.txt

@jomof
Copy link
Collaborator

jomof commented Jun 28, 2017

The messages from SnakeYAML take a little getting used to. The relevant piece is this:

in 'reader', line 14, column 3:
dependencies:
^
You have a line with "dependencies:" under "android:" which is not valid. I think if you delete that line you should be able to proceed.

The following messages look like fallout from the failed parse, so that may be the only issue in the file.

I hope this helps. I'll leave this thread open in case there are followup issues in creating your package.

@sistr22
Copy link
Author

sistr22 commented Jun 28, 2017

Thx.
BTW I looked at the .yml here as an example: https://github.com/jomof/freetype/releases
specially that one:
https://github.com/jomof/freetype/releases/download/2.6.2-rev14/cdep-manifest-android.yml
and it currently has that dependencie line under android.

I know have that error:

FAILURE (a24c8ee): Cannot create property=android for JavaBean=io.cdep.cdep.yml.cdepmanifest.CDepManifestYml@5c3bd550
 in 'reader', line 1, column 1:
    coordinate:
    ^
Cannot create property=archives for JavaBean=io.cdep.cdep.yml.cdepmanifest.Android@5e3a8624
 in 'reader', line 14, column 3:
      archives:
      ^
Cannot create property=lib for JavaBean=io.cdep.cdep.yml.cdepmanifest.AndroidArchive@1bce4f0a
 in 'reader', line 15, column 7:
        - file: jnihelper-libs.zip
          ^
Unable to find property 'lib' on class: io.cdep.cdep.yml.cdepmanifest.AndroidArchive
 in 'reader', line 22, column 12:
          lib: armeabi/libjni-framework.a
               ^

 in 'reader', line 15, column 5:
        - file: jnihelper-libs.zip
        ^

 in 'reader', line 14, column 3:
      archives:
      ^

FAILURE (6af7405): Manifest was missing coordinate
FAILURE (8313000): Manifest was missing coordinate.groupId
FAILURE (b495b50): Manifest was missing coordinate.artifactId
FAILURE (31ca81f): Manifest was missing coordinate.version
FAILURE (fa75282): Package ':' has malformed version, expected major.minor.point[-tweak] but there were no dots
FAILURE (71b3ede): Package ':' does not contain any files
FAILURE (6af7405): Manifest was missing coordinate
FAILURE (8313000): Manifest was missing coordinate.groupId
FAILURE (b495b50): Manifest was missing coordinate.artifactId
FAILURE (31ca81f): Manifest was missing coordinate.version
FAILURE (fa75282): Package ':' has malformed version, expected major.minor.point[-tweak] but there were no dots
FAILURE (71b3ede): Package ':' does not contain any files
Fetch complete
13 errors, exiting

Does it mean it cannot find the lib: armeabi/libjni-framework.a inside the zip file ?
Here is the zip file:
jnihelper-libs.zip
Should I have one zip per lib ? Or can I put (as I did ) all the li9bs in the same zip ?

@jomof
Copy link
Collaborator

jomof commented Jun 28, 2017

You should put one ABI lib per zip. The reason is that CDep can download on-demand. Meaning a user who is only build/debugging armeabi can get going faster and many people will never need to download mips[64].

However, the error message you have is a parser error. I don't yet see the problem. Looking closer...

@jomof
Copy link
Collaborator

jomof commented Jun 28, 2017

The parser error can be fixed by changing to this line:
libs: [armeabi/libjni-framework.a]
from this line:
lib: armeabi/libjni-framework.a

I originally only supported one .a per zip but that was too limiting. I try to never break an existing package so there is a fallback codepath that lets the freetype lib pass (I still need to figure out why yours doesn't hit that path).

I was wrong about "dependencies:", that is valid schema. This is my punishment for answering before coffee.

@jomof
Copy link
Collaborator

jomof commented Jun 28, 2017

Okay, the reason your manifest didn't hit the fallback code path is because you have a license clause which wasn't supported then (so vCurrent doesn't allow single lib and vPrior doesn't allow license). Anyway, the best answer is to use libs: []. This will get you the most modern schema.

If you do end up publishing a package, let me know and I can add it to https://github.com/google/cdep/blob/master/smoke-test/cdep.yml (or you can) so that it will be tested on each CDep checkin.

@jomof
Copy link
Collaborator

jomof commented Jun 28, 2017

I made a PR to improve the error message when this happens to people:
#26

@sistr22
Copy link
Author

sistr22 commented Jun 29, 2017

Thx !
I'm slowly getting there:

FAILURE (ddf3605): SHA256 for file:/usr/local/google/home//dev/jni-helper/upload/jnihelper-lib-mips64.zip did not match constant from manifest
FAILURE (bb27723): SHA256 for file:/usr/local/google/home//dev/jni-helper/upload/jnihelper-lib-x86_64.zip did not match constant from manifest
FAILURE (e760893): SHA256 for file:/usr/local/google/home//dev/jni-helper/upload/jnihelper-lib-x86.zip did not match constant from manifest
FAILURE (fc8bfec): SHA256 for file:/usr/local/google/home//dev/jni-helper/upload/jnihelper-lib-armeabi-v7a.zip did not match constant from manifest
FAILURE (604605e): SHA256 for file:/usr/local/google/home//dev/jni-helper/upload/jnihelper-lib-armeabi.zip did not match constant from manifest
FAILURE (341b757): SHA256 for file:/usr/local/google/home//dev/jni-helper/upload/jnihelper-lib-mips.zip did not match constant from manifest
FAILURE (a33487a): SHA256 for file:/usr/local/google/home//dev/jni-helper/upload/jnihelper-lib-arm64-v8a.zip did not match constant from manifest

I'm trying to compute the sha256 from my gradle script using the ant task:

def headersZip = new File('../upload/jnihelper-headers.zip')
ant.checksum(file: headersZip, property: headersZip.name, algorithm: "SHA-256")
${ant.properties[headersZip.name]}

(gradle file attached for full reference)
It's obviously not what cdep expect, I will try to find out why very soon
build_dot_gradle.txt

@sistr22
Copy link
Author

sistr22 commented Jun 29, 2017

When I execute (in the command line) the shasum tool as per cdep doc I got:
shasum -a 256 jnihelper-lib-arm64-v8a.zip
4ab375e4f1b525619c88cc49bec91b7a39e722557f048b69467c32d9a52fc701 jnihelper-lib-arm64-v8a.zip
in my .yml manifest I have:

  • file: jnihelper-lib-arm64-v8a.zip
    sha256: 4ab375e4f1b525619c88cc49bec91b7a39e722557f048b69467c32d9a52fc701
    size: 240814
    ndk: r13b
    runtime: c++
    platform: 12
    abi: arm64-v8a
    libs: [libjni-framework.a]

I still have an error while running:
./cdep fetch upload/cdep-manifest.yml
FAILURE (a33487a): SHA256 for file:/usr/local/google/home/dmabin/dev/jni-helper/upload/jnihelper-lib-arm64-v8a.zip did not match constant from manifest

Same with all the others lib ...
I'm not sure what I'm doing wrong.

@sistr22
Copy link
Author

sistr22 commented Jun 29, 2017

BTW, here is the zip with everything
upload.zip

I still can't find what is wrong

@jomof
Copy link
Collaborator

jomof commented Jun 29, 2017

Your package works fine for me. I think what's happening is that you already have downloaded your package, then you changed something without incrementing the version number, so now your cached sha256 doesn't agree with your new sha256.

I think the best way to solve it is as follows.

$ cat cdep.yml
builders: [cmake]
dependencies:
- compile: ./upload/cdep-manifest.yml
$ ./cdep redownload
Redownloading file:/home/jomof/projects/tmp/upload/jnihelper-headers.zip
Redownloading file:/home/jomof/projects/tmp/upload/jnihelper-lib-x86_64.zip
Redownloading file:/home/jomof/projects/tmp/upload/jnihelper-lib-armeabi-v7a.zip
Redownloading file:/home/jomof/projects/tmp/upload/jnihelper-lib-armeabi.zip
Redownloading file:/home/jomof/projects/tmp/upload/jnihelper-lib-mips64.zip
Redownloading file:/home/jomof/projects/tmp/upload/jnihelper-lib-arm64-v8a.zip
Redownloading file:/home/jomof/projects/tmp/upload/jnihelper-lib-mips.zip
Redownloading file:/home/jomof/projects/tmp/upload/jnihelper-lib-x86.zip

This will force the new package to replace the old.

Let me know if that fixes it and I'll start looking at improving that error message.

@sistr22
Copy link
Author

sistr22 commented Jun 29, 2017

You were right !
Thx so much for the help (^_^)

@jomof jomof closed this as completed Jun 30, 2017
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

No branches or pull requests

2 participants