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

[patch-project] Set CLI to executable on build for consistency with yarn in root #27687

Merged
merged 1 commit into from Mar 15, 2024

Conversation

brentvatne
Copy link
Member

@brentvatne brentvatne commented Mar 15, 2024

Why

So:

1. after running yarn clean && yarn build in patch-project

ls -l build/cli/index.js
-rw-r--r--@ 1 brent  staff  4002 14 Mar 17:49 build/cli/index.js

2. after running yarn from root (with a clean node_modules):

ls -l build/cli/index.js
-rwxr-xr-x@ 1 brent  staff  4002 14 Mar 17:49 build/cli/index.js

I believe this happens because yarn will link all workspace bins and ensure they are executable. When we use expo-module clean we delete the build directory and re-generate it, re-creating it without executable mode. This is usually fine because in other pkgs we don't keep the bin inside of src, but in this case..

How

Add chmod +x in build script

Test Plan

  • patch-package and iOS Client - EAS workflows should both work. (confirmed iOS client here)
  • The two scenarios I shared in the "Why" section both produce the same results

@brentvatne brentvatne requested a review from Kudo March 15, 2024 01:11
@brentvatne brentvatne marked this pull request as ready for review March 15, 2024 01:11
@brentvatne brentvatne requested a review from tsapeta March 15, 2024 01:11
@expo-bot
Copy link
Collaborator

Hi there! 👋 I'm a bot whose goal is to ensure your contributions meet our guidelines.

I've found some issues in your pull request that should be addressed (click on them for more details) 👇

⚠️ Suggestion: Missing changelog entries


Your changes should be noted in the changelog. Read Updating Changelogs guide and consider adding an appropriate entry to the following changelogs:


Generated by ExpoBot 🤖 against 2c3e7aa

@expo-bot expo-bot added the bot: suggestions ExpoBot has some suggestions label Mar 15, 2024
@brentvatne brentvatne merged commit ec64e1a into main Mar 15, 2024
16 of 18 checks passed
@brentvatne brentvatne deleted the @brent/fix-patch-project-build-err branch March 15, 2024 01:35
marklawlor pushed a commit that referenced this pull request Mar 18, 2024
…arn in root (#27687)

# Why

- I noticed that the working tree was dirty when trying to run this job:
https://github.com/expo/expo/actions/runs/8287945362/job/22681450966
- I saw when I ran `yarn` locally in the root of the repo (by chance, I
happened to do it with a clean slate / no node_modules) it modified
build/cli/index.js to add +x to mode.
- I figured this would be fine to commit and solve all of our problems.
But then check-packages failed:
https://github.com/expo/expo/actions/runs/8289007758/job/22684616383

So:

### 1. after running yarn clean && yarn build in patch-project

```
ls -l build/cli/index.js
-rw-r--r--@ 1 brent  staff  4002 14 Mar 17:49 build/cli/index.js
```

### 2. after running yarn from root (with a clean node_modules):

```
ls -l build/cli/index.js
-rwxr-xr-x@ 1 brent  staff  4002 14 Mar 17:49 build/cli/index.js
```

I believe this happens because `yarn` will link all workspace `bin`s and
ensure they are executable. When we use `expo-module clean` we delete
the build directory and re-generate it, re-creating it without
executable mode. This is usually fine because in other pkgs we don't
keep the bin inside of src, but in this case..

# How

Add `chmod +x` in build script 

# Test Plan

- patch-package and iOS Client - EAS workflows should both work.
([confirmed iOS client
here](https://github.com/expo/expo/actions/runs/8289875387/job/22687033418))
- The two scenarios I shared in the "Why" section both produce the same
results
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants