Skip to content

Run post_install when needed #893

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

Merged
merged 10 commits into from
Aug 20, 2020
Merged

Conversation

cmaglie
Copy link
Member

@cmaglie cmaglie commented Aug 13, 2020

Run post_install.sh script on trusted platforms

Also:

  • refactored executils.Command
  • added IsTrusted flag in PlatformReleases

@cmaglie cmaglie self-assigned this Aug 13, 2020
@cmaglie cmaglie force-pushed the run_platform_postinstall branch from 13d35d1 to 382581a Compare August 13, 2020 15:42
@matthijskooijman
Copy link
Collaborator

Does it really add anything to add an isTrusted flag here? AFAICS, an "untrusted" platform can still provide custom compiler binaries and compiler commands in platform.txt, so this trusted flag would only prevent running untrusted code at platform install time, as soon as you actually use the platform to compile a sketch, untrusted code will be ran in any case?

@cmaglie
Copy link
Member Author

cmaglie commented Aug 13, 2020

that's right, probably we should run post-install also for unsigned/3rd party.

@luigigubello WDYT?

@cmaglie
Copy link
Member Author

cmaglie commented Aug 13, 2020

FWIW I've ported this as-is from the Arduino IDE, so in case it should be changed also in the Arduino IDE.

@cmaglie cmaglie force-pushed the run_platform_postinstall branch from bf14fd7 to 382581a Compare August 14, 2020 12:40
@@ -91,6 +92,7 @@ func runUpgradeCommand(cmd *cobra.Command, args []string) {
Instance: inst,
PlatformPackage: platformRef.PackageName,
Architecture: platformRef.Architecture,
SkipPostInstall: detectSkipPostInstallValue(),
Copy link
Contributor

Choose a reason for hiding this comment

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

@silvanocerza could you please check if the --run-post-install and --skip-post-install flags need to be ported also in arduino-cli update and upgrade commands?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure! I'll check it out.

Copy link
Contributor

Choose a reason for hiding this comment

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

I looked at it and think it might be necessary to port them on the upgrade command, it don't think it should be necessary for update since it just downloads the index files.

@cmaglie cmaglie force-pushed the run_platform_postinstall branch from 164ebec to 37bcb72 Compare August 20, 2020 09:36
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.

5 participants