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

feat: add Fuses plugin #3132

Merged
merged 13 commits into from
Feb 21, 2023
Merged

feat: add Fuses plugin #3132

merged 13 commits into from
Feb 21, 2023

Conversation

erikian
Copy link
Member

@erikian erikian commented Jan 6, 2023

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • The changes are appropriately documented (if applicable).
  • The changes have sufficient test coverage (if applicable).
  • The testsuite passes successfully on my local machine (if applicable).

Summarize your changes:
Plugin for Fuses.

Closes #3076.

@erikian erikian force-pushed the feat/fuses-plugin branch from f94c2aa to caeda9b Compare January 6, 2023 21:20
@erickzhao erickzhao requested a review from a team January 6, 2023 22:00
@erikian erikian force-pushed the feat/fuses-plugin branch from 4a337e8 to e39b49c Compare January 7, 2023 18:58
@erikian
Copy link
Member Author

erikian commented Jan 7, 2023

I had an issue where the test worked fine when running yarn test in ./packages/plugin/fuses, but failed when running the test script in the package root. After a lot of debugging, I found that adding this line from #3012 to my test fixes the issue:

Without this line, rechoir fails to load ts-node/register with the following error, then it tries to find other .ts loaders and ultimately fails with the Unable to use specified module loaders for ".ts" error I was getting on CI:

⨯ Unable to compile TypeScript:
error TS5083: Cannot read file 'E:\Documents\Erik\forge\packages\plugin\fuses\test\fixtures\app\tsconfig.test.json'.

Also, when running the test script in the plugin folder after a previous run, it was failing with some obscure Mocha error. This was because I have "@electron-forge/plugin-fuses": "file:./../../../../fuses" in the mock app instead of something like "@electron-forge/plugin-fuses": "6.0.4", so re-running yarn install before the test was causing the issue. The solution for now is removing the node_modules folder from the mock app after finishing the test. Once the plugin is released, this will no longer be necessary.

platform,
});

await flipFuses(pathToElectronExecutable, this.fusesConfig);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue(blocking): we should specify the resetAdHocDarwinSignature flag if the osxSign option is not configured on arm64.

https://github.com/electron/fuses#apple-silicon

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it apply to the mas target as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, what about arch=universal?

"package": "electron-forge package"
},
"dependencies": {
"@electron-forge/plugin-fuses": "file:./../../../../fuses",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if there's a better way to test unreleased plugins

},
"dependencies": {
"@electron-forge/plugin-fuses": "file:./../../../../fuses",
"@electron-forge/shared-types": "6.0.4",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ESLint throws a node/no-unpublished-import at me when importing some packages if they're under devDependencies, so I figured moving them to dependencies would be better than adding a bunch of es-ignore comments since it's a mock app anyway

platform,
});

await flipFuses(pathToElectronExecutable, this.fusesConfig);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it apply to the mas target as well?

platform,
});

await flipFuses(pathToElectronExecutable, this.fusesConfig);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, what about arch=universal?

@erikian erikian requested a review from erickzhao January 12, 2023 16:39
@erikian erikian force-pushed the feat/fuses-plugin branch 2 times, most recently from f165145 to 3e3d322 Compare January 20, 2023 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Electron Fuses to the packaging pipeline
2 participants