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

bug: builds broken with an uncaught composer error #190

Closed
rhoerr opened this issue Jan 13, 2025 · 5 comments
Closed

bug: builds broken with an uncaught composer error #190

rhoerr opened this issue Jan 13, 2025 · 5 comments

Comments

@rhoerr
Copy link
Contributor

rhoerr commented Jan 13, 2025

I currently get an error on mageos-release:

$ node src/make/mageos-release.js --mageosRelease=1.0.5-p5 --upstreamRelease=2.4.7-p3 --skipHistory
...
5/7 Packaging [1.0.5-p5] Magento_nl_NL
6/7 Packaging [1.0.5-p5] Magento_pt_BR
7/7 Packaging [1.0.5-p5] Magento_zh_Hans_CN
Packaging Magento Base Package
Determining dependencies...
Removing existing temporary workdir at /tmp/workdir-f9f29ed3731da9dea37dc7fc7dab22fc
Preparing temporary copy in /tmp/workdir-f9f29ed3731da9dea37dc7fc7dab22fc
Running composer install --no-progress --no-plugins --no-scripts
Inspecting 6125 files to determine composer dependencies...
node:events:497
      throw er; // Unhandled 'error' event
      ^

Error: spawn php-classes.phar ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:286:19)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on ChildProcess instance at:
    at ChildProcess._handle.onexit (node:internal/child_process:292:12)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn php-classes.phar',
  path: 'php-classes.phar',
  spawnargs: []
}

Node.js v20.15.1

I've tried various things including updating composer, reinstalling node packages, and updating node packages, but to no avail.

This error appears to affect the upstream mirror builds too, for as long as the action history shows: https://github.com/mage-os/generate-mirror-repo-js/actions/runs/12732736267/job/35488270194#step:8:331

Packaging Magento Base Package
Determining dependencies...
Preparing temporary copy in /tmp/workdir-9867b9034c64e5b7b0c14209e777ea80
Running composer install --no-progress --no-plugins --no-scripts
Inspecting 6180 files to determine composer dependencies...
node:events:496
      throw er; // Unhandled 'error' event
      ^

Error: write EPIPE
    at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:95:16)
Emitted 'error' event on Socket instance at:
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -32,
  code: 'EPIPE',
  syscall: 'write'
}

Node.js v20.18.1
Error: Process completed with exit code 1.

Which makes me wonder if the entire build process is currently broken.

@rhoerr
Copy link
Contributor Author

rhoerr commented Jan 13, 2025

A release build to the preview repo on GitHub worked fine: https://github.com/mage-os/generate-mirror-repo-js/actions/runs/12741163730

I'm not sure what the difference is or why nighties and my local would be affected, but the release action isn't.

@fballiano
Copy link
Contributor

isn't this kinda the same as #171? unfortunately I don't know node enough to help, I guess the only person is @Vinai here :-)

@rhoerr
Copy link
Contributor Author

rhoerr commented Jan 13, 2025

Possibly duplicate to #171, but that started about more broad nightly build errors, so I thought it best to open this with my specific issue.

Vinai mentioned this maybe being a composer segfault in a recent meeting. Hopefully he has more insight or ideas on what to try.

@rhoerr
Copy link
Contributor Author

rhoerr commented Jan 14, 2025

Okay, so this isn't related to the composer install command, it's actually (shockingly, as the error says) from php-classes.phar, which is called later.

          const classesInDiXml = childProcess.spawn('php-classes.phar', ['--di.xml', 'app/etc/di.xml'], options);

ENOENT means that doesn't exist, which it didn't on my system. This is covered in the readme, so, go me:

Also, the github.com/mage-os/php-dependency-list phar executable is expected to be in the PATH.
curl -L https://github.com/mage-os/php-dependency-list/raw/main/php-classes.phar -o /usr/local/bin/php-classes.phar
chmod +x /usr/local/bin/php-classes.phar

I missed that and must not have run this command on this system before. This is a possible area for improvement.

As for the nightlies, deploy.yml includes a step to download php-classes.phar ("Install PHP source code dependency analyzer and make executable (used by nightly build script for base package)"). That must not be working properly anymore, if the nightly build is hitting this same error.

@rhoerr
Copy link
Contributor Author

rhoerr commented Jan 14, 2025

The nightlies error is EPIPE, something entirely different. Closing this as user error. I'll add a better error message for this missing dependency in my PR.

@rhoerr rhoerr closed this as completed Jan 14, 2025
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

No branches or pull requests

2 participants