-
Notifications
You must be signed in to change notification settings - Fork 447
Add MCAP mdimporter to macOS app bundle #4745
Conversation
…e, change type identifier to dev.mcap.mcap
const appName = context.packager.appInfo.productFilename; | ||
const appPath = path.join(appOutDir, `${appName}.app`); | ||
const spotlightDirPath = path.join(appPath, "Contents", "Library", "Spotlight"); | ||
const zipPath = path.join(outDir, "MCAPSpotlightImporter.mdimporter.zip"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not unzip from memory rather than downloading the zip into the FS first?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mainly because there was a convenient extractZip
function available from @actions/tool-cache
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this would cause an exciting bug if the extract dir was in ~/Downloads
, and Mac OS went ahead and applied the com.apple.quarantine
xattr to the bundled executable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a thing that happens automatically for arbitrary files? This file is being created by some JS code, not downloaded from a browser or by extracting a dmg. I don't think I've heard of the quarantine attribute being added for files created directly by programs that aren't browsers.
.update(await fs.readFile(zipPath)) | ||
.digest("hex"); | ||
if (actualSHA !== zipSHA) { | ||
throw new Error(`SHA mismatch for ${zipURL}: expected ${zipSHA}, got ${actualSHA}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an action that the user can take here to fix this? Or will the solution vary too much to mention an action?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This indicates the download was corrupt or the url/sha is simply wrong. It's not within the scope of this code to do something about it, the user will have to figure out what went wrong (e.g. a network error)
Hopefully 99.99% of the time nobody will encounter this :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw, "user" here means "studio release engineer"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm all for this feature.
I'd feel happier about the deployment story if we could package as part of the release process (even if it is built separately) using the extraResources
feature: https://www.electron.build/configuration/contents.html
This would let us avoid an additional download step and potential for failure. We can limit this to the macos package so Windows and Linux users are not paying with larger bundle sizes.
If you looked into that and there were other complications with that approach then we can use this one and I'll approve the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I now understand that none of the download is happening on the user's machine. These download steps are in afterPack and doing exactly what I imagined - downloading the file for inclusion into the package bundle.
The Swift indexed reader is being used in production as of foxglove/studio#4745
The Swift indexed reader is being used in production as of foxglove/studio#4745
User-Facing Changes
Added a Spotlight importer for MCAP files to the macOS desktop app. The names of topics, schemas, attachments, and metadata in MCAP files can now be used as search terms in Finder and Spotlight.
Description
Added https://github.com/foxglove/MCAPSpotlightImporter to app bundle via afterPack script.
Also made some updates to Studio's Info.plist:
dev.foxglove.mcap
todev.mcap.mcap
now that mcap.dev is a registered domainpublic.log
andpublic.composite-content