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

Start on Mach package #11210

Merged
merged 1 commit into from Jun 6, 2016
Merged

Start on Mach package #11210

merged 1 commit into from Jun 6, 2016

Conversation

@edunham
Copy link
Contributor

edunham commented May 16, 2016

Thank you for contributing to Servo! Please replace each [ ] by [X] when the step is complete, and replace __ with appropriate data:

  • ./mach build -d does not report any errors
    • these changes don't touch anything that mach build touches>
  • ./mach test-tidy --faster does not report any errors
    • Tidy errors on some dependencies that I think we'll need for real package but aren't using for android
  • These changes address #9918 (github issue number if applicable).

Either:

  • There are tests for these changes OR
  • These changes do not require tests because I don't think Mach has tests yet?

Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process.


This change is Reviewable

@highfive
Copy link

highfive commented May 16, 2016

Heads up! This PR modifies the following files:

  • @wafflespeanut: python/mach_bootstrap.py, python/servo/package_commands.py, python/servo/post_build_commands.py
@nox
Copy link
Member

nox commented May 16, 2016

This fails tidy.

$ ./mach test-tidy --no-progress
Checking files for tidiness...
./python/servo/package_commands.py:12: F401 'glob' imported but unused
./python/servo/package_commands.py:16: F401 'copy2' imported but unused
./python/servo/package_commands.py:16: F401 'copytree' imported but unused
./python/servo/package_commands.py:16: F401 'rmtree' imported but unused
./python/servo/package_commands.py:26: F401 'call' imported but unused
./python/servo/package_commands.py:26: F401 'check_call' imported but unused
./python/servo/package_commands.py:28: E302 expected 2 blank lines, found 1
./python/servo/post_build_commands.py:26: F401 'BuildNotFound' imported but unused
@nox nox added the S-fails-tidy label May 16, 2016
@edunham
Copy link
Contributor Author

edunham commented May 16, 2016

@nox yep, I noted that in the amazing PR template which reminded me to run Tidy. PR is up mainly so @larsberg and I can point at it and discuss.

@nox
Copy link
Member

nox commented May 16, 2016

@edunham Oh sorry. :( I'm so accustomed to seeing this snippet of text that I don't notice unusual things in it anymore...

apk_path = binary_path + ".apk"
if not path.exists(apk_path):
result = Registrar.dispatch("package", context=self.context, release=release, dev=dev)
if result is not 0:

This comment has been minimized.

Copy link
@frewsxcv

frewsxcv May 18, 2016

Member

The is binary operator is used to check references. i.e., (IIRC) it's possible for multiple instances of 0 to exist in memory, so this is not guaranteed to always pass. Whereas singletons, like None, True, and False only exist once in memory so is is okay. So this should maybe be an != operator instead

@larsbergstrom
Copy link
Contributor

larsbergstrom commented May 26, 2016

Reviewed 2 of 2 files at r1, 2 of 2 files at r2.
Review status: all files reviewed at latest revision, 1 unresolved discussion, some commit checks failed.


Comments from Reviewable

@larsbergstrom
Copy link
Contributor

larsbergstrom commented May 26, 2016

@edunham If you address the comment from @frewsxcv, we can land this. Or, you can add the initial packaging steps for mac/linux/etc. and we can go from there. Whichever you'd prefer!

@edunham edunham force-pushed the edunham:mach-package branch from 337c117 to 2d69d2b May 31, 2016
@edunham edunham force-pushed the edunham:mach-package branch from 2d69d2b to c398399 May 31, 2016
@highfive
Copy link

highfive commented May 31, 2016

New code was committed to pull request.

@edunham
Copy link
Contributor Author

edunham commented May 31, 2016

@larsbergstrom Latest commits do naive packaging for OSX/Linux, including creating ./runservo.sh to invoke Servo with browserhtml.

Next steps:

  • Implement a blacklist or whitelist to nuke unneeded files from the release directory -- I've tried messing around with it a little but don't have a deep enough understanding of how Servo works to make good guesses on what's safe to eliminate. Arguably, the presence of any unneeded files in the release directory is actually an error in the build step anyways. edit: done in next commit after this comment
  • Tweak tarball naming if desired -- it's currently of the form 2016-05-31-1053-servo-tech-demo.tar.gz. I've included an hour/minute timestamp for now to assist with debugging -- I imagine we'll run into circumstances where we wonder whether a tarball was built before or after a specific patch landed. Longer-term, we may want to either take a name suffix argument to mach package or munge the names during upload, to differentiate nightlies from other releases.
  • Make the builders run it & upload the artefacts
edunham added a commit to edunham/servo that referenced this pull request May 31, 2016
@edunham edunham force-pushed the edunham:mach-package branch 4 times, most recently from 63d4672 to 79b983e May 31, 2016
@highfive
Copy link

highfive commented May 31, 2016

New code was committed to pull request.

@edunham
Copy link
Contributor Author

edunham commented May 31, 2016

@larsbergstrom It's all squashed up and ready for final review :)

@CommandProvider
class PackageCommands(CommandBase):
@Command('package',
description='Package Servo (currently, Android APK only)',

This comment has been minimized.

Copy link
@larsbergstrom

larsbergstrom Jun 1, 2016

Contributor

This comment is now incorrect :-)

@larsbergstrom
Copy link
Contributor

larsbergstrom commented Jun 1, 2016

After fixing the one total nit, please squash and r=me!

@jdm
Copy link
Member

jdm commented Jun 2, 2016

Checking files for tidiness...

./python/servo/package_commands.py:30: E302 expected 2 blank lines, found 1

./python/servo/package_commands.py:34: E261 at least two spaces before inline comment

./python/servo/package_commands.py:36: E302 expected 2 blank lines, found 1
@jdm jdm removed the S-tests-failed label Jun 2, 2016
@larsbergstrom
Copy link
Contributor

larsbergstrom commented Jun 3, 2016

@edunham Please fix tidy and r=me.

description='Install Servo (currently, Android only)',
category='package')
@CommandArgument('--release', '-r', action='store_true',
help='Package the release build')

