{"thread":{"id":"38246","subject":"[PATCH 0/5] Fix the Visual Studio 2008 .sln generator","startedAt":"2014-12-24T10:47:09Z","lastAt":"2014-12-26T12:06:39Z","messageCount":8,"participants":["Philip Oakley"],"isPatch":true,"patchVersion":1,"patchTotal":5},"messages":[{"id":"254077","messageId":"1419418034-6276-1-git-send-email-philipoakley@iee.org","threadId":"38246","inReplyTo":null,"subject":"[PATCH 0/5] Fix the Visual Studio 2008 .sln generator","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":"2014-12-24T10:47:09Z","receivedAt":"2014-12-24T10:47:09Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"Potential Windows developers are likely to be using Visual Studio as\ntheir IDE. The tool stack required for Windows can be tortuous as it\ncrosses the boundaries between platforms and philosophies. This patch\nseries seeks to maintain the tools that could assist such developers.\nIn particular, those tools that generate an initial Visual Studio\nproject (.sln ) file.\n\nThe .sln generator in contrib began to break when internationalisation\nintroduced an extra -o option. This recently worsened with the addition\nof invalidcontinue.obj for 'improved POSIX compatibility'.\n\nI hacked a bit when I first attempted to use the VS IDE and noticed the\ni18n issue. I didn't completely solve all my issues because of further\nissues with VS2010 Express, so no patches were submitted at the time.\n\nNow, with a fresh copy of VS20008 Express, I saw the additional problem\nof the addition of the invalidcontinue.obj reference causing the .sln\ngeneration to fail.\n\nThe series has been tested against both recent git/git and msysgit/git.\nBoth produce good VS2008 .sln project files though only msysgit/git\ncompiles without error, both using the msysgit msvc-build script.\nThose compile errors are not related to this patch series.\n\nAn initial RFC version was discussed on the msysgit list\nhttps://groups.google.com/forum/#!topic/msysgit/3MQ_NMNM390 or\nhttp://thread.gmane.org/gmane.comp.version-control.msysgit/21132.\n\nThe final patch adds a poorman's --verbose by a few carefully selected\ncommented out debug print statements to assist others in resolving\nfuture breakages.\n\nI've cc'd those who have contributed or patched the engine.pl, or\nappear to be interested via a $gmane search, who can hopefully comment.\n\n\nPhilip Oakley (5):\n  engine.pl: Fix i18n -o option in msvc buildsystem generator\n  engine.pl: Properly accept quoted spaces in filenames\n  engine.pl: ignore invalidcontinue.obj which is known to MSVC\n  vcbuild/readme: Improve layout and reference msvc-build script\n  engine.pl: provide more debug print statements\n\n compat/vcbuild/README          | 27 +++++++++++++++++++--------\n contrib/buildsystems/engine.pl | 27 +++++++++++++++++++++------\n 2 files changed, 40 insertions(+), 14 deletions(-)\n\n-- \n2.1.0\n"},{"id":"254078","messageId":"1419418034-6276-2-git-send-email-philipoakley@iee.org","threadId":"38246","inReplyTo":"1419418034-6276-1-git-send-email-philipoakley@iee.org","subject":"[PATCH 1/5] engine.pl: Fix i18n -o option in msvc buildsystem generator","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":"2014-12-24T10:47:10Z","receivedAt":"2014-12-24T10:47:10Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"The i18n 5e9637c (i18n: add infrastructure for translating\nGit with gettext, 2011-11-18) introduced an extra '-o' option\ninto the make file, which broke engine.pl code for extracting\nthe git.sln for msvc gui-IDE.\n\nAdd tests to remove these non linker options, in same vein as\n74cf9bd (engine.pl: Fix a recent breakage of the buildsystem\ngenerator, 2010-01-22).\n\nSigned-off-by: Philip Oakley <philipoakley@iee.org>\n---\n contrib/buildsystems/engine.pl | 6 ++++++\n 1 file changed, 6 insertions(+)\n\ndiff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl\nindex 23da787..f48c28a 100755\n--- a/contrib/buildsystems/engine.pl\n+++ b/contrib/buildsystems/engine.pl\n@@ -140,6 +140,12 @@ sub parseMakeOutput\n             next;\n         }\n \n+        if ($text =~ /^(mkdir|msgfmt) /) {\n+            # options to the Portable Object translations\n+            # the line \"mkdir ... && msgfmt ...\" contains no linker options\n+            next;\n+        }\n+\n         if($text =~ / -c /) {\n             # compilation\n             handleCompileLine($text, $line);\n-- \n2.1.0\n"},{"id":"254080","messageId":"1419418034-6276-3-git-send-email-philipoakley@iee.org","threadId":"38246","inReplyTo":"1419418034-6276-1-git-send-email-philipoakley@iee.org","subject":"[PATCH 2/5] engine.pl: Properly accept quoted spaces in filenames","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":"2014-12-24T10:47:11Z","receivedAt":"2014-12-24T10:47:11Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"The engine.pl script barfs on the properly quoted spaces in\nfilename options prevalent on Windows. Use shellwords() rather\nthan split() to separate such options.\n\nSigned-off-by: Philip Oakley <philipoakley@iee.org>\n---\n contrib/buildsystems/engine.pl | 7 ++++---\n 1 file changed, 4 insertions(+), 3 deletions(-)\n\ndiff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl\nindex f48c28a..7f45b80 100755\n--- a/contrib/buildsystems/engine.pl\n+++ b/contrib/buildsystems/engine.pl\n@@ -12,6 +12,7 @@ use File::Basename;\n use File::Spec;\n use Cwd;\n use Generators;\n+use Text::ParseWords;\n \n my (%build_structure, %compile_options, @makedry);\n my $out_dir = getcwd();\n@@ -237,7 +238,7 @@ sub removeDuplicates\n sub handleCompileLine\n {\n     my ($line, $lineno) = @_;\n-    my @parts = split(' ', $line);\n+    my @parts = shellwords($line);\n     my $sourcefile;\n     shift(@parts); # ignore cmd\n     while (my $part = shift @parts) {\n@@ -271,7 +272,7 @@ sub handleLibLine\n     my (@objfiles, @lflags, $libout, $part);\n     # kill cmd and rm 'prefix'\n     $line =~ s/^rm -f .* && .* rcs //;\n-    my @parts = split(' ', $line);\n+    my @parts = shellwords($line);\n     while ($part = shift @parts) {\n         if ($part =~ /^-/) {\n             push(@lflags, $part);\n@@ -312,7 +313,7 @@ sub handleLinkLine\n {\n     my ($line, $lineno) = @_;\n     my (@objfiles, @lflags, @libs, $appout, $part);\n-    my @parts = split(' ', $line);\n+    my @parts = shellwords($line);\n     shift(@parts); # ignore cmd\n     while ($part = shift @parts) {\n         if ($part =~ /^-IGNORE/) {\n-- \n2.1.0\n"},{"id":"254079","messageId":"1419418034-6276-4-git-send-email-philipoakley@iee.org","threadId":"38246","inReplyTo":"1419418034-6276-1-git-send-email-philipoakley@iee.org","subject":"[PATCH 3/5] engine.pl: ignore invalidcontinue.obj which is known to MSVC","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":"2014-12-24T10:47:12Z","receivedAt":"2014-12-24T10:47:12Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"Commit 4b623d8 (MSVC: link in invalidcontinue.obj for better\nPOSIX compatibility, 2014-03-29) is not processed correctly\nby the buildsystem. Ignore it.\n\nAlso split the .o and .obj processing; 'make' does not produce .obj\nfiles. Only substitute filenames ending with .o when generating the\nsource .c filename.\n\nSigned-off-by: Philip Oakley <philipoakley@iee.org>\n---\n contrib/buildsystems/engine.pl | 10 +++++++---\n 1 file changed, 7 insertions(+), 3 deletions(-)\n\ndiff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl\nindex 7f45b80..e913280 100755\n--- a/contrib/buildsystems/engine.pl\n+++ b/contrib/buildsystems/engine.pl\n@@ -289,7 +289,7 @@ sub handleLibLine\n #    exit(1);\n     foreach (@objfiles) {\n         my $sourcefile = $_;\n-        $sourcefile =~ s/\\.o/.c/;\n+        $sourcefile =~ s/\\.o$/.c/;\n         push(@sources, $sourcefile);\n         push(@cflags, @{$compile_options{\"${sourcefile}_CFLAGS\"}});\n         push(@defines, @{$compile_options{\"${sourcefile}_DEFINES\"}});\n@@ -333,8 +333,12 @@ sub handleLinkLine\n         } elsif ($part =~ /\\.(a|lib)$/) {\n             $part =~ s/\\.a$/.lib/;\n             push(@libs, $part);\n-        } elsif ($part =~ /\\.(o|obj)$/) {\n+        } elsif ($part eq 'invalidcontinue.obj') {\n+            # ignore - known to MSVC\n+        } elsif ($part =~ /\\.o$/) {\n             push(@objfiles, $part);\n+        } elsif ($part =~ /\\.obj$/) {\n+            # do nothing, 'make' should not be producing .obj, only .o files\n         } else {\n             die \"Unhandled lib option @ line $lineno: $part\";\n         }\n@@ -343,7 +347,7 @@ sub handleLinkLine\n #    exit(1);\n     foreach (@objfiles) {\n         my $sourcefile = $_;\n-        $sourcefile =~ s/\\.o/.c/;\n+        $sourcefile =~ s/\\.o$/.c/;\n         push(@sources, $sourcefile);\n         push(@cflags, @{$compile_options{\"${sourcefile}_CFLAGS\"}});\n         push(@defines, @{$compile_options{\"${sourcefile}_DEFINES\"}});\n-- \n2.1.0\n"},{"id":"254082","messageId":"1419418034-6276-5-git-send-email-philipoakley@iee.org","threadId":"38246","inReplyTo":"1419418034-6276-1-git-send-email-philipoakley@iee.org","subject":"[PATCH 4/5] vcbuild/readme: Improve layout and reference msvc-build script","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":"2014-12-24T10:47:13Z","receivedAt":"2014-12-24T10:47:13Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"Layout the 'either/or' with more white space to clarify\nwhich alternatives are matched up.\n\nReference the Msysgit build script which automates one sequence of options.\n\nSigned-off-by: Philip Oakley <philipoakley@iee.org>\n---\n compat/vcbuild/README | 27 +++++++++++++++++++--------\n 1 file changed, 19 insertions(+), 8 deletions(-)\n\ndiff --git a/compat/vcbuild/README b/compat/vcbuild/README\nindex df8a657..7548dc4 100644\n--- a/compat/vcbuild/README\n+++ b/compat/vcbuild/README\n@@ -3,20 +3,24 @@ The Steps of Build Git with VS2008\n 1. You need the build environment, which contains the Git dependencies\n    to be able to compile, link and run Git with MSVC.\n \n-   You can either use the binary repository:\n+   You can either:\n+      use the binary repository:\n \n        WWW: http://repo.or.cz/w/msvcgit.git\n        Git: git clone git://repo.or.cz/msvcgit.git\n        Zip: http://repo.or.cz/w/msvcgit.git?a=snapshot;h=master;sf=zip\n \n-   and call the setup_32bit_env.cmd batch script before compiling Git,\n-   (see repo/package README for details), or the source repository:\n+      and call the setup_32bit_env.cmd batch script before compiling Git,\n+     (see repo/package README for details),\n+\n+   or:\n+      use the source repository:\n \n        WWW: http://repo.or.cz/w/gitbuild.git\n        Git: git clone git://repo.or.cz/gitbuild.git\n        Zip: (None, as it's a project with submodules)\n \n-   and build the support libs as instructed in that repo/package.\n+     and build the support libs as instructed in that repo/package.\n \n 2. Ensure you have the msysgit environment in your path, so you have\n    GNU Make, bash and perl available.\n@@ -33,18 +37,25 @@ The Steps of Build Git with VS2008\n        make common-cmds.h\n    to generate the common-cmds.h file needed to compile git.\n \n-4. Then either build Git with the GNU Make Makefile in the Git projects\n-   root\n+4. Then either\n+\n+     build Git with the GNU Make Makefile in the Git projects root\n        make MSVC=1\n-   or generate Visual Studio solution/projects (.sln/.vcproj) with the\n+   or\n+\n+   generate Visual Studio solution/projects (.sln/.vcproj) with the\n    command\n        perl contrib/buildsystems/generate -g Vcproj\n    and open and build the solution with the IDE\n        devenv git.sln /useenv\n-   or build with the IDE build engine directly from the command line\n+     or\n+\n+   build with the IDE build engine directly from the command line\n        devenv git.sln /useenv /build \"Release|Win32\"\n    The /useenv option is required, so Visual Studio picks up the\n    environment variables for the support libraries required to build\n    Git, which you set up in step 1.\n \n Done!\n+\n+Or, use the Msysgit msvc-build script; available from that project.\n-- \n2.1.0\n"},{"id":"254081","messageId":"1419418034-6276-6-git-send-email-philipoakley@iee.org","threadId":"38246","inReplyTo":"1419418034-6276-1-git-send-email-philipoakley@iee.org","subject":"[PATCH 5/5] engine.pl: provide more debug print statements","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":"2014-12-24T10:47:14Z","receivedAt":"2014-12-24T10:47:14Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"Assist developers transitioning between the two cultures\nby including appropriate, but commented out, debug statements.\n\nThis acts as a poor man's --verbose option. The test suite doesn't\ncover the contrib/buildsystems (or Msysgit's msvc-build) contributions\nso fails to notice breakages there-in.\n\nSigned-off-by: Philip Oakley <philipoakley@iee.org>\n---\n contrib/buildsystems/engine.pl | 4 ++++\n 1 file changed, 4 insertions(+)\n\ndiff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl\nindex e913280..24a4c61 100755\n--- a/contrib/buildsystems/engine.pl\n+++ b/contrib/buildsystems/engine.pl\n@@ -41,6 +41,7 @@ EOM\n # Parse command-line options\n while (@ARGV) {\n     my $arg = shift @ARGV;\n+\t#print \"Arg: $arg \\n\";\n     if (\"$arg\" eq \"-h\" || \"$arg\" eq \"--help\" || \"$arg\" eq \"-?\") {\n \tshowUsage();\n \texit(0);\n@@ -123,6 +124,7 @@ sub parseMakeOutput\n     print \"Parsing GNU Make output to figure out build structure...\\n\";\n     my $line = 0;\n     while (my $text = shift @makedry) {\n+\t\t#print \"Make: $text\\n\"; # show the makedry line\n         my $ate_next;\n         do {\n             $ate_next = 0;\n@@ -257,6 +259,7 @@ sub handleCompileLine\n         } elsif ($part =~ /\\.(c|cc|cpp)$/) {\n             $sourcefile = $part;\n         } else {\n+            print \"full line: $line\\n\";\n             die \"Unhandled compiler option @ line $lineno: $part\";\n         }\n     }\n@@ -282,6 +285,7 @@ sub handleLibLine\n             $libout = $part;\n             $libout =~ s/\\.a$//;\n         } else {\n+            print \"full line: $line\\n\";\n             die \"Unhandled lib option @ line $lineno: $part\";\n         }\n     }\n-- \n2.1.0\n"},{"id":"254103","messageId":"9B2F64A2564241B59450227A41A0ACD6@PhilipOakley","threadId":"38246","inReplyTo":"1419418034-6276-1-git-send-email-philipoakley@iee.org","subject":"Re: [PATCH 0/5] Fix the Visual Studio 2008 .sln generator","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":null,"receivedAt":"2014-12-26T12:06:39Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: \"Philip Oakley\" <philipoakley@iee.org>\n> Potential Windows developers are likely to be using Visual Studio as\n> their IDE. The tool stack required for Windows can be tortuous as it\n> crosses the boundaries between platforms and philosophies. This patch\n> series seeks to maintain the tools that could assist such developers.\n> In particular, those tools that generate an initial Visual Studio\n> project (.sln ) file.\n>\n> The .sln generator in contrib began to break when internationalisation\n> introduced an extra -o option. This recently worsened with the \n> addition\n> of invalidcontinue.obj for 'improved POSIX compatibility'.\n>\n> I hacked a bit when I first attempted to use the VS IDE and noticed \n> the\n> i18n issue. I didn't completely solve all my issues because of further\n> issues with VS2010 Express, so no patches were submitted at the time.\n>\n> Now, with a fresh copy of VS20008 Express, I saw the additional \n> problem\n> of the addition of the invalidcontinue.obj reference causing the .sln\n> generation to fail.\n>\n> The series has been tested against both recent git/git and \n> msysgit/git.\n> Both produce good VS2008 .sln project files though only msysgit/git\n> compiles without error, both using the msysgit msvc-build script.\n> Those compile errors are not related to this patch series.\n\nNow, having tried using the VS project output for some follow on work, \nI've found that the resultant .sln file is incomplete, though does \ncompile fine as noted.\n\nInvestigation has shown that the 'failure' to provide a complete Git \nproject would apper to have begun somewhere between v1.7.9 and v1.8.0. \nV1.7.9 has 'git', while v1.8.0 doesn't (along with other missing \nartefacts).\n\nLooks like firther fixes are needed once the cause is determined.\n\n>\n> An initial RFC version was discussed on the msysgit list\n> https://groups.google.com/forum/#!topic/msysgit/3MQ_NMNM390 or\n> http://thread.gmane.org/gmane.comp.version-control.msysgit/21132.\n>\n> The final patch adds a poorman's --verbose by a few carefully selected\n> commented out debug print statements to assist others in resolving\n> future breakages.\n>\n> I've cc'd those who have contributed or patched the engine.pl, or\n> appear to be interested via a $gmane search, who can hopefully \n> comment.\n>\n>\n> Philip Oakley (5):\n>  engine.pl: Fix i18n -o option in msvc buildsystem generator\n>  engine.pl: Properly accept quoted spaces in filenames\n>  engine.pl: ignore invalidcontinue.obj which is known to MSVC\n>  vcbuild/readme: Improve layout and reference msvc-build script\n>  engine.pl: provide more debug print statements\n>\n> compat/vcbuild/README          | 27 +++++++++++++++++++--------\n> contrib/buildsystems/engine.pl | 27 +++++++++++++++++++++------\n> 2 files changed, 40 insertions(+), 14 deletions(-)\n>\n> -- \n\nPhilip \n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"Git for Windows\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/d/optout.\n"},{"id":"254104","messageId":"862FFBB15AC74BD9AB675310958C6715@PhilipOakley","threadId":"38246","inReplyTo":"1419418034-6276-2-git-send-email-philipoakley@iee.org","subject":"Re: [PATCH 1/5] engine.pl: Fix i18n -o option in msvc buildsystem generator","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":null,"receivedAt":"2014-12-26T12:06:39Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: \"Philip Oakley\" <philipoakley@iee.org>\n> The i18n 5e9637c (i18n: add infrastructure for translating\n> Git with gettext, 2011-11-18) introduced an extra '-o' option\n> into the make file, which broke engine.pl code for extracting\n> the git.sln for msvc gui-IDE.\n>\n> Add tests to remove these non linker options, in same vein as\n> 74cf9bd (engine.pl: Fix a recent breakage of the buildsystem\n> generator, 2010-01-22).\n\nIt now looks like this resolution is in the wrong direction. The\ncorrect right solution is to include\n    NO_GETTEXT = YesPlease\ninto the _Windows_ section of the Makefile.\n\nMysgit uses the _MinGW_ section, and fixed the NO_GETTEXT requirement, \nso the breakage in the Windows section build wasn't noticed.\n\nHowever, the test is still useful for adding a detection step and \nproviding a warning to users\n    NO_GETTEXT = YesPlease\n\n>\n> Signed-off-by: Philip Oakley <philipoakley@iee.org>\n> ---\n> contrib/buildsystems/engine.pl | 6 ++++++\n> 1 file changed, 6 insertions(+)\n>\n> diff --git a/contrib/buildsystems/engine.pl \n> b/contrib/buildsystems/engine.pl\n> index 23da787..f48c28a 100755\n> --- a/contrib/buildsystems/engine.pl\n> +++ b/contrib/buildsystems/engine.pl\n> @@ -140,6 +140,12 @@ sub parseMakeOutput\n>             next;\n>         }\n>\n> +        if ($text =~ /^(mkdir|msgfmt) /) {\n> +            # options to the Portable Object translations\n> +            # the line \"mkdir ... && msgfmt ...\" contains no linker \n> options\n> +            next;\n> +        }\n> +\n>         if($text =~ / -c /) {\n>             # compilation\n>             handleCompileLine($text, $line);\n> -- \n\nThere are still more issues to be resolved e.g.\n  test-svn-fe.obj : error LNK2001: unresolved external symbol _strtoull\n etc.\nPhilip \n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"Git for Windows\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/d/optout.\n"}]}