Viktor Kutuzov
2009-Jul-03 08:09 UTC
[LLVMdev] [llvm-commits] [PATCH] Fix for llvm::FindExecutable (fails to find executable if path is provided)
Hey Daniel, Thank you for your help. I appreciate this. Your last tweak looks reasonable. However, there are 2 things with that: 1. It has changed the behaviour of the FindExecutable method. Before this change, it searched the directory the executable has been started from, then directories from PATH. Now it checks the current working directory first (makeAbsolute does this for just a file name) and then does what it did before. I'm not saying this is bad, just different. Both works fine for the bugpoint. 2. makeAbsolute doesn't really work for the Windows if full path is provided. :) It checked the first character and if it is not "/" it treats the string as a file name and requests a root directory (which is also broken and always returns "c:/"). So, the original problem remains open. But this makes me fix the Path::makeAbsolute. - Viktor -----Original Message----- From: Daniel Dunbar [mailto:daniel at zuster.org] Sent: Wednesday, July 01, 2009 2:37 PM To: Commit Messages and Patches for LLVM Subject: Re: [llvm-commits] [PATCH] Fix for llvm::FindExecutable (fails to find executable if path is provided) I applied this this morning but forgot to send an email about it, I applied it here: http://llvm.org/viewvc/llvm-project?view=rev&revision=74608 Your comment below makes sense, however, so I tweaked it again here: http://llvm.org/viewvc/llvm-project?view=rev&revision=74645 so that relative paths work. Does this look reasonable to you? Also, does it work? :) - Daniel On Wed, Jul 1, 2009 at 10:04 AM, Viktor Kutuzov<vkutuzov at accesssoftek.com> wrote:> Hi Chris, > >> Please use sys::Path::isAbsolute to check to see if it is an absolute > > I didn't want to check if it is an absolute, I wanted to check if > there is any directory part (absolute or relative). Is there anything > wrong with relative path? It seems the right way to do this would be > adding Path::hasDirname() method and use it there instead. > > What do you think? > > Best regards, > Viktor > > ----- Original Message ----- > From: "Chris Lattner" <clattner at apple.com> > To: "Commit Messages and Patches for LLVM" <llvm-commits at cs.uiuc.edu> > Cc: "Viktor Kutuzov" <vkutuzov at accesssoftek.com> > Sent: Wednesday, July 01, 2009 8:44 AM > Subject: Re: [llvm-commits] [PATCH] Fix for llvm::FindExecutable > (fails to find executable if path is provided) > > >> >> On Jun 30, 2009, at 11:52 PM, Viktor Kutuzov wrote: >> >>> Hello everyone, >>> >>> The llvm::FindExecutable fails to find a named executible if full >>> path is provided. >> >> Hi Viktor, >> >> Please use sys::Path::isAbsolute to check to see if it is an absolute>> path, this will work on windows as well as unix. Thanks, >> >> -Chris >> >>> >>> Please find the patch attached. >>> >>> Best regards, >>> Viktor >>> <SystemUtils.cpp.diff>______________________________________________ >>> _ >>> llvm-commits mailing list >>> llvm-commits at cs.uiuc.edu >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >> > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >_______________________________________________ llvm-commits mailing list llvm-commits at cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits <<makefile.diff>>