anestisb / android-prepare-vendor

Set of scripts to automate AOSP compatible vendor blobs generation from factory images
348 stars 155 forks source link

use bracketed object accessor syntax for older jq versions #167

Open asnelling opened 5 years ago

asnelling commented 5 years ago

As described in #166, the scripts may fail when parsing a device's config.json due to incorrect syntax with jq version 1.3 or below. This updates the filter strings passed to jq to use syntax that is compatible with both older and newer versions of jq.

Rationale

Although this repo ships with a jq v1.5 executable, it's nice to be able to use the system installed jq from your favorite distro's official package repositories. Particularly, official Android documentation suggests Ubuntu 14.04, whose official repositories only provide jq v1.3.

asnelling commented 5 years ago

The below commit includes a test script using the current latest jq version 1.6 as well as jq version 1.3, which is the last release before updates to the object access syntax.

asnelling/android-prepare-vendor@905ba00b609a5fdea1937417c751ad9b38525f21

I did not include this commit to avoid the "how to implement testing" can of worms.

thestinger commented 5 years ago

Although this repo ships with a jq v1.5 executable, it's nice to be able to use the system installed jq from your favorite distro's official package repositories.

Using the system version doesn't require supporting incredibly ancient versions of the tool.

Particularly, official Android documentation suggests Ubuntu 14.04, whose official repositories only provide jq v1.3.

I don't think that's good advice but rather very out-of-date information. You're assuming that the documentation that you're talking about is not many years out of date. This is what it says:

The Android build is routinely tested in house on recent versions of Ubuntu LTS (14.04) and Debian testing.

The fact that they're talking about Debian testing alongside Ubuntu 14.04 is a bit of a hint that the instructions are out-of-date. Debian jessie was released in 2015, stretch in 2017 and buster is the current stable. The current Debian testing is bullseye. I think that's a big hint that the instructions are very out-of-date. It's possible to build on Ubuntu 14.04, but I don't know why you would use it.

Ubuntu 14.04 doesn't have the build dependencies, and the instructions on that page for obtaining build dependencies are clearly extremely out-of-date and incorrect.

In general, you need to read the Android Open Source Project build documentation with the awareness that many parts of it are very out-of-date and primarily focused on development builds rather than creating production releases.

anestisb commented 4 years ago

@asnelling do you believe that we actually need this? Working now on adding support for Android 10 and Pixel4 devices and don't really want to run more unnecessary tests.