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 possibility to ignore unsupported fuses #11

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

kyrylo-hrechykhin
Copy link

This PR introduces possibility to ignore not supported electron fuses specified in fuses config. Requirement for that behaviour is described in issue #10 .

This PR also introduces small changes in tests that make possible to run those tests on supported platforms without failing.

@kyrylo-hrechykhin
Copy link
Author

@MarshallOfSound , could you please review this PR?
It introduces quite useful functionality and additionally fixes some small issues in tests.

@erickzhao erickzhao requested a review from a team January 10, 2023 00:44
@kyrylo-hrechykhin
Copy link
Author

@MarshallOfSound , @codebytere , could you please review this change?

src/config.ts Outdated Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
src/bin.ts Outdated Show resolved Hide resolved
@kyrylo-hrechykhin kyrylo-hrechykhin force-pushed the 10-add-possibility-to-ignore-not-supported-fuses branch from 9a81235 to 65e18db Compare January 27, 2023 09:09
@kyrylo-hrechykhin kyrylo-hrechykhin requested review from codebytere and removed request for MarshallOfSound January 27, 2023 14:53
@kyrylo-hrechykhin
Copy link
Author

Oh, I did not expect that asking to re-review @codebytere will remove request for review of @MarshallOfSound .
@MarshallOfSound , could you please review this PR?

@erickzhao erickzhao changed the title feat: add possibility to ignore not supported fuses feat: add possibility to ignore unsupported fuses Jan 27, 2023
Copy link
Member

@MarshallOfSound MarshallOfSound left a comment

Choose a reason for hiding this comment

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

I'm not a fan of having an option that just disables a valid error message. I think this should be solved on the user side by consuming getCurrentFuseWire and only flipping fuses conditionally that are in that wire.

Bloating the API surface of @electron/fuses doesn't feel right IMO

@kyrylo-hrechykhin
Copy link
Author

@MarshallOfSound , thanks for the review.
I am absolutely fine for not adding additional parameter to the @electron/fuses API as long as requirement mentioned in the #10 met.

I noted in the initial issue that current logic where fuses are set takes into consideration unsupported fuses already and just does not set those. In case of flipping no longer supported fuses it just warns in the console instead of throwing an exception. From my point of view, this is inconsistency in terms of handling not supported fuses.

I'd suggest to replace throwing of exception with console.warn as in handling of no longer supported fuses. With this change API won't change and behavior will be consistent for all unsupported fuses. And the most important thing, user of @electron/fuses will not be responsible for handling of combinations of fuses on different electron versions.

Users will still have the possibility to break the build by themselves, comparing fuses they would like to set with those returned by getCurrentFuseWire.

What do you think about it?

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.

None yet

4 participants