I think adding a very long list of URLs and shasums to the rbm config file is not the best way to do it.
Maybe generating one tar file containing all the dependencies is better. Is the generated maven-repo.tar.gz reproducible? Will different people generating it at a different time get the same archive?
The archive will be reproducible. I see two obvious options: 1) generate the tar independently of RBM, upload the tar to some location and then include the URL in the android-toolchain config. or 2) include the program that generates the archive as part of the RBM build (an RBM project?).
In the case of (2) I will need some guidance how that should be done.
If later we choose option (2), we can create a project that will download artc source and build it with our version of rust. I noticed there is an exec option in rbm input_files. Could this be used to exec a compiled version of artc to download and package the maven repo?
If later we choose option (2), we can create a project that will download artc source and build it with our version of rust. I noticed there is an exec option in rbm input_files. Could this be used to exec a compiled version of artc to download and package the maven repo?
Yes, it might be possible to do that with the exec option. However it will probably make things more complicate for #23401 (moved).
For a review of commit 27604107dca4992aac4a2f3b015f5a7c4273a606:
does maven-repo-1.0.tar.gz contains the dependencies that are specific to firefox? If so then I think it should be moved to projects/firefox/config instead of projects/android-toolchain/config. In the future android-toolchain will be used to build other components than firefox, such as Tor.
the name of the file README.ANDROID is a little confusing, as it doesn't really talk about android but only about how to generate a maven repo archive. Maybe that could be renamed to something like projects/firefox/how-to-generate-maven-repo.txt?
curl https://sh.rustup.rs -sSf | sh does not look like a safe way to install rust. Would that work if we just suggested installing the rustc package from the distribution?
I don't know much about cargo, but do I understand correctly that cargo install artc is downloading artc binaries from https://crates.io/? If so, is there some way this can be done by building https://github.com/sisbell/artc from sources?
How was download-urls-1.0.txt from https://github.com/sisbell/tor-android-repo generated? Maybe we should include that file directly into tor-browser-build (for instance in the projects/firefox directory) instead of storing it in a separate git repo.
Looking at the content of https://github.com/sisbell/tor-android-repo/blob/master/download-urls-1.0.txt and the content of the maven-repo-1.0.tar.gz archive, it seems that the archive simply contains the files listed in download-urls-1.0.txt in the same directories as the URLs. Is there more than that in the process to generate the maven repo? If not then it seems to me a little overkill to require a rust program to generate that archive.
I think we could add sha256sums to the download-urls-1.0.txt file, and then it would not be very complicate to write a shell script that download each file, check its checksum, extract the directory from the URL and move the file to that directory. We could then use this script within an exec of an input_file, similarly to what is done in projects/firefox-langpacks/config.
I only looked at the content of maven-repo-1.0.tar.gz quickly, so I may have missed something. Is there something that I missed in the process of generating the maven repo?
For a review of commit 27604107dca4992aac4a2f3b015f5a7c4273a606:
does maven-repo-1.0.tar.gz contains the dependencies that are specific to firefox? If so then I think it should be moved to projects/firefox/config instead of projects/android-toolchain/config. In the future android-toolchain will be used to build other components than firefox, such as Tor.
A lot of these artifacts will be duplicated between projects, meaning we may be downloading and archiving multiple times. Would that be a problem?
the name of the file README.ANDROID is a little confusing, as it doesn't really talk about android but only about how to generate a maven repo archive. Maybe that could be renamed to something like projects/firefox/how-to-generate-maven-repo.txt?
Sounds good
curl https://sh.rustup.rs -sSf | sh does not look like a safe way to install rust. Would that work if we just suggested installing the rustc package from the distribution?
It can be downloaded and used like we do in projects/rust
I don't know much about cargo, but do I understand correctly that cargo install artc is downloading artc binaries from https://crates.io/? If so, is there some way this can be done by building https://github.com/sisbell/artc from sources?
crates just has the source and builds from that. ~/.cargo/registry/src/artc contains the source. But yes, it can also be downloaded directly from git and run.
How was download-urls-1.0.txt from https://github.com/sisbell/tor-android-repo generated? Maybe we should include that file directly into tor-browser-build (for instance in the projects/firefox directory) instead of storing it in a separate git repo.
I put info on how its generated in the readme file of the tor-android-repo. Basically, I just grep the gradle logs and pull out the URLS.
Looking at the content of https://github.com/sisbell/tor-android-repo/blob/master/download-urls-1.0.txt and the content of the maven-repo-1.0.tar.gz archive, it seems that the archive simply contains the files listed in download-urls-1.0.txt in the same directories as the URLs. Is there more than that in the process to generate the maven repo? If not then it seems to me a little overkill to require a rust program to generate that archive.
I think we could add sha256sums to the download-urls-1.0.txt file, and then it would not be very complicate to write a shell script that download each file, check its checksum, extract the directory from the URL and move the file to that directory. We could then use this script within an exec of an input_file, similarly to what is done in projects/firefox-langpacks/config.
I only looked at the content of maven-repo-1.0.tar.gz quickly, so I may have missed something. Is there something that I missed in the process of generating the maven repo?
Its a little more complicated but not by much. Basically, it checks extensions to see if it has gpg signature for an artifact and if so then verifies it with a key from key server. If there is no gpg sig, then it looks for a sha2 file and verifies that. If there is no sha2, then it just generates one and flags it. (it could go on to check sha1, md5 but I didn't implement that). I'm ok either way with script or artc. Would that require different scripts for each platform we build on?
Its a little more complicated but not by much. Basically, it checks extensions to see if it has gpg signature for an artifact and if so then verifies it with a key from key server. If there is no gpg sig, then it looks for a sha2 file and verifies that. If there is no sha2, then it just generates one and flags it. (it could go on to check sha1, md5 but I didn't implement that). I'm ok either way with script or artc. Would that require different scripts for each platform we build on?
If I understand correctly the sources of artc, a signature made by any key that is available on pgp.mit.edu will be accepted, so that does not seem very useful as anybody can generate a key and upload it there. A sha file that is hosted on the same server as the file we download is also not very useful as someone able to modify the file on the server will probably also be able to modify the sha file too.
Its a little more complicated but not by much. Basically, it checks extensions to see if it has gpg signature for an artifact and if so then verifies it with a key from key server. If there is no gpg sig, then it looks for a sha2 file and verifies that. If there is no sha2, then it just generates one and flags it. (it could go on to check sha1, md5 but I didn't implement that). I'm ok either way with script or artc. Would that require different scripts for each platform we build on?
If I understand correctly the sources of artc, a signature made by any key that is available on pgp.mit.edu will be accepted, so that does not seem very useful as anybody can generate a key and upload it there. A sha file that is hosted on the same server as the file we download is also not very useful as someone able to modify the file on the server will probably also be able to modify the sha file too.