-
-
Notifications
You must be signed in to change notification settings - Fork 618
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
os.copyfile() fails on premake-5.0.0-alpha12 on Windows #918
Comments
That error message is written in os_copyfile.c
Based on your error message, it looks like you are passing in the literal string "$path" to the call. Windows isn't going to have any idea what to do with that. If you are trying to expand an environment variable, you will need to use "%path%". I am going to make this as closed, since that is definitely what is tripping Windows up. But feel free to reopen with more information if you need help getting things working! |
Sorry my bad for confusing bug report. $path of course made it look like i was using environment variables. I was using absolute paths on both OSX where it works and on windows. eg Target Directory = "C:\tmp\include" EDIT: Fixed typo in path. |
Reopening…I'm not on a Windows box right now to test. The code for |
Cool thanks, ill have a look at that this evening. Code certainly looks like it should be ok... The paths above are not exactly the ones i used but are close. |
I modifed the premake source to give extra information on why the copy failed on windows. Im getting error code back from CopyFileW (ERROR_ACCESS_DENIED). This can happen if the file is marked as read only, except in my case, it is not. Not sure what to do to fix the error. I can put in a pull request to add extra error information for when things fail for os.copyfile() at least? |
I think that would certainly be worthwhile! |
How does this look? |
By the way, my error message, original problem is this:
It seems like some wierd Windows thing. :( I cant change the permissions on the folder to NOT be read only even though i am an admin and i have ownership permissions on the folder. |
According to this the second parameter to |
This does look like the likely culprit. Regardless, I think we've identified that the issue is not with Premake per se so I am going to go ahead and mark this issue as closed for now. Feel free to reopen it if you have more questions though! |
Cool thanks. |
Hi,
I wrote a premake5 script for the OSX platform first which works as expected.
When i run the same script on Windows 10 on premake5 version 5.0.0-alpha12, i get an error when using
os.copyfile()
.The error is:
unable to copy file to $path
.I checked and the target directory exists and is a directory. The file I am trying to copy also exists. I checked by manually inspecting my filesystem and also using
os.isdir()
andos.isfile()
in my build script before i attempt the copy operation.Any ideas?
The text was updated successfully, but these errors were encountered: