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

Install android tools r25.2.3 concurrently #639

Merged

Commits on Apr 20, 2017

  1. Backup archive.py state module from 2016.3

    The newer version of this module will prefer to use the unzip command
    instead of the python zipfile module for unzipping.
    This works around https://bugs.python.org/issue15795,
    namely a bug where the zipfile module does not respect permissions.
    This will fix our Android toolchain `archive.extracted` states.
    
    Note that this version of the module does not include
    saltstack/salt#36552,
    so keep the `archive_user` argument to `archive.extracted` states.
    
    `archive.extracted` sets ownership only on the `if_missing` path,
    so ensure Salt sets ownership on all the extracted files
    by unsetting `if_missing`, which defaults to `name`.
    This now refers to the top level extracted directory,
    so all extracted files will be properly owned by `servo/servo`,
    which ensures we are able to run the `android` command as the `servo`
    user to download the platform and build tools in the `cmd.run` state.
    
    Because the `unzip` binary will be used to extract the zip files,
    require the `android-dependencies` `pkg.installed` state from
    `archive.extracted` states that extract zip archives
    to ensure that the `unzip` binary is available.
    aneeshusa committed Apr 20, 2017
  2. Concurrently install Android r25.2.3 tools

    Install a new version of the Android tools along with the old one.
    Keep the old version as the current version for now to avoid breaking
    builds, but still make the new version available.
    This will also make future upgrades more smooth as well.
    
    Switch to the new URL scheme for SDK downloads,
    which also has switched to using zip files instead of .tar.gz files.
    Note that the new packaging format
    no longer has a top-level `android-sdk-linux` folder.
    
    Move the `build_tools` and `platform` attributes under `sdk`,
    as they are only used with the SDK-related states.
    
    Reinstate `if_missing` for the SDK `archive.extracted` state to ensure
    that the new archive will be extracted if the old one is present,
    so that the SDK has the correct directory layout.
    This also means ownership will only be updated for that file
    (the `android` binary), so add a `file.directory` state to handle
    fixing the ownership for the rest of the extracted files,
    and fixup the requisites as necessary.
    MortimerGoro authored and aneeshusa committed Apr 20, 2017
  3. Add prereq to clean out old SDK when upgrading

    The SDK layout has changed due to the new packaging format,
    so simply extracting the new archive over the old one will leave
    extraneous files around.
    To fix this, if we expect to make changes in the `archive.extracted`
    state, then completely remove the existing version of the SDK.
    
    Also, unlink the `current` symlink before making changes to an SDK
    to avoid processes inadverently using the SDK while it is being changed
    (the symlink will be restored once the SDK is done being updated.)
    aneeshusa committed Apr 20, 2017
  4. Update expect script to propagate return codes

    Unfortunately, the `android` tool always returns a 0 exit code even in
    case of failure, so this does not yet catch failures.
    However, the new `sdkmanager` tool seems to return appropriate exit
    codes, so this will kick in in the future.
    
    This will prevent errors from passing silently,
    such as bad executable bits or incorrect file permissions.
    aneeshusa committed Apr 20, 2017
  5. Add smoke test that Android SDK is installed properly

    The Android SDK installation states often have tricky changes
    due to upstream changes by Google,
    and additionally often fail silently in various different ways
    e.g. because the `android` tool always has a zero exit status.
    Additionally, some failures are not evident until Servo builds
    themselves start failing.
    
    Add a somke test in saltfs to catch common problems early on,
    and automatically run it on Travis.
    aneeshusa committed Apr 20, 2017
  6. Invalidate entire Salt cache on Travis

    This will clear the entire cache in between runs
    when running with SALT_FROM_SCRATCH=false.
    Originally, only sls and other files in the state tree were cleared,
    but since external modules and other files also need to be cleared,
    just clear everything for robustness.
    
    Additionally, move this to after we checkout the new code,
    since we sync everything after invalidating the cache,
    and we want to sync the new configuration instead of the old one.
    aneeshusa committed Apr 20, 2017
You can’t perform that action at this time.