expo / turtle

Standalone app builder service
MIT License
384 stars 29 forks source link

Fixed the iOS build when user does not have elevated permissions #283

Closed lochiego closed 3 years ago

lochiego commented 3 years ago

The use of sudo does not appear to be necessary to execute 'xcrun simctl list'.

Checklist

Motivation and Context

In our build environment the user running turtle does not have elevated permissions. We performed all the setup steps using an administrative account, but have a dedicated, limited user account for the actual CI builds we perform using Jenkins.

We had no troubles with our build prior to release 0.19.1, which introduced a fix for building with Xcode 12.1. Following this release, our builds started failing. Perhaps it is just our environment, but we have no issues executing xcrun without elevated permissions. At this point we are building with Xcode 12.2 successfully using this change.

Description

Removed the use of 'sudo' to run 'xcrun simctl list' as introduced by #279. We tested this patch in place by updating the javascript from package freshly-installed via yarn and executing our build job, which did not overwrite the updated package code. We checked that the build succeeded, and confirmed that the JS we edited was not overwritten by a fresh copy of the package in the process of the build.

dsokal commented 3 years ago

Thanks for the contribution @lochiego and sorry for breaking your distribution pipeline!

I just verified that xcrun simctl list (without sudo) executes successfully on our build VMs. This means we can probably drop sudo. However, I'm not sure if it was intended to run the command with elevated permissions. @bbarthec @wkozyra95 what do you think?

wkozyra95 commented 3 years ago

You can check value here https://github.com/expo/turtle/blob/master/src/config.ts#L75

offline is for cli online is for our server instances

lochiego commented 3 years ago

Thanks for the direction, @wkozyra95! I've added the requested change.