android-tools: init at 31.0.0p1#124992
Conversation
|
The good news is that only the vendored BoringSSL seems to use Go modules ( |
|
@primeos simg2img, img2simg and append2simg binaries are already provided by simg2img package. |
|
@musfay good to know. We should probably still use the bundled ones to avoid version conflicts (if they're used by the other tools) but then we should at least use |
| pname = "android-tools"; | ||
| version = "31.0.0p1"; | ||
|
|
||
| src = fetchurl { |
There was a problem hiding this comment.
Could this be using fetchFromGitHub?
There was a problem hiding this comment.
We need to use release tarball as the repo only have build-system and documentation. Upstream doesn't vendorize platform-tools source code in repo. They use CPack to create tarball from used source files.
https://github.com/nmeum/android-tools/tree/master/vendor
There was a problem hiding this comment.
How many sources would we need to declare in Nix to achieve the same? I'd prefer if all sources were declared transparently instead of relying on an opaque tarball.
There was a problem hiding this comment.
Well in that case we need to checkout some of AOSP repositories. Those repositories are actually HUGE and Google doesn't provide snapshots from tags. Checking out repositories takes nearly 1 hour on my computer.
There was a problem hiding this comment.
The whole tree is obviously huge but we shouldn't need all of it. That's why I was asking.
There was a problem hiding this comment.
We can declare the source files but there is 13-14 repos and lots of files all aroud the tree. Leaving the tracking job to CPack would be much easier. I don't agree tarballs are opaque as you can reproduce them. We can create our tarballs or vendorize CPack output in a repository.
There was a problem hiding this comment.
Is it legally OK if we mirror some of Google's repositories on other platforms like this one?
There was a problem hiding this comment.
there is 13-14 repos
Yeah, that's a bit much.
I don't agree tarballs are opaque as you can reproduce them.
The problem with that is that the reproduction is not transparent and in this case probably not even reproducible at a different point in time.
You don't know anything about how CPack was made nor which version of the sources it fetched.
Google's repo doesn't have a single "revision" or an equivalent; it's an aggregation of whatever happens to be at the top of a few hundred repos at a certain point in time.
It'd only become transparent if the generation was declared in Nix because then you'd have to lock the exact revision and hash of every included repo.
As I said though, too many repos. I was hoping for, like, 5 which would've been a feasible amount to maintain ourselves.
Is it legally OK if we mirror some of Google's repositories
The APL2 allows you to redistribute source code in any way you like but, why?
There was a problem hiding this comment.
I don't agree tarballs are opaque as you can reproduce them.
The problem with that is that the reproduction is not transparent and in this case probably not even reproducible at a different point in time.
You don't know anything about how CPack was made nor which version of the sources it fetched.
Google's repo doesn't have a single "revision" or an equivalent; it's an aggregation of whatever happens to be at the top of a few hundred repos at a certain point in time.
It'd only become transparent if the generation was declared in Nix because then you'd have to lock the exact revision and hash of every included repo.
It makes sense now. Thanks for the definition!
As I said though, too many repos. I was hoping for, like, 5 which would've been a feasible amount to maintain ourselves.
Yep there is lots of repos.
Is it legally OK if we mirror some of Google's repositories
The APL2 allows you to redistribute source code in any way you like but, why?
Just asked, offtopic.
|
I haven't done any extensive testing yet but while implementing a workaround for fetching the Go modules I've noticed that setting |
Oops. |
|
You'll probably have to set some Go environment variable to use /build for the build instead of $HOME. |
|
Ofborg fails too. We can create adb-boringssl package with required revision of boringssl as it's only required by adb. Using nixpkgs's boringssl also fails. |
|
Thanks, it looks like the Nix build sandboxing on my non-NixOS build host isn't properly working (anymore?). Edit: Force pushed again to fix the AArch64 build: |
|
I can confirm that everything works as expected. Flashed some images via fastboot. Tested adb through WiFi, pushed some files, had no issues. |
lowPrio is used to avoid collisions with the simg2img package. Licensing information is in share/licenses/android-tools/AOSP_LICENSE.
|
@musfay thanks for the testing! I've also used I'll merge this now (it works, we finally have a FLOSS package for adb and fastboot, and we can still improve the Nixpkgs expressions later - e.g. to generate the tarballs in a reproducible way). Edit: The Darwin build failure (just for future reference): |
|
Should we update programs.adb to use adb from here instead? |
|
Sounds like a good idea to me (cc @Mic92). |
| analog = callPackage ../tools/admin/analog {}; | ||
|
|
||
| android-tools = lowPrio (callPackage ../tools/misc/android-tools { | ||
| stdenv = if stdenv.targetPlatform.isAarch64 then gcc10Stdenv else stdenv; |
TODO:[ 52%] Built target fipsmodule
[ 52%] Generating chacha/chacha-x86_64.S
[ 52%] Generating test/trampoline-x86_64.S
[ 52%] Generating cipher_extra/aes128gcmsiv-x86_64.S
[ 52%] Generating cipher_extra/chacha20_poly1305_x86_64.S
[ 52%] Generating err_data.c
go: golang.org/x/[email protected]: Get "https://proxy.golang.org/golang.org/x/crypto/@v/v0.0.0-20200622213623-75b288015ac9.mod": dial tcp: lookup proxy.golang.org on [::1]:53: read udp [::1]:56418->[::1]:53: read: connection refused
make[2]: *** [vendor/boringssl/crypto/CMakeFiles/crypto.dir/build.make:104: vendor/boringssl/crypto/err_data.c] Error 1
make[2]: *** Deleting file 'vendor/boringssl/crypto/err_data.c'
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:1351: vendor/boringssl/crypto/CMakeFiles/crypto.dir/all] Error 2
make: *** [Makefile:171: all] Error 2
builder for '/nix/store/yib15nh8kzgrf94ijbgsjmbppcs59jij-android-tools-31.0.0p1.drv' failed with exit code 2
error: build of '/nix/store/yib15nh8kzgrf94ijbgsjmbppcs59jij-android-tools-31.0.0p1.drv' failed
Motivation for this change
See #75603 and #75603 (comment). This let's us finally build the Android tools from source.
Things done
sandboxinnix.confon non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"./result/bin/)