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

@eslint/object-schema throws p.stdin.end is not a function on macOS #12574

Open
amareshsm opened this issue Jul 15, 2024 · 2 comments
Open

@eslint/object-schema throws p.stdin.end is not a function on macOS #12574

amareshsm opened this issue Jul 15, 2024 · 2 comments
Assignees
Labels
bug Something isn't working macOS An issue that occurs on macOS

Comments

@amareshsm
Copy link

What version of Bun is running?

1.1.20+ae1948925

What platform is your computer?

Darwin 21.5.0 arm64 arm

What steps can reproduce the bug?

Description:
I tried to build the packages within the Eslint Rewrite. When using Node.js, npm run build functioned correctly on both Windows and macOS. However, when I used the command bun run --bun build on Windows, it performed as expected, whereas on macOS, I encountered the following error:

Building packages in this order: packages/object-schema, packages/config-array, packages/compat, packages/core, packages/migrate-config
Building packages/object-schema...

> @eslint/[email protected] build
> rollup -c && tsc -p tsconfig.esm.json && npm run build:cts

npm ERR! Lifecycle script `build` failed with error: 
npm ERR! TypeError: p.stdin.end is not a function. (In 'p.stdin.end()', 'p.stdin.end' is Infinity) 
npm ERR!   in workspace: @eslint/[email protected] 
npm ERR!   at location: /Users/amareshsm/Desktop/Repositories/rewrite/packages/object-schema 
104 | function buildPackages(packageDirs) {
105 |   console.log(`Building packages in this order: ${packageDirs.join(", ")}`);
106 | 
107 |   for (const packageDir of packageDirs) {
108 |           console.log(`Building ${packageDir}...`);
109 |           execSync(`npm run build -w ${packageDir} --if-present`, {
        ^
error: null
   errno: -1
   code: "1"
 syscall: "spawnSync"
   path: "/bin/sh"

      at new SystemError (node:child_process:902:14)
      at node:child_process:175:24
      at node:child_process:226:23
      at buildPackages (/Users/amareshsm/Desktop/Repositories/rewrite/scripts/build.js:109:3)
      at /Users/amareshsm/Desktop/Repositories/rewrite/scripts/build.js:125:1

Bun v1.1.20 (macOS arm64)
error: script "build" exited with code 1
➜  rewrite git:(bun-test) 
src/index.js → dist/cjs/index.cjs, dist/esm/index.js...
created dist/cjs/index.cjs, dist/esm/index.js in 44ms

> @eslint/[email protected] build:cts
> node -e "fs.copyFileSync('dist/esm/index.d.ts', 'dist/cjs/index.d.cts')"

npm ERR! Lifecycle script `build:cts` failed with error: 
npm ERR! TypeError: p.stdin.end is not a function. (In 'p.stdin.end()', 'p.stdin.end' is Infinity) 
npm ERR!   in workspace: @eslint/[email protected] 
npm ERR!   at location: /Users/amareshsm/Desktop/Repositories/rewrite/packages/object-schema 

Steps:

  1. Clone the repo
  2. Do npm install
  3. Run Bun build command bun run --bun build

What is the expected behavior?

The packages should be built successfully without any errors.

What do you see instead?

Instead I got the below error:

$ node scripts/build.js
Building packages in this order: packages/object-schema, packages/config-array, packages/compat, packages/core, packages/migrate-config
Building packages/object-schema...

> @eslint/[email protected] build
> rollup -c && tsc -p tsconfig.esm.json && npm run build:cts

npm ERR! Lifecycle script `build` failed with error: 
npm ERR! TypeError: p.stdin.end is not a function. (In 'p.stdin.end()', 'p.stdin.end' is Infinity) 
npm ERR!   in workspace: @eslint/[email protected] 
npm ERR!   at location: /Users/amareshsm/Desktop/Repositories/rewrite/packages/object-schema 
104 | function buildPackages(packageDirs) {
105 |   console.log(`Building packages in this order: ${packageDirs.join(", ")}`);
106 | 
107 |   for (const packageDir of packageDirs) {
108 |           console.log(`Building ${packageDir}...`);
109 |           execSync(`npm run build -w ${packageDir} --if-present`, {
        ^
error: null
   errno: -1
   code: "1"
 syscall: "spawnSync"
   path: "/bin/sh"

      at new SystemError (node:child_process:902:14)
      at node:child_process:175:24
      at node:child_process:226:23
      at buildPackages (/Users/amareshsm/Desktop/Repositories/rewrite/scripts/build.js:109:3)
      at /Users/amareshsm/Desktop/Repositories/rewrite/scripts/build.js:125:1

Bun v1.1.20 (macOS arm64)
error: script "build" exited with code 1
➜  rewrite git:(bun-test) 
src/index.js → dist/cjs/index.cjs, dist/esm/index.js...
created dist/cjs/index.cjs, dist/esm/index.js in 44ms

> @eslint/[email protected] build:cts
> node -e "fs.copyFileSync('dist/esm/index.d.ts', 'dist/cjs/index.d.cts')"

npm ERR! Lifecycle script `build:cts` failed with error: 
npm ERR! TypeError: p.stdin.end is not a function. (In 'p.stdin.end()', 'p.stdin.end' is Infinity) 
npm ERR!   in workspace: @eslint/[email protected] 
npm ERR!   at location: /Users/amareshsm/Desktop/Repositories/rewrite/packages/object-schema 

image

Additional information

It is failing in CI as well - eslint/rewrite#87

When I used the bun run --bun build command to build each package individually, it worked as expected.

image

@amareshsm amareshsm added bug Something isn't working needs triage labels Jul 15, 2024
@amareshsm
Copy link
Author

I also tried to use spawnSync instead of execSync, but encountered the same error.

@Jarred-Sumner Jarred-Sumner changed the title Bun Build failed - TypeError: p.stdin.end is not a function. (In 'p.stdin.end()', 'p.stdin.end' is Infinity) @eslint/object-schema throws p.stdin.end is not a function on macOS Jul 16, 2024
@Jarred-Sumner Jarred-Sumner changed the title @eslint/object-schema throws p.stdin.end is not a function on macOS @eslint/object-schema throws p.stdin.end is not a function on macOS Jul 16, 2024
@Jarred-Sumner Jarred-Sumner added macOS An issue that occurs on macOS and removed needs triage labels Jul 16, 2024
@190n 190n self-assigned this Jul 17, 2024
@amareshsm
Copy link
Author

@190n Are you looking into this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working macOS An issue that occurs on macOS
Projects
None yet
Development

No branches or pull requests

3 participants