| Issue 1167: | Gerrit CGI wont execute on windows | |
| 4 people starred this issue and may be notified of changes. | Back to list |
Affected Version: 2.2.1
What steps will reproduce the problem?
1. Setup Gerrit on windows
2. Configure Gitweb
3. Try to view a project in gitweb
What is the expected output? What do you see instead?
Should see the gitweb project view.
Instead I get Error 500
Problem accessing /gitweb. Reason:
Cannot run program "d:\Gitweb\gitweb.pl" (in directory "D:\Gerrit\git\Test.git"): CreateProcess error=193, %1 is not a valid Win32 application
Please provide any additional information below.
From what I can tell the perl script is being called by Runtime.getRuntime().exec(new String[] {gitwebCgi.getAbsolutePath()},
makeEnv(req, project), repo.getDirectory());
at https://code.google.com/p/gerrit/source/browse/gerrit-httpd/src/main/java/com/google/gerrit/httpd/gitweb/GitWebServlet.java#421
From my research this is incompatible with running scripts on windows. It can only be used to run exe's on windows. (someone correct me if I'm wrong)
I have activestate perl 5.10 installed and I can run the perl script from the command line. I also have changed the shebang line to point to perl.
I believe the only solution is to detect windows in gerrit and append the perl command to the beginning. Or allow an administrator to do that with the conf. You can't right now cause its a datatype file. It would have to be a string and the admin would need to specify the full command.
Nov 4, 2011
#1
sop@google.com
Status:
Accepted
Nov 4, 2011
The bat file works. Separate problem, gitweb.cgi wont run on windows without modifications. List form of pipe open not implemented So, (very) low priority on this.
Nov 4, 2011
For those interested this is my batch file @c:\Perl\bin\perl.exe D:\Gitweb\gitweb.pl
Nov 4, 2011
Ok, after lots of pain it is possible to do it with msysgit's perl. You have to manually install CGI.pm. I got CGI.pm from https://github.com/msysgit/msysgit/tree/msys/lib/perl5/5.8.8 and my updated batch script is @"C:\Program files\git\bin\perl.exe" D:\Gitweb\gitweb.cgi
May 20, 2012
this should be report to msysgit "Git for windows" package to have CGI perl module and gitweb.bat for it as well |
|
| ► Sign in to add a comment |