Skip to content

[Bug]: 0.3.1 still fails to build on mac-x86 #128

@wattsie

Description

@wattsie

What happened?

Hi all,
Sorry to bug, but on creating a fresh laravel install, including latest 0.3.1 and trying to build on x86 mac, it still fails.

Install appears to work no errors now.

However...

Wondering where the --x64 flag is coming from... shouldnt it be --x86 ??

The directory /Users/me/tmp/test1/vendor/nativephp/php-bin/bin/mac/x64 does NOT exist.
However the /Users/me/tmp/test1/vendor/nativephp/php-bin/bin/mac/x86 is available...


~/tmp/test1 ❯ php artisan native:build mac-x86
Build NativePHP app…

changed 13 packages, and audited 574 packages in 39s

81 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
Installing dependencies from lock file
Verifying lock file contents can be installed on current platform.
Package operations: 0 installs, 0 updates, 37 removals
  - Removing theseer/tokenizer (1.2.1)
  - Removing symfony/yaml (v6.3.0)
  - Removing spatie/laravel-ignition (2.2.0)
  - Removing spatie/ignition (1.9.0)
  - Removing spatie/flare-client-php (1.4.1)
  - Removing spatie/backtrace (1.5.3)
  - Removing sebastian/version (4.0.1)
  - Removing sebastian/type (4.0.0)
  - Removing sebastian/recursion-context (5.0.0)
  - Removing sebastian/object-reflector (3.0.0)
  - Removing sebastian/object-enumerator (5.0.0)
  - Removing sebastian/lines-of-code (2.0.0)
  - Removing sebastian/global-state (6.0.1)
  - Removing sebastian/exporter (5.0.0)
  - Removing sebastian/environment (6.0.1)
  - Removing sebastian/diff (5.0.3)
  - Removing sebastian/complexity (3.0.0)
  - Removing sebastian/comparator (5.0.0)
  - Removing sebastian/code-unit-reverse-lookup (3.0.0)
  - Removing sebastian/code-unit (2.0.0)
  - Removing sebastian/cli-parser (2.0.0)
  - Removing phpunit/phpunit (10.2.6)
  - Removing phpunit/php-timer (6.0.0)
  - Removing phpunit/php-text-template (3.0.0)
  - Removing phpunit/php-invoker (4.0.0)
  - Removing phpunit/php-file-iterator (4.0.2)
  - Removing phpunit/php-code-coverage (10.1.3)
  - Removing phar-io/version (3.2.1)
  - Removing phar-io/manifest (2.0.3)
  - Removing nunomaduro/collision (v7.7.0)
  - Removing myclabs/deep-copy (1.11.1)
  - Removing mockery/mockery (1.6.4)
  - Removing laravel/sail (v1.23.1)
  - Removing laravel/pint (v1.10.5)
  - Removing hamcrest/hamcrest-php (v2.0.1)
  - Removing filp/whoops (2.15.3)
  - Removing fakerphp/faker (v1.23.0)
  0/27 [>---------------------------]   0%
 10/27 [==========>-----------------]  37%
 19/27 [===================>--------]  70%
 26/27 [==========================>-]  96%
 27/27 [============================] 100%
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi

   INFO  Discovering packages.

  laravel/sanctum ....................................................... DONE
  laravel/tinker ........................................................ DONE
  nativephp/electron .................................................... DONE
  nativephp/laravel ..................................................... DONE
  nesbot/carbon ......................................................... DONE
  nunomaduro/termwind ................................................... DONE

53 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

> NativePHP@1.0.0 build:mac-x86
> cross-env node php.js --x64 && cross-env npm run build && cross-env electron-builder -p never --mac --config --x64

Binary Source:  /Users/me/tmp/test1/vendor/nativephp/php-bin/bin/mac/x64
Binary Filename:  php
Copying PHP file(s) from /Users/me/tmp/test1/vendor/nativephp/php-bin/bin/mac/x64 to /Users/me/tmp/test1/vendor/nativephp/electron/resources/js/resources/php
Error copying PHP binary Error: ENOENT: no such file or directory, stat '/Users/me/tmp/test1/vendor/nativephp/php-bin/bin/mac/x64'
    at Object.statSync (node:fs:1706:3)
    at Object.statSync (/Users/me/tmp/test1/vendor/nativephp/electron/resources/js/node_modules/graceful-fs/polyfills.js:318:34)
    at statSync (/Users/me/tmp/test1/vendor/nativephp/electron/resources/js/node_modules/fs-extra/lib/util/stat.js:10:52)
    at getStatsSync (/Users/me/tmp/test1/vendor/nativephp/electron/resources/js/node_modules/fs-extra/lib/util/stat.js:24:19)
    at Object.checkPathsSync (/Users/me/tmp/test1/vendor/nativephp/electron/resources/js/node_modules/fs-extra/lib/util/stat.js:49:33)
    at copySync (/Users/me/tmp/test1/vendor/nativephp/electron/resources/js/node_modules/fs-extra/lib/copy-sync/copy-sync.js:24:38)
    at Object.<anonymous> (/Users/me/tmp/test1/vendor/nativephp/electron/resources/js/php.js:37:9)
    at Module._compile (node:internal/modules/cjs/loader:1233:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1287:10)
    at Module.load (node:internal/modules/cjs/loader:1091:32) {
  errno: -2,
  syscall: 'stat',
  code: 'ENOENT',
  path: '/Users/me/tmp/test1/vendor/nativephp/php-bin/bin/mac/x64'
}
Copied certificate file to /Users/me/tmp/test1/vendor/nativephp/electron/resources/js/resources/cacert.pem

> NativePHP@1.0.0 build
> electron-vite build

vite v4.4.7 building for production...
✓ 3 modules transformed.
✓ built in 50ms
Could not resolve "../../resources/php/php?asset&asarUnpack" from "src/main/index.js"
file: /Users/me/tmp/test1/vendor/nativephp/electron/resources/js/src/main/index.js
error during build:
RollupError: Could not resolve "../../resources/php/php?asset&asarUnpack" from "src/main/index.js"
    at error (file:///Users/me/tmp/test1/vendor/nativephp/electron/resources/js/node_modules/rollup/dist/es/shared/node-entry.js:2245:30)
    at ModuleLoader.handleInvalidResolvedId (file:///Users/me/tmp/test1/vendor/nativephp/electron/resources/js/node_modules/rollup/dist/es/shared/node-entry.js:24654:24)
    at file:///Users/me/tmp/test1/vendor/nativephp/electron/resources/js/node_modules/rollup/dist/es/shared/node-entry.js:24616:26

~/tmp/test1 ❯                                                                                                                                                                                                                              took  46s


How to reproduce the bug

In a "tmp" directory hanging of home directory (be be sure there are no permission issues)

# New Laravel Skeleton
laravel new test1

cd test1

# Add latest NativePHP
composer require nativephp/electron:0.3.1

# install deps
php artisan native:install

# test start the app
php artisan native:serve

# build the app
php artisan native:build mac-x86

Package Version

0.3.1

PHP Version

8.1

Laravel Version

10.16.1

Which operating systems does with happen with?

macOS

Notes

Please note, Mac Intel x86 based

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions