Issue 82202 - Remove the need for $(WRAPCMD) for W32-bash builds
Summary: Remove the need for $(WRAPCMD) for W32-bash builds
Status: CLOSED FIXED
Alias: None
Product: Build Tools
Classification: Code
Component: solenv (show other issues)
Version: current
Hardware: PC Windows, all
: P3 Trivial (vote)
Target Milestone: ---
Assignee: hjs
QA Contact: issues@tools
URL:
Keywords:
Depends on: 84084
Blocks:
  Show dependency tree
 
Reported: 2007-10-03 03:31 UTC by quetschke
Modified: 2013-08-07 15:34 UTC (History)
4 users (show)

See Also:
Issue Type: TASK
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Patch for config_office and solenv (22.55 KB, patch)
2007-10-03 03:32 UTC, quetschke
no flags Details | Diff
Patch for testtools (916 bytes, patch)
2007-10-03 03:32 UTC, quetschke
no flags Details | Diff
Flip slashes to backslashes - copy to solenv/bin/ (5.99 KB, text/plain)
2007-10-03 03:34 UTC, quetschke
no flags Details
Make instsetoo_native work without WRAPCMD (7.11 KB, patch)
2007-11-18 14:37 UTC, quetschke
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description quetschke 2007-10-03 03:31:50 UTC
With dmake 4.11 it should be possible to remove the need for WRAPCMD/guw.exe.

I tried the following strategy:

* Use mixed mode path names (DOS paths with / instead of \ as directory
  separator) in the environment variables set by winenv.set[.sh]

* Enable .WINPATH to make dmake output mixed mode paths

* Set WRAPCMD to empty

The following attached patches are prove of principle patches that allow to
build OOo without guw.exe until it fails in instsetoo_native.

There are surprisingly few changes but the problems I encountered were:

* Some programs really want backslashes in DOS paths, but so far only two
  came up: csc.exe and rsc.exe. I created a very simple guw like wrapper that
  just flips every non-leading '/' to '\'. This script, slfl.pl is also
  attached and has to be copied into solenv/bin/.

* dmake's $(mktmp ..) function macro is not .WINPATH aware, it returns a POSIX
  path. Luckily there is a workaround for this problem. If TMPDIR is set to
  a mixed mode path mktmp returns a temp file that uses this path. This should
  be properly fixed in the next dmake.

My plan is solve this in two stages:
1. Clean up the patches and create a configure switch --disable-wrapcmd that
   switches the environment to the mode described above.
2. After building OOo without WRAPCMD is thoroughly tested remove the now unused
   $(WRAPCMD) occurences.

I will work on this in a nowrapcmd CWS soon.
Comment 1 quetschke 2007-10-03 03:32:33 UTC
Created attachment 48661 [details]
Patch for config_office and solenv
Comment 2 quetschke 2007-10-03 03:32:57 UTC
Created attachment 48662 [details]
Patch for testtools
Comment 3 quetschke 2007-10-03 03:34:00 UTC
Created attachment 48663 [details]
Flip slashes to backslashes - copy to solenv/bin/
Comment 4 quetschke 2007-11-18 14:37:44 UTC
Created attachment 49728 [details]
Make instsetoo_native work without WRAPCMD
Comment 5 quetschke 2007-11-19 04:50:33 UTC
All patches and some additional changes committed to CWS nowrapcmd1.

The default is now to build without WRAPCMD but a configure switch
 --enable-wrapcmd
can be used to enable its use again.

A follow-up issue and CWS will deal with the clean-up.
Comment 6 quetschke 2007-11-19 04:52:23 UTC
@ause: Please verify.

@is: Ingo, please check the parts in solenv that are used in instsetoo_native.
Comment 7 ingo.schmidt-rosbiegal 2007-11-21 08:41:42 UTC
The patch looks technically good. But I do not like, that the path conversion is
done in every systemcall in servicesfile.pm. It should only be done once for the
constant pathes.
Comment 8 quetschke 2007-11-21 22:21:30 UTC
@is: I agree, but the previous/old status is that the wrapper is called on the
full command-line, with all the overhead like parsing and tons of regexes.

With the new version this is reduced to one external call to cygpath on
arguments that really have to be translated (in fix_cygwin_path(), but non
cygwin targets should not suffer much from this, as for them no external
function calls are involved.).

See the FIXME I left in there, it is even worse, $typesrdbref for example is
brought into POSIX form by get_source_path_cygwin_safe() just so that wrapcmd
can convert it back into DOS form.

I see there is a lot of clean up possible after wrapcmd is gone, but I hope
we can do this in CWS wrapcmd2 and I hope you are OK with the little bit of
extra overhead until then.
Comment 9 ingo.schmidt-rosbiegal 2007-11-22 09:53:36 UTC
Yes, I agree that this is okay as a temporary solution. 
Comment 10 hjs 2007-12-04 18:22:08 UTC
ok
Comment 11 hjs 2007-12-21 13:42:15 UTC
seen on mws