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

Upgrade Android SDK to API level 17 #71123

Closed
wants to merge 5 commits into from

Conversation

badboy
Copy link
Member

@badboy badboy commented Apr 14, 2020

This is a followup to the call for help.

It should upgrade the Android API level Rust is compiled against from 14 to 17.

For now all I did was replace 14 with 17 in the Dockerfiles, fix some comments, remove special-cased functions and fixed some imports.

Tested with the arm-android Docker image. Full log in a Gist.
I don't actually know if the upgrades work just like that or if it requires someone from infra to help out.

If this all does work out we could consider re-enabling the tests from #70958 to see how it goes.


Revisions:

  • The first round of this PR increased only to API level 16, but that would not have solved the posix_memalign issue, so I opted to go one higher.

@rust-highfive
Copy link
Collaborator

r? @kennytm

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 14, 2020
@Mark-Simulacrum
Copy link
Member

cc @joshtriplett for tiering policy

@bors
Copy link
Contributor

bors commented Apr 16, 2020

☔ The latest upstream changes (presumably #71180) made this pull request unmergeable. Please resolve the merge conflicts.

@badboy
Copy link
Member Author

badboy commented Apr 16, 2020

Happy to update the PR, once I get information if this approach is indeed the right one.

@Mark-Simulacrum
Copy link
Member

cc @rust-lang/compiler @rust-lang/release -- do we know of any reason not to do this? It looks reasonable to me given the usage figures and such.

@badboy -- could you enable to dist-android and arm-android on the "try" builder and then we can run that here to check if your changes work?

Something like this should work:

diff --git a/src/ci/azure-pipelines/try.yml b/src/ci/azure-pipelines/try.yml
index 38a0685e0f7..6244e1413d0 100644
--- a/src/ci/azure-pipelines/try.yml
+++ b/src/ci/azure-pipelines/try.yml
@@ -28,6 +28,8 @@ jobs:
       dist-x86_64-linux: {}
       dist-x86_64-linux-alt:
         IMAGE: dist-x86_64-linux
+      dist-android: {}
+      arm-android: {}
 
 # The macOS and Windows builds here are currently disabled due to them not being
 # overly necessary on `try` builds. We also don't actually have anything that

@badboy badboy force-pushed the android-api-level-upgrade branch from 390e178 to 603b7d0 Compare April 16, 2020 12:38
@badboy
Copy link
Member Author

badboy commented Apr 16, 2020

Done!

@pietroalbini
Copy link
Member

@bors try

@bors
Copy link
Contributor

bors commented Apr 16, 2020

⌛ Trying commit 603b7d0bbfa0897808274cc5b8b62d1e25cccb82 with merge d370f240f65cb60d4c29900f6ab94bf49e1533dd...

@XAMPPRocky
Copy link
Member

RE: Upgrading Android; I don't see any reason to not upgrade, but we should try to define a band of what API level to support. Someone who has more experience with the Android ecosystem would have to chime in here. It's my understanding that Google's supported versions doesn't necessarily line up with what being used by vendors.

@rust-highfive
Copy link
Collaborator

The job mingw-check of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2020-04-16T12:38:40.9451529Z ========================== Starting Command Output ===========================
2020-04-16T12:38:40.9454878Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/2e5b5b0a-09f6-4948-993c-df2df752d1f0.sh
2020-04-16T12:38:40.9455285Z 
2020-04-16T12:38:40.9460051Z ##[section]Finishing: Disable git automatic line ending conversion
2020-04-16T12:38:40.9476126Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/71123/merge to s
2020-04-16T12:38:40.9478779Z Task         : Get sources
2020-04-16T12:38:40.9478999Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-04-16T12:38:40.9479212Z Version      : 1.0.0
2020-04-16T12:38:40.9479394Z Author       : Microsoft
---
2020-04-16T12:38:42.3095229Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-04-16T12:38:42.3100801Z ##[command]git config gc.auto 0
2020-04-16T12:38:42.3103880Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-04-16T12:38:42.3106664Z ##[command]git config --get-all http.proxy
2020-04-16T12:38:42.3112708Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/71123/merge:refs/remotes/pull/71123/merge
---
2020-04-16T12:40:52.8106939Z  ---> 78ad2f4d4aca
2020-04-16T12:40:52.8107307Z Step 6/7 : ENV RUN_CHECK_WITH_PARALLEL_QUERIES 1
2020-04-16T12:40:52.8107736Z  ---> Using cache
2020-04-16T12:40:52.8108168Z  ---> 4d2dc61c4d00
2020-04-16T12:40:52.8109274Z Step 7/7 : ENV SCRIPT python3 ../x.py test src/tools/expand-yaml-anchors &&            python3 ../x.py check --target=i686-pc-windows-gnu --host=i686-pc-windows-gnu &&            python3 ../x.py build --stage 0 src/tools/build-manifest &&            python3 ../x.py test --stage 0 src/tools/compiletest &&            python3 ../x.py test src/tools/tidy &&            /scripts/validate-toolstate.sh
2020-04-16T12:40:52.8112406Z  ---> 776b6266a8b7
2020-04-16T12:40:52.8140663Z Successfully built 776b6266a8b7
2020-04-16T12:40:52.8177455Z Successfully tagged rust-ci:latest
2020-04-16T12:40:52.8417459Z Built container sha256:776b6266a8b7d63e2d3c2b5a784dbf521184a904fb10bf818c6b5c7e1ab74d4a
2020-04-16T12:40:52.8417459Z Built container sha256:776b6266a8b7d63e2d3c2b5a784dbf521184a904fb10bf818c6b5c7e1ab74d4a
2020-04-16T12:40:52.8440016Z Looks like docker image is the same as before, not uploading
2020-04-16T12:41:01.1408872Z [CI_JOB_NAME=mingw-check]
2020-04-16T12:41:01.1637421Z [CI_JOB_NAME=mingw-check]
2020-04-16T12:41:01.1657971Z == clock drift check ==
2020-04-16T12:41:01.1660784Z   local time: Thu Apr 16 12:41:01 UTC 2020
2020-04-16T12:41:01.5503825Z   network time: Thu, 16 Apr 2020 12:41:01 GMT
2020-04-16T12:41:01.5519165Z Starting sccache server...
2020-04-16T12:41:01.6377552Z configure: processing command line
2020-04-16T12:41:01.6381561Z configure: 
2020-04-16T12:41:01.6382342Z configure: rust.parallel-compiler := True
---
2020-04-16T12:44:07.2179151Z     Checking rustc_span v0.0.0 (/checkout/src/librustc_span)
2020-04-16T12:44:10.8510905Z     Checking rustc_errors v0.0.0 (/checkout/src/librustc_errors)
2020-04-16T12:44:11.8649234Z     Checking rustc_feature v0.0.0 (/checkout/src/librustc_feature)
2020-04-16T12:44:11.8926532Z     Checking fmt_macros v0.0.0 (/checkout/src/libfmt_macros)
2020-04-16T12:44:12.0489290Z     Checking rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
2020-04-16T12:44:12.6762687Z     Checking rustc_hir v0.0.0 (/checkout/src/librustc_hir)
2020-04-16T12:44:12.7351728Z     Checking rustc_session v0.0.0 (/checkout/src/librustc_session)
2020-04-16T12:44:13.9831616Z     Checking rustc_attr v0.0.0 (/checkout/src/librustc_attr)
2020-04-16T12:44:14.3693056Z     Checking rustc_parse v0.0.0 (/checkout/src/librustc_parse)
---
2020-04-16T12:45:44.6234770Z configure: rust.channel         := nightly
2020-04-16T12:45:44.6235354Z configure: build.cargo-native-static := True
2020-04-16T12:45:44.6235961Z configure: rust.debug-assertions := True
2020-04-16T12:45:44.6236647Z configure: build.locked-deps    := True
2020-04-16T12:45:44.6237356Z configure: build.configure-args := ['--enable-sccache', '--disable-manage-submodu ...
2020-04-16T12:45:44.6238154Z configure: writing `config.toml` in current directory
2020-04-16T12:45:44.6238485Z configure: 
2020-04-16T12:45:44.6239010Z configure: run `python /checkout/x.py --help`
2020-04-16T12:45:44.6239391Z configure: 
---
2020-04-16T12:47:00.3302447Z Hugepagesize:       2048 kB
2020-04-16T12:47:00.3302614Z DirectMap4k:      135104 kB
2020-04-16T12:47:00.3302769Z DirectMap2M:     3010560 kB
2020-04-16T12:47:00.3302938Z DirectMap1G:     6291456 kB
2020-04-16T12:47:00.3303464Z + python3 ../x.py test src/tools/expand-yaml-anchors
2020-04-16T12:47:01.4508686Z Ensuring the YAML anchors in the GitHub Actions config were expanded
2020-04-16T12:47:01.4508686Z Ensuring the YAML anchors in the GitHub Actions config were expanded
2020-04-16T12:47:01.4538045Z Building stage0 tool expand-yaml-anchors (x86_64-unknown-linux-gnu)
2020-04-16T12:47:01.6374216Z    Compiling unicode-xid v0.2.0
2020-04-16T12:47:01.7405883Z    Compiling syn v1.0.11
2020-04-16T12:47:02.4501857Z    Compiling linked-hash-map v0.5.2
2020-04-16T12:47:02.4961837Z    Compiling lazy_static v1.4.0
2020-04-16T12:47:02.4961837Z    Compiling lazy_static v1.4.0
2020-04-16T12:47:02.6439700Z    Compiling yaml-rust v0.4.3
2020-04-16T12:47:06.3390920Z    Compiling quote v1.0.2
2020-04-16T12:47:18.3918812Z    Compiling thiserror-impl v1.0.5
2020-04-16T12:47:22.2995356Z    Compiling thiserror v1.0.5
2020-04-16T12:47:22.3502859Z    Compiling yaml-merge-keys v0.4.0
2020-04-16T12:47:23.3286136Z    Compiling expand-yaml-anchors v0.1.0 (/checkout/src/tools/expand-yaml-anchors)
2020-04-16T12:47:24.7398783Z Build completed successfully in 0:00:24
2020-04-16T12:47:24.7473547Z + python3 ../x.py check --target=i686-pc-windows-gnu --host=i686-pc-windows-gnu
2020-04-16T12:47:24.9548648Z     Finished dev [unoptimized] target(s) in 0.13s
2020-04-16T12:47:25.8211615Z Checking rustdoc artifacts (x86_64-unknown-linux-gnu -> i686-pc-windows-gnu)
---
2020-04-16T12:49:10.1022197Z     Checking rustc_feature v0.0.0 (/checkout/src/librustc_feature)
2020-04-16T12:49:10.1997664Z     Checking fmt_macros v0.0.0 (/checkout/src/libfmt_macros)
2020-04-16T12:49:10.3713210Z     Checking rustc_ast_pretty v0.0.0 (/checkout/src/librustc_ast_pretty)
2020-04-16T12:49:10.4547682Z     Checking rustc_hir v0.0.0 (/checkout/src/librustc_hir)
2020-04-16T12:49:10.8894221Z     Checking rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
2020-04-16T12:49:12.7824943Z     Checking rustc_attr v0.0.0 (/checkout/src/librustc_attr)
2020-04-16T12:49:13.1735169Z     Checking rustc_parse v0.0.0 (/checkout/src/librustc_parse)
2020-04-16T12:49:14.8642469Z     Checking rustc_hir_pretty v0.0.0 (/checkout/src/librustc_hir_pretty)
2020-04-16T12:49:15.2483300Z     Checking rustc_ast_lowering v0.0.0 (/checkout/src/librustc_ast_lowering)
---
2020-04-16T12:52:40.4260002Z Diff in /checkout/src/libstd/sys/unix/alloc.rs at line 52:
2020-04-16T12:52:40.4264318Z      }
2020-04-16T12:52:40.4268235Z  }
2020-04-16T12:52:40.4272361Z  
2020-04-16T12:52:40.4278773Z -#[cfg(any(
2020-04-16T12:52:40.4282942Z -    target_os = "illumos",
2020-04-16T12:52:40.4287074Z -    target_os = "redox",
2020-04-16T12:52:40.4291179Z -    target_os = "solaris"
2020-04-16T12:52:40.4295218Z -))]
2020-04-16T12:52:40.4313120Z +#[cfg(any(target_os = "illumos", target_os = "redox", target_os = "solaris"))]
2020-04-16T12:52:40.4313374Z  #[inline]
2020-04-16T12:52:40.4313910Z  unsafe fn aligned_malloc(layout: &Layout) -> *mut u8 {
2020-04-16T12:52:40.4314178Z      // On platforms where `posix_memalign` is unavailable, we use `memalign`.
2020-04-16T12:52:40.4314463Z Diff in /checkout/src/libstd/sys/unix/alloc.rs at line 83:
2020-04-16T12:52:40.4314708Z      libc::memalign(layout.align(), layout.size()) as *mut u8
2020-04-16T12:52:40.4314988Z  
2020-04-16T12:52:40.4314988Z  
2020-04-16T12:52:40.4315247Z -#[cfg(not(any(
2020-04-16T12:52:40.4315517Z -    target_os = "illumos",
2020-04-16T12:52:40.4316015Z -    target_os = "redox",
2020-04-16T12:52:40.4316294Z -    target_os = "solaris"
2020-04-16T12:52:40.4316531Z -)))]
2020-04-16T12:52:40.4316870Z +#[cfg(not(any(target_os = "illumos", target_os = "redox", target_os = "solaris")))]
2020-04-16T12:52:40.4317079Z  #[inline]
2020-04-16T12:52:40.4317439Z  unsafe fn aligned_malloc(layout: &Layout) -> *mut u8 {
2020-04-16T12:52:40.4317665Z      let mut out = ptr::null_mut();
2020-04-16T12:52:40.4318344Z Running `"/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/rustfmt" "--config-path" "/checkout" "--edition" "2018" "--unstable-features" "--skip-children" "--check" "/checkout/src/libstd/sys/unix/alloc.rs"` failed.
2020-04-16T12:52:40.4319023Z If you're running `tidy`, try again with `--bless` flag. Or, you just want to format code, run `./x.py fmt` instead.
2020-04-16T12:52:40.4324713Z Build completed unsuccessfully in 0:00:36
2020-04-16T12:52:40.4413444Z == clock drift check ==
2020-04-16T12:52:40.4413444Z == clock drift check ==
2020-04-16T12:52:40.4428905Z   local time: Thu Apr 16 12:52:40 UTC 2020
2020-04-16T12:52:40.6523126Z   network time: Thu, 16 Apr 2020 12:52:40 GMT
2020-04-16T12:52:42.1500789Z 
2020-04-16T12:52:42.1500789Z 
2020-04-16T12:52:42.1560942Z ##[error]Bash exited with code '1'.
2020-04-16T12:52:42.1572115Z ##[section]Finishing: Run build
2020-04-16T12:52:42.1608284Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/71123/merge to s
2020-04-16T12:52:42.1612465Z Task         : Get sources
2020-04-16T12:52:42.1612710Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-04-16T12:52:42.1612944Z Version      : 1.0.0
2020-04-16T12:52:42.1613099Z Author       : Microsoft
2020-04-16T12:52:42.1613099Z Author       : Microsoft
2020-04-16T12:52:42.1613341Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-04-16T12:52:42.1613648Z ==============================================================================
2020-04-16T12:52:42.4327103Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-04-16T12:52:42.4360066Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/71123/merge to s
2020-04-16T12:52:42.4436787Z Cleaning up task key
2020-04-16T12:52:42.4437883Z Start cleaning up orphan processes.
2020-04-16T12:52:42.4604862Z Terminate orphan process: pid (3704) (python)
2020-04-16T12:52:42.4783708Z ##[section]Finishing: Finalize Job

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @rust-lang/infra. (Feature Requests)

@badboy
Copy link
Member Author

badboy commented Apr 16, 2020

Gnaaah, formatting error, because now that it's one item less it should be on a single line.

@ollie27
Copy link
Member

ollie27 commented Apr 16, 2020

I think it would be also be worth updating https://forge.rust-lang.org/release/platform-support.html to include the minimum supported API level.

The workarounds for missing ftruncate64, pread64 and pwrite64 can presumably be removed now as they all seem to be available in API level 16.

@badboy
Copy link
Member Author

badboy commented Apr 16, 2020

I think it would be also be worth updating forge.rust-lang.org/release/platform-support.html to include the minimum supported API level.

The workarounds for missing ftruncate64, pread64 and pwrite64 can presumably be removed now as they all seem to be available in API level 16.

Happy to tackle that, once this actually sticks.

@bors
Copy link
Contributor

bors commented Apr 16, 2020

💔 Test failed - checks-azure

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 16, 2020
@nikomatsakis
Copy link
Contributor

I don't see any reason not to do it, but I'm not that familiar with android. It'd be great if we had some go-to folks to ping on these matters.

@jonas-schievink jonas-schievink added O-android Operating system: Android relnotes Marks issues that should be documented in the release notes of the next release. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Apr 16, 2020
@jonas-schievink jonas-schievink added this to the 1.44 milestone Apr 16, 2020
@badboy
Copy link
Member Author

badboy commented Apr 16, 2020

couldn't find required command: "/android/ndk/arm-14/bin/arm-linux-androideabi-clang"

I missed an arm-14 ...

@badboy badboy force-pushed the android-api-level-upgrade branch from 603b7d0 to 408da63 Compare April 16, 2020 16:43
@badboy
Copy link
Member Author

badboy commented Apr 16, 2020

@bors try

(I assume I can't actually do that)

@bors
Copy link
Contributor

bors commented Apr 16, 2020

@badboy: 🔑 Insufficient privileges: not in try users

@Dylan-DPC-zz
Copy link

@bors try

@Elinvynia Elinvynia added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 20, 2020
@Elinvynia Elinvynia added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 27, 2020
@dtolnay dtolnay added T-libs Relevant to the library team, which will review and decide on the PR/issue. and removed T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels May 28, 2020
@Elinvynia Elinvynia added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 3, 2020
@Dylan-DPC-zz
Copy link

@badboy any updates?

@badboy
Copy link
Member Author

badboy commented Jun 3, 2020

Unfortunately not. I have not yet had the time to re-run the tests to reproduce the issue first.

@Elinvynia Elinvynia added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 10, 2020
@bors
Copy link
Contributor

bors commented Jun 12, 2020

☔ The latest upstream changes (presumably #73276) made this pull request unmergeable. Please resolve the merge conflicts.

@Manishearth
Copy link
Member

@bors rollup=never

@Dylan-DPC-zz Dylan-DPC-zz modified the milestones: 1.46, 1.47 Jul 18, 2020
@Muirrum Muirrum added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 6, 2020
@Dylan-DPC-zz Dylan-DPC-zz modified the milestones: 1.47, 1.48 Aug 24, 2020
@Dylan-DPC-zz
Copy link

I'm closing this due to inactivity.

@Dylan-DPC-zz Dylan-DPC-zz added S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. relnotes Marks issues that should be documented in the release notes of the next release. labels Sep 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-android Operating system: Android S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.