Closed vikas5914 closed 4 months ago
Cross-compilation hasn't been tested yet.
Also, you won't be able to compile for Mac on anything other than a Mac - this is a limitation of Electron (and probably an Apple thing 🤷♂️)
Stick to compiling for the current platform for now with:
php artisan native:build win
@simonhamp I am not trying to cross-compile. Just for windows only.
According to documentation, php artisan native:build
will build for the platform and architecture where I am running the build.
So my expectation it should build only for the windows,but instead its trying to cross-compile.
+1
Ok, there are 3 issues here 😅
native:build
without a platform qualifier - what is the developer expectationIt sounds like 2 & 3 are conflicting, but how it gets resolved should possibly be determined by 1.
So the question is: ignoring what the docs say for a second, what do you expect to happen when running the command php artisan native:build
?
@simonhamp I recently used electron/packager
, which created a build for the current host platform if no platform is provided. So I am ok with the same behaviour.
People can provide that argument if they want to build for cross or all platforms.
I agree, without platform should be current platform But perhaps add the 'all' argument to build for all platforms
Thanks both for the feedback. I'll get this 'fixed' then so that the implementation lines up with the docs
Cross-compilation hasn't been tested yet.
Also, you won't be able to compile for Mac on anything other than a Mac - this is a limitation of Electron (and probably an Apple thing 🤷♂️)
Stick to compiling for the current platform for now with:
php artisan native:build win
I'm not sure if there are solutions for building apps that aren't electron-based, but I do recall one of my friends having to get my other friend, who had a Mac, to build his app for him.
Wasn't electron either so I do think it's an Apple/Mac limitation.
Thanks both for the feedback. I'll get this 'fixed' then so that the implementation matches the docs.
@simonhamp Since this is Laravel-based, we can use prompts to choose the OS if no platform is provided.
@vikas5914 we could...
@simonhamp check https://github.com/NativePHP/electron/pull/92
What were you trying to do?
When running
php artisan native:build
on Windows,What happened?
it throws error saying
Error: Command failed: D:\Projects\trash\laravel-win\vendor\nativephp\electron\resources\js\resources\php\php
Upon checking the log and comparing it with
php artisan native:build win
it looks like the command is wrong.. it runningNativePHP@1.0.0 build:all
instead ofNativePHP@1.0.0 build:win
How to reproduce the bug
Just create a fresh new L11 app install the native PHP and run the command
Package Versions
0.6.2
PHP Version
8.2.18
Laravel Version
11.0
Node Version
22.0.0
Which operating systems have you seen this occur on?
Windows
OS version
Windows 11 Pro, 24H2, 26100.268
Notes
No response