-
Notifications
You must be signed in to change notification settings - Fork 296
Use lowercase for Windows drive name to resolve issue #250 #274
Conversation
On windows, bootstrap.bat failed with next error. Command 'escriptize' not understood or not applicable This happens because the drive name in path got from rebar_utils:get_cwd() and base_dir(Config) are different case. Made the drive name the same lowercase using filename:absname().
@@ -316,7 +316,8 @@ processing_base_dir(Config) -> | |||
processing_base_dir(Config, Cwd). | |||
|
|||
processing_base_dir(Config, Dir) -> | |||
Dir =:= base_dir(Config). | |||
Dir_abs = filename:absname(Dir), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AbsDir
would be more consistent.
Thanks a lot. I don't have access to a Windows environment, so it's great you were able to track down and fix the bug. In addition to the code comments, can you please:
Also, feel free to add yourself to THANKS. |
@redpine50, out of curiosity, what exactly are the results of |
base_dir/1 should already return an absolute path, because that's how it's saved on startup
|
The patch seems like a reasonable fix, but interestingly @dgud tested and got the following results:
Nevertheless, we should merge this after @redpine50 has fixed the minor issues. If I had to make a guess, I'd say there's a difference in Windows configuration or the execution environment of @redpine50, just to be certain, in your Windows environment Also, if anyone wants to check what the underlying code does, see prim_file, efile_drv.c, and win_efile.c. |
In my erlang R16B03-1 and 17 on Windows 7, file:get_cwd() returns drive letter as uppercase. Anyway, filename:absname change the drive letter to lowercase as follows. https://github.com/erlang/otp/blob/maint/lib/stdlib/src/filename.erl
|
base_dir() returns already filename:absname()'ed path.
Since windows doesn't care about lower|upper case, I guess it's unknown And thus if you are going to compare the paths you will have to handle that. On Sat, May 10, 2014 at 6:53 AM, redpine50 notifications@github.com wrote:
|
@redpine50, you may want to squash the commits into one and add yourself to THANKS, but none of that is a (hard) merge blocker. Therefore, +1. |
@jaredmorrow, @Vagabond unfortunately this didn't get into 2.3.0. Can we at least get this merged to master? |
Use lowercase for Windows drive name to resolve issue #250
On windows, bootstrap.bat failed with next error.
Command 'escriptize' not understood or not applicable
This happens because the drive name in path got from rebar_utils:get_cwd() and base_dir(Config) are different case.
Made the drive name the same lowercase using filename:absname().