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

start-shared-test-validator.sh should test for and ask users to install 'flock' and 'pidof' (they're not there by default on macOS) #9

Open
mikemaccana opened this issue Nov 19, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@mikemaccana
Copy link

mikemaccana commented Nov 19, 2024

Overview

Following the instructions per solana-web3.js/examples/README.md, all the examples fail to run on a new mac since Flock isn't there by default.

Steps to reproduce

% pwd
/Users/mike/Code/solana-web3.js/examples/transfer-lamports
mike@Mac transfer-lamports % pnpm start

> @solana/example-transfer-lamports@ prestart /Users/mike/Code/solana-web3.js/examples/transfer-lamports
> turbo --output-logs=errors-only compile:js compile:typedefs

turbo 2.2.3

• Packages in scope: @solana/example-transfer-lamports
• Running compile:js, compile:typedefs in 1 packages
• Remote caching disabled

 Tasks:    74 successful, 74 total
Cached:    74 cached, 74 total
  Time:    1.611s >>> FULL TURBO


> @solana/example-transfer-lamports@ start /Users/mike/Code/solana-web3.js/examples/transfer-lamports
> start-server-and-test '../../scripts/start-shared-test-validator.sh' http://127.0.0.1:8899/health run:example

1: starting server using command "../../scripts/start-shared-test-validator.sh"
and when url "[ 'http://127.0.0.1:8899/health' ]" is responding with HTTP status code 200
running tests using command "npm run run:example"

../../scripts/start-shared-test-validator.sh: line 24: flock: command not found
Error: server closed unexpectedly
    at ChildProcess.onClose (/Users/mike/Code/solana-web3.js/node_modules/.pnpm/[email protected]/node_modules/start-server-and-test/src/index.js:83:14)
    at ChildProcess.emit (node:events:518:28)
    at maybeClose (node:internal/child_process:1104:16)
    at ChildProcess._handle.onexit (node:internal/child_process:304:5)
 ELIFECYCLE  Command failed with exit code 1.

Description of bug

I don't have a Linux box to test but I bet flock is probably there by default, on mac you need to add https://formulae.brew.sh/formula/flock

We want to ask people to install Homebrew and then brew install flock

After this the examples work.

Another possible solution would be to remove the flock and pidof requirements if this is possible/safe.

@mikemaccana mikemaccana added the bug Something isn't working label Nov 19, 2024
@mikemaccana mikemaccana changed the title start-shared-test-validator.sh should test for and ask users to install 'flock' (it's not there by default on macOS) start-shared-test-validator.sh should test for and ask users to install 'flock' and 'pidof' (they're not there by default on macOS) Nov 19, 2024
@steveluscher
Copy link
Collaborator

Previously, solana-labs/solana-web3.js#2042.

@steveluscher steveluscher transferred this issue from solana-labs/solana-web3.js Dec 14, 2024
@steveluscher steveluscher transferred this issue from another repository Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants