Commit Graph

47 Commits

Author SHA1 Message Date
Lorenzo Blasa
2318bffd07 Built artifact is already universal, no architecture is needed
Summary: ^

Reviewed By: antonk52

Differential Revision: D51568857

fbshipit-source-id: 124d77e4dd175a13f491f8242b3a28a898ff5670
2023-11-27 06:23:06 -08:00
Lorenzo Blasa
5e26d863f1 Packaging changes
Summary:
This change has a few changes in the way our MacOS app was built and packaged.

- Instead of placing the Node binary inside the MacOS folder, place it inside the Resources folder. This is more in compliance with how an app is bundled. Also, with the added benefit of making it a resource which makes it eligible for code signing.
- Both, Node binary and server bundle are placed in the right location before building the MacOS app. By doing this, we ensure the app is not modified after the built process which messes up with code signing, if in place.

Reviewed By: antonk52

Differential Revision: D51568778

fbshipit-source-id: 0b1b0ad9947550ddf0f6d4b04e5aff41f7edcdee
2023-11-27 04:55:05 -08:00
Lorenzo Blasa
d22d362c31 Codesign capabilities
Summary:
Add codesign capabilities to Flipper Server Cocoa app.

Also, push the version to the build step instead of overriding once built. Otherwise, the Info.plist will be marked as 'being tampered with'.

Note: we are still not using the signing, but the capability is there.

Reviewed By: antonk52

Differential Revision: D51547008

fbshipit-source-id: 33abcd2fce33a7daf2ae8941b54989dba82fc0e3
2023-11-27 04:55:05 -08:00
Lorenzo Blasa
ec9bc8a29f Avoid template copy
Summary:
As mentioned on the previous diff, we no longer use a pre-built template when creating a release build.

This change moves the built binary directly into place instead of updating the existing template after which it was moved to its final destination.

Reviewed By: antonk52

Differential Revision: D51424944

fbshipit-source-id: 284fb53bb5f00f92b3ca9db3b28cfd1e4dacfa19
2023-11-17 05:51:47 -08:00
Lorenzo Blasa
e3038a3393 MacOS app to be built on each release build
Summary:
So far we have used a 'template' approach, in which the release build script will copy and use to create the final deliverable.

The template itself was updated locally by running:
    cd ~/fbsource/xplat/sonar/facebook/flipper-server
    yarn start

This would:
- Build the MacOS app for all supported architectures: x64 and arm64
- Update the template found on the static directory

After the update, we would just commit the changes to the repo.

## About this change
Instead, build the MacOS app when the release script is used. This is leaves way less margin for error as we have removed all the manual steps that had to be done as listed above.

Reviewed By: antonk52

Differential Revision: D51397661

fbshipit-source-id: 2234c9996fa98f32db244764acf3e35dc9a388c9
2023-11-17 05:51:47 -08:00
Lorenzo Blasa
6b54bd3173 Remove no longer needed index.web.dev.html
Summary: This is a duplicate, is not needed, causes confusion.

Reviewed By: aigoncharov

Differential Revision: D51307091

fbshipit-source-id: 4d55d727ea5f20100ecd15ad6e23aa0c01722524
2023-11-14 10:53:09 -08:00
Anton Kastritskiy
663380e721 mark unused vars as errors
Reviewed By: lblasa

Differential Revision: D50500690

fbshipit-source-id: 6f739fe25c232ecfe842337af4399681e85f6a13
2023-10-20 12:44:58 -07:00
Lorenzo Blasa
4834fda6fa Build local architecture CLI arg
Summary:
The current '--mac' arg builds all supported architectures. This is great when generating release builds but not so much when testing a release for the current architecture.

Not modifying the existing '--mac' arg as to not update our current CI.

Reviewed By: antonk52

Differential Revision: D50497211

fbshipit-source-id: 3e4d9728adc822c48788556e2ea47f4dd1c21b05
2023-10-20 07:25:52 -07:00
Lorenzo Blasa
8a11043f37 Release build integration
Summary: This is the immediate follow-up from the previous diff which aims to integrate the MacOS app into our release build script, meta only.

Reviewed By: antonk52, aigoncharov

Differential Revision: D50301369

fbshipit-source-id: 23a4842666c3a7aa9616c6237e16b71bae87ba36
2023-10-16 08:35:48 -07:00
Pascal Hartig
d40ccc8786 Update flipper-runtime icon in server app bundle
Summary: Changelog: When requesting Keychain Access, you will now see "flipper-runtime" instead of a generic "node" process.

Reviewed By: lblasa

Differential Revision: D50261830

fbshipit-source-id: ef6fd7d5099c4ff7370f0401a5de3fde1659f1f3
2023-10-13 09:01:21 -07:00
Pascal Hartig
c80be9960a Use fetch() to download node
Summary: This is more reliable and follows redirect which we need for GitHub downloads.

Reviewed By: antonk52

Differential Revision: D50263976

fbshipit-source-id: d001b6eb460510b0b673ea66651e7c39cac3092f
2023-10-13 07:18:10 -07:00
Pascal Hartig
0cb5331c31 Fix spurious server build error on MacOS
Summary:
Copying files will randomly fail with something akin to

```
Error: Cannot copy '../acirb/bin/acorn' to a subdirectory of itself, '../acorn/bin/acorn'.
```

See https://github.com/jprichardson/node-fs-extra/issues/708

Reviewed By: antonk52

Differential Revision: D50263977

fbshipit-source-id: 39091ef57b79c692ec89e7a250595509839e2af8
2023-10-13 07:18:10 -07:00
Pascal Hartig
0134b66f37 Save node binary with name flipper-runtime
Summary:
As discussed with lblasa. This solves a few issues:

- Confusing names in `ps` and Activity Monitor related to Flipper.
- Permission requests for the Keychain from "node" lead users to deny it.
- Seeing "node" as allowed apps for an entry in Keychain is confusing.

Reviewed By: lblasa

Differential Revision: D50232337

fbshipit-source-id: 3bc92aae0ca31d1a80582fb8a794bbc64fc2f2e5
2023-10-13 03:31:11 -07:00
Lorenzo Blasa
cb86f0f90b Log download/unpack errors
Summary: ^

Reviewed By: ivanmisuno

Differential Revision: D49637030

fbshipit-source-id: 0e9925bd435e7843a57d6a8917f8da4e5e35640c
2023-09-27 03:34:01 -07:00
Lorenzo Blasa
9e98391151 Publish server dmg to release artifacts
Summary: ^

Reviewed By: passy

Differential Revision: D49544230

fbshipit-source-id: 908a5d7c759bcbcef34c262ab588500fc87cb463
2023-09-25 03:59:38 -07:00
Lorenzo Blasa
db07297e2d Create DMG
Summary: Add an option to archive the server build inside a DMG.

Reviewed By: antonk52

Differential Revision: D49504225

fbshipit-source-id: 3c34e6f0e4c9a685d36771199a6e20394f68baef
2023-09-22 07:14:52 -07:00
Lorenzo Blasa
a5a3e0494a Better installation wizard
Summary: A few improvements to the installation wizard.

Reviewed By: antonk52

Differential Revision: D49145069

fbshipit-source-id: 1aadd85e1d187bd61983a0b4201b530cbdbf509a
2023-09-11 07:12:20 -07:00
Lorenzo Blasa
cc9b62ec47 Need to copy loading.html
Summary: Need to copy this resource too from the static directory.

Reviewed By: aigoncharov

Differential Revision: D48864174

fbshipit-source-id: 0f3bfe9608bb9d48ec1cfb7243b3f0701d2fd8cf
2023-08-31 03:59:24 -07:00
Lorenzo Blasa
47b718d104 Remove TCP option as it will be the only option
Summary: UDS will be removed. The first step would be to remove the TCP optionality.

Reviewed By: passy

Differential Revision: D48264741

fbshipit-source-id: ca9e1b68be61e99240e95bcd4f26f2db63a64005
2023-08-11 08:19:51 -07:00
Lorenzo Blasa
dc0fd0a9e7 Windows server packaging
Summary: ^

Reviewed By: passy

Differential Revision: D47833317

fbshipit-source-id: b500f58b4ef0e201d8a711f3a83774fa82a7199b
2023-07-27 07:58:22 -07:00
Lorenzo Blasa
566125af3f spawn to set shell option
Summary: This is needed on Windows, otherwise it just throws an error when using spawn.

Reviewed By: passy

Differential Revision: D47832379

fbshipit-source-id: c1a5094c2e72683a695949cd99b2a1054f01aced
2023-07-27 07:06:58 -07:00
Lorenzo Blasa
5b2d20e0e0 Scaffolding for windows bundle
Summary: Just adds a function stub that will add the necessary run script for windows.