This comment has been minimized.

Copy link
@aneeshusa

aneeshusa Jun 3, 2016

Member

'Package' -> 'Install'

@CommandArgument('--release', '-r', action='store_true',
help='Package the release build')
@CommandArgument('--dev', '-d', action='store_true',
help='Package the dev build')

This comment has been minimized.

Copy link
@aneeshusa

aneeshusa Jun 3, 2016

Member

'Package' -> 'Install'

os.close(runservo)
print("Creating tarball")
tar_path = '/'.join(dir_to_package.split('/')[:-1]) + '/'
tar_path += time.strftime('%Y-%m-%d-%H%M') + "-servo-tech-demo.tar.gz"

This comment has been minimized.

Copy link
@aneeshusa

aneeshusa Jun 3, 2016

Member

Can we please use ISO 8601 format?

import datetime

datetime.utcnow().replace(microsecond=0).isoformat()

Ideally this would also indicate that this is UTC time in the printed representation, but Python 2 doesn't have datetime.timezone.utc, and I don't think an extra dependency or writing a UTC tzinfo subclass is worth it..

if result != 0:
return result

print(["adb", "install", "-r", apk_path])

This comment has been minimized.

Copy link
@aneeshusa

aneeshusa Jun 3, 2016

Member

Looks like a debugging print that can be removed.

This comment has been minimized.

Copy link
@edunham

edunham Jun 3, 2016

Author Contributor

I believe this is still used frequently when debugging the Android builder

* Split package commands into their own file
* Delete spurious files from build dir
* Create runservo.sh to invoke servo with the right browserhtml incantation
* Tar it all up with the date and time in the filename
@edunham edunham force-pushed the edunham:mach-package branch from 6fe127c to a1a8e08 Jun 3, 2016
@highfive
Copy link

highfive commented Jun 3, 2016

New code was committed to pull request.

@edunham
Copy link
Contributor Author

edunham commented Jun 3, 2016

Latest changes fix tidy errors and switch to using ISO datetime format.

@aneeshusa
Copy link
Member

aneeshusa commented Jun 3, 2016

I don't think the tarfile Python module has the right options to support reproducible tarball builds, for example I don't see any way to enforce file ordering. I'd really like to see us have reproducible builds in general, but now that it's June I understand the tech demo is right around the corner; if this is something we have time for now I can dig into it more, otherwise this can be changed after the demo.

@edunham
Copy link
Contributor Author

edunham commented Jun 6, 2016

@aneeshusa I'd like to get a basic package functionality landed so we can add it to the build system -- in the long run there are a lot of areas for improvement.

r? @larsbergstrom

@larsbergstrom
Copy link
Contributor

larsbergstrom commented Jun 6, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Jun 6, 2016

📌 Commit a1a8e08 has been approved by larsbergstrom

@bors-servo
Copy link
Contributor

bors-servo commented Jun 6, 2016

Testing commit a1a8e08 with merge bc52617...

bors-servo added a commit that referenced this pull request Jun 6, 2016
Start on Mach package

Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data:
- [ ] `./mach build -d` does not report any errors
  - these changes don't touch anything that mach build touches>
- [ ] `./mach test-tidy --faster` does not report any errors
  - Tidy errors on some dependencies that I think we'll need for real `package` but aren't using for android
- [X] These changes address #9918 (github issue number if applicable).

Either:
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because I don't think Mach has tests yet?

Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11210)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Jun 6, 2016

@bors-servo bors-servo merged commit a1a8e08 into servo:master Jun 6, 2016
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
aneeshusa added a commit to aneeshusa/servo-saltfs that referenced this pull request Jun 22, 2016
servo/servo#11210 recently updated `./mach
package` to make it a first-class Mach command and add support for
simple Linux packaging as well (in the form of tarballs). Android used
to be the only packaging target supported, so a naked `./mach package`
sufficed, but now we need to explicitly build the Android packaging.
bors-servo added a commit to servo/saltfs that referenced this pull request Jun 23, 2016
…larsbergstrom

Add --android option to ./mach package

servo/servo#11210 recently updated `./mach
package` to make it a first-class Mach command and add support for
simple Linux packaging as well (in the form of tarballs). Android used
to be the only packaging target supported, so a naked `./mach package`
sufficed, but now we need to explicitly build the Android packaging.

Another step for servo/servo#10339.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/saltfs/401)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

8 participants
You can’t perform that action at this time.