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

On Windows, when running app:build "impossible find specified file" #479

Closed
Giuliano1993 opened this issue Jan 11, 2024 · 5 comments
Closed

Comments

@Giuliano1993
Copy link

When running the command app:build , in the compile step I receive this error:

 ErrorException 
  rename(C:\Users\giuli\Desktop\projects\laravel-zero-test\application.phar,C:\Users\giuli\Desktop\projects\laravel-zero-test\builds\application): Impossibile trovare il file specificato (code: 2)

That is because the application file in root is called only application and not application.phar

I fixed this going to laravel-zero\framework\src\Commands\BuildCommand.php on line 165 and changing this:

File::move($this->app->basePath($this->getBinary()).'.phar', $this->app->buildsPath($name));

to this:

File::move($this->app->basePath($this->getBinary()), $this->app->buildsPath($name));

Since this is probably an OS related issue I'd first like to hear if on linux or mac there's the same issue; otherwise we could add an OS based control to change the file call based on OS.

I'd love to make a PR for this once is verified

@owenvoke
Copy link
Member

This shouldn't be an issue, it should build the .phar to the root directory with Box, and then move it (with rename) to the builds directory (without the .phar). The non-.phar in the root isn't a PHAR file, so won't work standalone.

Do you have the contents of your box.json? 🤔

I'm not sure if Box really supports or tests on Windows anymore. I'll try to give this a test tonight, and see if I can work out the issue.

@Giuliano1993
Copy link
Author

Okay so thank you for specifying! I dug more in the documentation and found the right command for building using box, I didn't realize a double step was needed for build, fist the box command and then the app:build, so thank you for pointing that out to me and sorry for not noticing it before.

I can confirm that box is still supporting windows, it just worked for me! 😄

Still I feel that docs could be clearer about the building process, so I'll try more things out a bit and try to propose something!
Thanks again!

@owenvoke
Copy link
Member

The app:build command should be running Box behind the scenes, which is why I'm confused. 🤔 You shouldn't need to run box first.

Do you mind running app:build -vvv, and posting the verbose output here?

@Giuliano1993
Copy link
Author

In fact, that sounded strange to me, too, having to do that!
I actually was willing to give you the output, but it started giving me a different issue.
So I created a project from zero and worked all fine first shot, it built the application just by running the command and it does everything it needs to.

I'm a bit confused, but I probably got something wrong in the first run and messed a bit things up ( even If I had just the default files on while testing things so it is still strange ).
Anyhow if I run again into the same issue I'll paste the output here!

@owenvoke
Copy link
Member

That's great, going to close this issue. But feel free to reopen it, or post here if you hit the issue again. 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants