Commit Graph

41 Commits

Author SHA1 Message Date
Stiopa Koltsov
7227f722ac Apply rustfmt
Reviewed By: zertosh

Differential Revision: D38485159

fbshipit-source-id: 0abdf44561da00697953fe2cb9211ceb5cf27ac0
2022-08-06 08:42:43 -07:00
Pascal Hartig
e83f3e4dc7 Remove unnecessary clones
Summary: Follow-up to D38155922. This was done almost entirely by just following suggestions from the compiler. No behaviour changes, just fewer bit-copies in memory.

Reviewed By: lblasa

Differential Revision: D38199244

fbshipit-source-id: 777e9d833d25cb660307380ab88b12a1d4eedf09
2022-07-27 07:43:12 -07:00
Pascal Hartig
6913d6f653 Allow arbitrary packs
Summary:
The limitation to two types is arbitrary and limiting. Instead, we want to be able to create as many cache artifacts as is sensible to improve the caching behaviour.

A lot of unnecessary cloning in here. I might optimise this a bit in the future but it's not really perf critical as this is highly I/O bound.

Reviewed By: lblasa

Differential Revision: D38155922

fbshipit-source-id: 78b86ebff54269c5049e59197f1c25fedfad0111
2022-07-27 07:43:12 -07:00
Pascal Hartig
d73387d80b Add pack target for server linux
Summary: This is needed so we can roll out releases of Flipper Server for Linux.

Reviewed By: lawrencelomax

Differential Revision: D38155968

fbshipit-source-id: 2be032466cb8da867fa555fa545d1f236724461f
2022-07-27 07:43:12 -07:00
Stiopa Koltsov
c915b03159 Remove ::{self}
Summary: Cleanup after reformat one import per line.

Reviewed By: zertosh

Differential Revision: D38169581

fbshipit-source-id: 1e82053b25e4426a983fe7416481611d91e4b484
2022-07-26 14:35:15 -07:00
Stiopa Koltsov
873c03396e Apply rustfmt
Reviewed By: zertosh, passy

Differential Revision: D37579214

fbshipit-source-id: 0e52bd2b27abbbde32f77b073d3ed5ef33f4d318
2022-07-01 09:21:52 -07:00
Pascal Hartig
ed454d876d Upgrade indicatif
Summary: Upgrade to indicatif 0.16 and remove this as an exposed dep in the third-party repo.

Reviewed By: aigoncharov

Differential Revision: D36591356

fbshipit-source-id: e3e3d67f8522b94861b34422606b85afbebf669b
2022-05-23 04:55:24 -07:00
Pascal Hartig
274c0a242e Update mac server bundle layout
Summary: Take changes from D36140809 into account.

Reviewed By: aigoncharov

Differential Revision: D36206155

fbshipit-source-id: 794f8dd60e47f14acc4fb5fd9fd3d98fa5afdadf
2022-05-09 04:19:55 -07:00
Pascal Hartig
317a89d5ea Avoid strutural repetition
Summary: ^

Reviewed By: lawrencelomax

Differential Revision: D35940119

fbshipit-source-id: 055e57bb9b9174b275fc0fccfff80a04b3f04b30
2022-04-27 04:23:09 -07:00
Pascal Hartig
d40b0eab9c Fix lint
Summary: Unnecessary borrow.

Reviewed By: lblasa

Differential Revision: D35902385

fbshipit-source-id: d116305388d3a156093513d0892b245f690b4be0
2022-04-26 03:29:40 -07:00
Pascal Hartig
b4bddcb7de Add server-mac-x64 definition
Summary: Just this one for now as I can actually test that this works.

Reviewed By: lblasa

Differential Revision: D35902244

fbshipit-source-id: 9914c58968b4f9dfd25be7afaf6d89dffaad294a
2022-04-26 03:29:40 -07:00
Pascal Hartig
bb936aaf0f Make Platform a newtype
Summary:
Just a bit of extra type safety. The previous diff caused a bit of a regression
by making things stringly-typed.

Reviewed By: lblasa

Differential Revision: D35902107

fbshipit-source-id: a599106f899ec3d205663b5791420aee29f3eeae
2022-04-26 03:29:40 -07:00
Pascal Hartig
3c6a5c58f9 Move basedir to config file
Summary: This allows us to extend this more easily to server builds, too.

Reviewed By: lblasa

Differential Revision: D35901750

fbshipit-source-id: 7030846ad485d709cf4c2e95f0cad287f98b051b
2022-04-26 03:29:40 -07:00
Pascal Hartig
9474dfea7b Fix lint
Summary: This is automatically converted.

Reviewed By: antonk52

Differential Revision: D35434155

fbshipit-source-id: 30c0e5b3c6bf95cbfaf2b2a3946279aceaa11875
2022-04-07 08:57:18 -07:00
Pascal Hartig
b80766323f Upgrade packer
Summary:
This had collected a bit of dust and we will need to extend this a little for flipper-server.

- Update deps.
- Migrate away from deprecated clap2 model to derive (it's much shorter now and less imperative).
- ~~Some COW changes on how the progress bar crate handles strings.~~ (Reverted as this causes havvoc in `fbsource//third-party/rust`.)
- Upgraded to 2021 Edition.

Reviewed By: nikoant

Differential Revision: D35433571

fbshipit-source-id: ae0a91558610ae46069a5fc5162b524cde759454
2022-04-07 07:40:57 -07:00
Andres Suarez
79023ee190 Update copyright headers from Facebook to Meta
Reviewed By: bhamodi

Differential Revision: D33331422

fbshipit-source-id: 016e8dcc0c0c7f1fc353a348b54fda0d5e2ddc01
2021-12-27 14:31:45 -08:00
Pascal Hartig
fa97809178 Implement glob packing mode
Summary:
Best seen by looking at the packfile. This makes upgrades and changes
to the file format a lot more robust.

Reviewed By: priteshrnandgaonkar

Differential Revision: D27194152

fbshipit-source-id: a722adb3a59d73b7530287f7abd84ed865a35fa7
2021-03-23 13:28:14 -07:00
Pascal Hartig
ca55e68c89 Set up infra for different packing mode
Summary:
Electron 12 broke packing again because one file was renamed. I'm now setting up a separate mode for using globs and ignores to create artifact bundles. This will work like a reverse gitignore file. However, to keep the logic simple, I'll keep the old mode for MacOS where the folder structure lends itself to comprehensive, exact lists.

**This doesn't actually change anything just yet apart from the "packfile" format. The next diff will add the new packing mode. Feedback is always welcome but there's no need for super close scrutiny.**

Reviewed By: mweststrate

Differential Revision: D27191506

fbshipit-source-id: 663cef8b93eef6c2dbb56ef66de51ea9551412dd
2021-03-23 13:28:14 -07:00
Pascal Hartig
f04c8e8e2c Small optimisations
Summary: We're passing around PathBufs where Paths are enough and more efficient.

Reviewed By: fabiomassimo

Differential Revision: D27155300

fbshipit-source-id: cdf8d67e28a669130482d333c960d100bdaf0992
2021-03-18 05:12:43 -07:00
Pascal Hartig
844c3e3a1c Update packlist for Linux
Summary:
Electron 12 renamed one .so and broke the build.
Time to implement T83339637.

Reviewed By: fabiomassimo

Differential Revision: D27155174

fbshipit-source-id: a034f79cacb5c27b62cc6b51c9899a3d3a227954
2021-03-18 05:12:43 -07:00
Pascal Hartig
f69723978d Upgrade deps
Summary:
Couldn't do this because we were stuck on an old version
of digest internally with breaking changes. Now there's a
`sha2-9` option to make it build.

Reviewed By: mweststrate

Differential Revision: D26404582

fbshipit-source-id: 9851de3439ea263eaddb558daaf4cf9e73b062cc
2021-02-12 04:43:16 -08:00
Pascal Hartig
9cf80f60d7 Add PACK definitions for Linux
Summary: Exluded the license files because we don't need them.

Reviewed By: mweststrate

Differential Revision: D25995326

fbshipit-source-id: 8b42c69b75f33ca345d9e3b1310fef0fd928ea82
2021-01-21 10:00:16 -08:00
Pascal Hartig
7ed56949f3 Add PACK definitions for Windows
Summary:
This adds the definitions for how to split up Windows releases.
This only works with the previous change because otherwise
the Flipper.exe will change with every release build number.

Reviewed By: mweststrate

Differential Revision: D25977814

fbshipit-source-id: 4fb9d4e9562dedf43f9e9ec90a49801f60ed4550
2021-01-21 03:43:17 -08:00
generatedunixname89002005325677
cdb0570c43 Daily arc lint --take RUSTFMT
Reviewed By: zertosh

Differential Revision: D25216089

fbshipit-source-id: e7cdf6a5b23e18ba2bfebbe24979cf67f5d55b00
2020-11-30 03:51:30 -08:00
Pascal Hartig
911c3e297c Fix lints (#1716)
Summary:
Fix a lint that's currently failing.
See https://github.com/facebook/flipper/runs/1449249447?check_suite_focus=true

Pull Request resolved: https://github.com/facebook/flipper/pull/1716

Test Plan: cargo clippy succeeds now.

Reviewed By: nikoant

Differential Revision: D25170963

Pulled By: passy

fbshipit-source-id: 658f8b6abaef9860be9ff07447d2354727acb7c7
2020-11-27 04:10:09 -08:00
Pascal Hartig
d477ed7818 Address lints
Summary: Just going through all the lints that have popped up.

Reviewed By: jknoxville

Differential Revision: D24078571

fbshipit-source-id: 06504aafa969eea92ee934ac607d3daf51e47914
2020-10-02 06:37:45 -07:00
Pascal Hartig
2bbd76803c Use new checksums in manifest
Summary: This now makes use of the `tarsum` mod to surface both intrinsic and extrinsic checksums as part of the manifest. I also threw in the file name and the bytes for good measure. This is output in Sandcastle logs and can help identify mismatches. The filename also means we no longer have to rely on piecing together paths on Sandcastle which is nice.

Reviewed By: nikoant

Differential Revision: D24046464

fbshipit-source-id: dc6dc50eb510a067674166b5fdb11af9cf6762b2
2020-10-02 03:20:21 -07:00
Pascal Hartig
cf4db8be24 Build intrinsic archive sum
Summary:
# Problem

Oddly enough, since the addition of ReactiveCocoa to Electron on MacOS, we're seeing non-determinism when creating tar archives. P144049799 shows the difference between two release artifacts built on Sandcastle. Their contents are identical but they're packed differently.

# Approach

To counter this, I'm now calculating the checksum not based on the archive itself but on its *sorted* contents by first inserting all files into a `BTreeMap` with the file path as key and then lastly hashing all hashes, building some sort of bastardised Merkle tree.

# This diff

I'm only implementing the hashing here. The next diff will actually make use of this.

# Further steps

This requires a few more downstream changes which will require some finesse to roll out.

- The manifest will need to include both the intrinsic and extrinsic checksums as Launcher depends on the latter to verify the download integrity. We could also calculate the intrinsic checksum again, but that just adds more complexity which is hard to debug.
- Sandcastle will need to understand the new manifest format and we need to schedule the MSDK rollout accordingly. Not a huge problem as the call volume is low and manual.
- We need to modify the artifact and release ents to contain both checksums.
- The release endpoint needs to be modified to return the checksum the launcher cares about.

Reviewed By: nikoant

Differential Revision: D24024011

fbshipit-source-id: 55de748178c033c18a69c79c68f12e7c1aaf4deb
2020-10-02 03:20:21 -07:00
David Tolnay
aeebec5cd7 Prepare for rustfmt 2.0
Summary:
Generated by formatting with rustfmt 2.0.0-rc.2 and then a second time with fbsource's current rustfmt (1.4.14).

This results in formatting for which rustfmt 1.4 is idempotent but is closer to the style of rustfmt 2.0, reducing the amount of code that will need to change atomically in that upgrade.

 ---

*Why now?* **:** The 1.x branch is no longer being developed and fixes like https://github.com/rust-lang/rustfmt/issues/4159 (which we need in fbcode) only land to the 2.0 branch.

 ---

Reviewed By: zertosh

Differential Revision: D23568784

fbshipit-source-id: 7401066bfc99390686eb3fd9dc6f9888ccef9487
2020-09-07 20:50:27 -07:00
dependabot[bot]
7e7f431c66 Bump electron-devtools-installer from 3.0.0 to 3.1.0 in /desktop (#1317)
Summary:
Bumps [electron-devtools-installer](https://github.com/MarshallOfSound/electron-devtools-installer) from 3.0.0 to 3.1.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/MarshallOfSound/electron-devtools-installer/releases">electron-devtools-installer's releases</a>.</em></p>
<blockquote>
<h2>v3.1.0</h2>
<h1><a href="https://github.com/MarshallOfSound/electron-devtools-installer/compare/v3.0.0...v3.1.0">3.1.0</a> (2020-06-27)</h1>
<h3>Features</h3>
<ul>
<li>add electron 9 support (<a href="https://github-redirect.dependabot.com/MarshallOfSound/electron-devtools-installer/issues/131">https://github.com/facebook/flipper/issues/131</a>) (<a href="ab713a639c">ab713a6</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="f6932ad87d"><code>f6932ad</code></a> chore: fix tests</li>
<li><a href="ab713a639c"><code>ab713a6</code></a> feat: add electron 9 support (<a href="https://github-redirect.dependabot.com/MarshallOfSound/electron-devtools-installer/issues/131">https://github.com/facebook/flipper/issues/131</a>)</li>
<li>See full diff in <a href="https://github.com/MarshallOfSound/electron-devtools-installer/compare/v3.0.0...v3.1.0">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=electron-devtools-installer&package-manager=npm_and_yarn&previous-version=3.0.0&new-version=3.1.0)](https://help.github.com/articles/configuring-automated-security-fixes)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

 ---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `dependabot rebase` will rebase this PR
- `dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `dependabot merge` will merge this PR after your CI passes on it
- `dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `dependabot cancel merge` will cancel a previously requested merge and block automerging
- `dependabot reopen` will reopen this PR if it is closed
- `dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

</details>
Pull Request resolved: https://github.com/facebook/flipper/pull/1317

Reviewed By: mweststrate

Differential Revision: D22310350

Pulled By: passy

fbshipit-source-id: d043248ebd57976c5cfde267741977846c77c065
2020-07-01 06:11:35 -07:00
Pascal Hartig
ba0a706bc8 Small fixes
Summary: Some small perf improvements, remove unnecessary cloning, etc.

Reviewed By: jknoxville

Differential Revision: D22307521

fbshipit-source-id: 91cfd16b0b05a24ec9639c2a2e26d504a6b01de4
2020-06-30 06:20:11 -07:00
Pascal Hartig
6355076c90 Implement compression
Summary:
Compresses artifacts with LZMA by default. `--no-compression` can be used
to skip the quite time-intensive task to just quickly check if the archives
still add up to a full distribution.

Reviewed By: jknoxville

Differential Revision: D21456052

fbshipit-source-id: dfa4686f3fe7ce342b62dab4b5203bc0aad37d9a
2020-05-13 08:09:06 -07:00
Pascal Hartig
f00cd2964e Move main Info.plist to core bundle
Summary:
This does actually change from version to version as can be seen
when bundling both 0.40 and 0.41:

{F236391778}

Reviewed By: jknoxville

Differential Revision: D21426528

fbshipit-source-id: 53c0565f7693010a2096088af1829eab210a75cc
2020-05-07 07:22:53 -07:00
Pascal Hartig
dc783bcb19 Show progress bars
Summary: Add progress bars. The previous change broke the display as we'd write to the console in parallel, too.

Reviewed By: jknoxville

Differential Revision: D21405230

fbshipit-source-id: 3a60690c216fd2f44816ef1b01917f66ebe804df
2020-05-07 07:22:52 -07:00
Pascal Hartig
59aa7decc4 Parallelise packing
Summary: Parallelise packing and hashing. Delightfully small change.

Reviewed By: jknoxville

Differential Revision: D21405209

fbshipit-source-id: 095c7886f71e45b0889020ddcfe79f2392ce3218
2020-05-07 07:22:52 -07:00
Pascal Hartig
634bd00ab5 Refactor fold to map
Summary: This is to make parallelising this in the next step easier.

Reviewed By: jknoxville

Differential Revision: D21405192

fbshipit-source-id: b1f2841526a65fcbf545feb69f258874c2134603
2020-05-07 07:22:52 -07:00
Pascal Hartig
42e080776f Add error context
Summary: When file writing fails, attach some context in the error message.

Reviewed By: jknoxville

Differential Revision: D21400273

fbshipit-source-id: f7cce5446ec27d5eb38f1902f24c61169dd644ac
2020-05-07 07:22:51 -07:00
Pascal Hartig
5cc9af4b5d Hashing and Manifest
Summary: Hashes the artifacts and adds the information to a manifest. This will then be used to upload to a blob store, and save the information so it can be retrieved again later. Not sure if I want to stick with SHA256 or if there's something more efficient like Cityhash, given that we don't really care about cryptographic properties here.

Reviewed By: jknoxville

Differential Revision: D21380369

fbshipit-source-id: e9c5cd56d94f3083ae5ed6396673d00cbf98ce39
2020-05-07 07:22:51 -07:00
Pascal Hartig
8818fbe375 Build all artifacts from packlist
Summary:
Instead of hardcoding the targets, it will now build all specified
types in the "packlist".

Reviewed By: jknoxville

Differential Revision: D21349762

fbshipit-source-id: 58f4a3bbf0b6ff4dd87eb44bbd7b200127da8017
2020-05-01 09:43:17 -07:00
Pascal Hartig
2c20f016d4 Use anyhow for error handling
Summary:
This is a nice solution if you don't want to spend
too much time thinking about error handling.
You have one common return type and can basically use `?`
everywhere while still maintaining the flexibility to
create custom error types where needed.

Reviewed By: jknoxville

Differential Revision: D21349046

fbshipit-source-id: 073539ce8422cdb3e0141886e95321052bc0c7a3
2020-05-01 09:43:16 -07:00
Pascal Hartig
155a8c6952 Initial packer project
Summary:
This is a tool (right now more a script, really) for splitting a Flipper distribution into smaller chunks that can be individually cached, hashed and downloaded. It's incomplete but can already bundle up Mac apps into smaller chunks that can be merged back again into one app.

It takes a config file that specifies how to slice the inputs up and comes with a default copy bundled in. That's in line with the general "design" where it tries to make the right assumptions, for instance defaulting to the normal dist output directory.

Reviewed By: jknoxville

Differential Revision: D21302551

fbshipit-source-id: b22670ff4825ce526dd0f20320f87080c058cd93
2020-05-01 04:04:48 -07:00