Reviewed By: passy

Differential Revision: D47627532

fbshipit-source-id: 09b6a203c2a5def20e586b5753d95ca58797852a
2023-07-27 07:06:58 -07:00
Sanjaiyan Parthipan
7cef8286f9 Concurrent Function Upgrade for Enhanced Performance (#4918)
Summary:
Republishing sanjaiyan-dev's PR https://github.com/facebook/flipper/pull/4889 running `git rebase` because of a conflict.

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

Reviewed By: lblasa

Differential Revision: D47294545

Pulled By: passy

fbshipit-source-id: 74904ec6179ed5a3bab6f9b701c3cd769ecad3bf
2023-07-17 04:43:14 -07:00
Lorenzo Blasa
a165d37ab3 Grey icon for PWA
Summary:
Right now, both Launcher and PWA share the same icon.

As to make it easier to identify which one is which, PWA will have a greyed icon instead.

Reviewed By: antonk52

Differential Revision: D47436998

fbshipit-source-id: 69d4d273c35e327263fbbf02d4ac7a005013f1d9
2023-07-13 07:41:44 -07:00
Lorenzo Blasa
49c356059a Use a direct download from Node distribution instead of relying on pkg-fetch
Summary:
It seems the available binary for macOS arm64 is not signed:

```
codesign -dv --verbose=4 ./node-v16.16.0-macos-arm64
./node-v16.16.0-macos-arm64: code object is not signed
```

This is an issue as it crashes for our flipper server releases.

This can be compared to a binary downloaded from the Node distribution page:

```
codesign -dv --verbose=4 ./node
    Executable=/Users/realpassy/Downloads/node-v16.15.0-darwin-arm64/bin/node
    Identifier=node
    Format=Mach-O thin (arm64)
    CodeDirectory v=20500 size=597360 flags=0x10000(runtime) hashes=18657+7 location=embedded
    VersionPlatform=1
    VersionMin=720896
    VersionSDK=721152
    Hash type=sha256 size=32
    CandidateCDHash sha256=31cdf84cac42a622c1a68558376700a2dd12d40d
    CandidateCDHashFull sha256=31cdf84cac42a622c1a68558376700a2dd12d40d81c5118f3b0e0370c414eb69
    Hash choices=sha256
 CMSDigest=31cdf84cac42a622c1a68558376700a2dd12d40d81c5118f3b0e0370c414eb69
    CMSDigestType=2
    Executable Segment base=0
    Executable Segment limit=56082432
    Executable Segment flags=0x1
    Page size=4096
    Launch Constraints:
        None
    CDHash=31cdf84cac42a622c1a68558376700a2dd12d40d
    Signature size=8986
    Authority=Developer ID Application: Node.js Foundation (HX7739G8FX)
    Authority=Developer ID Certification Authority
    Authority=Apple Root CA
    Timestamp=26 Apr 2022 at 23:00:57
    Info.plist=not bound
    TeamIdentifier=HX7739G8FX
    Runtime Version=11.1.0
    Sealed Resources=none
    Internal requirements count=1 size=164
```

For additional context:

Node binary by using pkg-fetch. We just get the binary from this release page: https://github.com/vercel/pkg-fetch/releases/tag/v3.4

The exact binary we're downloading is https://github.com/vercel/pkg-fetch/releases/download/v3.4/node-v16.15.0-macos-arm64

If you just download that via Chrome, it will trigger Gatekeeper and you need to manually click "Allow" in the system privacy settings. You can also do the same by just running:

    xattr -c ./node-v16*

Afterwards you can:
   chmod +x ./node*

It will crash in the same way that it does after our distribution.

Reviewed By: passy

Differential Revision: D46225503

fbshipit-source-id: f0ae2d5101b99c9db7fe80333573caef52c787a2
2023-05-31 01:06:17 -07:00
Lorenzo Blasa
eaaac54bc4 Manifest as template
Summary:
The file manifest.json is injected with the auth token and it happens with every launch.

Because the file is tracked, these changes will always get picked no matter what the .gitignore file specifies, because is a tracked file.

So, the solution is to have a template with a different name, that gets copied into the right location during build time.

Reviewed By: LukeDefeo

Differential Revision: D46184772

fbshipit-source-id: 938b9433045485d9846a6a50c1c955ebe7925581
2023-05-25 08:21:41 -07:00
Lorenzo Blasa
76fbaf245c Replace existing running instance, if any
Summary:
Replace an existing running instance, if any.

This is useful for:
- Applying updates
- Ensuring freshness of server

Reviewed By: passy

Differential Revision: D46146814

fbshipit-source-id: bfb760f3ab26b7632510773609f1c6ca3a97c4ec
2023-05-25 06:32:18 -07:00
Pascal Hartig
558316153c Build server release for Mac AARCH64
Reviewed By: lblasa

Differential Revision: D46144878

fbshipit-source-id: 1aa2982fc99e5dc6cdfbe4d9fcf87f7fc55a1abe
2023-05-24 10:48:00 -07:00
Lorenzo Blasa
c6d5eb3334 Flipper as PWA
Summary:
^

Reference: https://docs.google.com/document/d/1flQJUzTe4AuQz3QCpvbloQycenHsu7ZxbKScov7K7ao

Reviewed By: passy

Differential Revision: D45693382

fbshipit-source-id: 5a2e6c213a7e7e2cf9cd5f3033cff3e5291a2a92
2023-05-16 04:32:47 -07:00
Pascal Hartig
859653e111 Build Linux executable
Summary: Currently, Flipper server cannot be used with Flipper Launcher on Linux because there is no `flipper` binary in the root of the directory. Adding a quick shell script bridges the call from the checked-in node binary and the server JS file.

Reviewed By: ardavank

Differential Revision: D43837781

fbshipit-source-id: d954ae21d5330aa549d4bc76aefb1d76af8e2c84
2023-03-08 02:35:24 -08:00
Andrey Goncharov
8dc5f4d3ea Remove stale build options
Summary: Now that we build all plugins at all times and it is super-fast, these options are redundant

Reviewed By: lblasa

Differential Revision: D39542723

fbshipit-source-id: 1b30ba384267ec4fd0c35b4dc14f0223ffe414c9
2022-09-15 10:02:19 -07:00
Andrey Goncharov
9dda947371 Fix flipper server prod build
Summary: Make flipper-server link local flipper-* deps for intern prod build. Update flipper-* deps versions for public builds so `npx` pulls them from npm

Reviewed By: lblasa

Differential Revision: D39497944

fbshipit-source-id: ca2674a4ac8f5b6c3efa9546b631f2526bf48f8e
2022-09-15 10:02:19 -07:00
Andrey Goncharov
ed93dfe978 Refine prod and dev deps
Summary: Move flipper local deps to prod deps, so yarn installs them later when we build a bundle

Reviewed By: lblasa

Differential Revision: D39475545

fbshipit-source-id: 5b61d15b45ee315c3b35d8e6836c114b90503b1a
2022-09-15 10:02:19 -07:00
Andrey Goncharov
f835e07c46 Build all plugins before start
Summary: prepareDefaultPlugins builds all plugins now. We no longer need extra helpers

Reviewed By: lblasa

Differential Revision: D39308098

fbshipit-source-id: 4f12a0bdbc2afd2b306565fff3494daa630e1a20
2022-09-15 10:02:19 -07:00
Andrey Goncharov
a888e6affa Simplify bundled plugin setup
Summary: Stop bundling plugins into Flipper Server bundles. In later diffs, we will start building all plugins even in dev mode which removes the need to bundle them.

Reviewed By: lblasa

Differential Revision: D39276249

fbshipit-source-id: 091405cfcf58aa7e1bd2b382da40f8d9841ae6b1
2022-09-15 10:02:19 -07:00
Andrey Goncharov
a67a4e5d0f Remove babel transforms for flipper-server
Summary: Flipper server itself requires no babel transforms. We applied extra transforms only for the bundled plugins. However, we pack and ship all plugins in the /static folder. They are always available on the FS. Therefore we could stop bundling any plugins into flipper-server's source code.

Reviewed By: lblasa

Differential Revision: D38910251

fbshipit-source-id: b3e9fe5ae2ab69ce5579b01b6793ebf7e88baf66
2022-09-15 10:02:19 -07:00
Andrey Goncharov
218cb6abf2 Fix server bundling order
Summary: prepareDefaultPlugins and prepareHeadlessPlugins should come before compileServerMain to bundle plugins

Reviewed By: passy

Differential Revision: D38862132

fbshipit-source-id: 952a2f6d4f857f4faacfc952bebb4e59afcbc5b0
2022-09-15 10:02:19 -07:00
Lorenzo Blasa
646b9d5a5d UDS/TCP options
Summary:
Provide an option to enable/disable TCP connections on flipper-server.

The only change at this stage is that Flipper Desktop will use UDS to connect to flipper-server.

Reviewed By: passy

Differential Revision: D37519656

fbshipit-source-id: 3d02084666fde532ec76134edf8cf6a231060a48
2022-06-29 15:01:05 -07:00
Pascal Hartig
11ff9b51e3 Fix node +x bit in server distribution
Summary: This was lost when I changed from `pkg-fetch` writing it to copying the file.

Reviewed By: mweststrate, aigoncharov

Differential Revision: D36682861

fbshipit-source-id: 23822d4cc75720a83282de949d28029a05a2a7f9
2022-05-30 03:44:28 -07:00
Pascal Hartig
02adfa79e9 Add sourcemap support to server build
Summary:
Provide the same build parameters as for the main build and move
the two bundles to a folder where we can pick them up.

For consistency, I'm keeping the naming scheme with the main build.

Reviewed By: antonk52

Differential Revision: D36521046

fbshipit-source-id: 9ea992d6e5dc299d88083d751ca8e84eadb1430b
2022-05-20 04:04:06 -07:00
Pascal Hartig
3c3610662a Change build to make use of offline cache
Summary:
pkg-fetch is a bit weird in that it doesn't use the offline cache
if an output path is defined. That makes building in Sandcastle a lot harder.

Reviewed By: lawrencelomax, aigoncharov

Differential Revision: D36485283

fbshipit-source-id: 27596999c69441bc25e341db77b409ed0caaf0fe
2022-05-19 04:14:47 -07:00
Andrey Goncharov
a6d7f98cfd Bundle headless plugins
Summary: Current temporary limitations: all headless plugins are bundled with Flipper.

Reviewed By: antonk52

Differential Revision: D36098168

fbshipit-source-id: c58abe41776157258a5c39a80a5c1a33cf3f42c5
2022-05-10 05:13:24 -07:00
Pascal Hartig
045e0cc9fe App bundle for server
Summary:
This bundles up the Flipper Server in a Mac App Bundle which is identically in shape to a regular Desktop bundle. That means we can swap them out transparently without having to keep the layout in sync with Flipper Launcher.

It bundles nodeJS binary which we can later also provide for aarch64.

Reviewed By: aigoncharov

Differential Revision: D36140809

fbshipit-source-id: fb3410626ab172ce0da48f1a4a1489da68450369
2022-05-09 04:19:55 -07:00
Pascal Hartig
92f88e877b Script for platform-specific flipper-server bundles
Summary:
To roll out Flipper Server for desktop, we need a bundle that comes with all node dependencies pre-installed and a bundled Node runtime. This creates some platform-specific sub-folders in `dist/` with both.

The `--mac`, `--linux`, `--win` options are chosen to be compatible with the main build script. For now, we only build x64 builds for Mac which is also in line with the Desktop build as we don't have signing for the whole bundle.

Reviewed By: lblasa

Differential Revision: D35545492

fbshipit-source-id: cce7165916d91a333f305713b9d6d7b9984984f4
2022-04-12 04:12:55 -07:00
Michel Weststrate
5b19b378f6 Disable .strict() on all tsx yargs scripts
Summary:
Some internal jobs started to fail in the same way as GH did. Applied the same patch as in the parent diff.

I suspect the cause is an earlier update of node / bash / other dep? Couldn't really find anything clearly pointing at the problem

Reviewed By: aigoncharov

Differential Revision: D35212673

fbshipit-source-id: c09956137a4b10537718ffa60223cc4e557f41f7
2022-03-29 09:54:15 -07:00
Andrey Goncharov
8ee788239b Update version number for default plugins
Summary: Prior to this fix, plugins were copied with verion 0.0.0 which forced them to be updated with "newer" versions from marketplace

Reviewed By: nikoant

Differential Revision: D34457087

fbshipit-source-id: a3242578c570447f8ecf9c62bcaa69e5d9688c42
2022-02-28 03:50:34 -08:00
Anton Kastritskiy
071bcaff96 Rename second batch for '.ts' files to '.tsx' in scripts dir
Summary: Rename first batch for '.ts' files to '.tsx'

Reviewed By: passy

Differential Revision: D33843246

fbshipit-source-id: eb8080db8cc3ef07820339bf8deafa208432de7c
2022-01-31 02:57:54 -08:00