public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "Cufi, Carles" <Carles.Cufi@nordicsemi.no>
To: "cygwin@cygwin.com" <cygwin@cygwin.com>
Subject: Re: git 2.8.3 spurious output
Date: Thu, 09 Jun 2016 07:52:00 -0000	[thread overview]
Message-ID: <087DA9770269374FB58D517AC05CCA3F017497826F@mbx04.nvlsi.no> (raw)

Hi there,


> On Jun 8, 2016, at 8:19 AM, Cufi, Carles wrote:
> >
> > So what's the better way of fixing this? Making /mingw/bin/gettext.sh
> have UNIX line endings or replacing it with the proper Cygwin gettext.sh
> that I seem to be missing?
> 
> Donât try to mix the Cygwin and MinGW build systems.  Having MinGW in
> the PATH while developing under Cygwin is one way to make such mistakes,
> since anything not found under Cygwin falls back to MinGW.
> 
> Instead, treat MinGW as a special mode separate from normal Cygwin
> operation.  MSYS is one way, but I prefer to use Cygwin most of the
> time, then run a âmingwâ script I wrote to temporarily shift my Cygwin
> environment to MinGW mode:
> 
>     #!/bin/sh
>     PATH=/cygdrive/c/mingw/bin:/cygdrive/c/windows:\
>     /cygdrive /c/windows/system32:/cygdrive/c/cygwin/bin
>     echo "Say 'exit' to leave MinGW shell and restore Cygwin
> environment."
>     /bin/bash --rcfile ~/.mingwrc
> 
> You also need that ~/.mingwrc file:
> 
>     alias make=mingw32-make
>     PS1='MinGW: \W \$ â

This sounds like a very good idea, but the problem is that sometimes I need to run mingw commands from standard Windows Command Prompts. That then forces me to have the MinGW bin folders in Window's PATH, which caused all the trouble in the first place apparently.
Someone else has mentioned that having the MinGW binaries in the system PATH is not a good idea, so I might simply get rid of that.

But I will save this script and try it out for when I want bash + mingw, thanks!


> Thereâs a way to avoid splitting the code between two files, but it
> would require a slightly more complicated command, so I wonât tell you
> how.  (If you figure it out, youâll probably agree that itâs worth
> splitting the code like this.)
> 
> The result is that your PATH temporarily shadows the Cygwin build tools
> with MinGW ones, excepting for make(1) which is named differently under
> MinGW, so we have to use an alias instead.
> 
> Because this creates a subshell, you can just âexitâ to get back out of
> MinGW mode into Cygwin mode, having never left the directory you were in
> when you entered MinGW mode.


This is a really neat trick to be able to run MinGW from within Cygwin and without having to resort to MSYS.
I don't mind having 2 files really, so I don't think I'll try to figure out how to merge them.

Thanks for all the feedback.

Carles


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

             reply	other threads:[~2016-06-09  7:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-09  7:52 Cufi, Carles [this message]
2016-06-09 19:37 ` Warren Young
2016-06-11 19:20   ` Brian Inglis
  -- strict thread matches above, loose matches on Subject: below --
2016-06-08 14:41 Cufi, Carles
2016-06-08 16:45 ` Achim Gratz
2016-06-08 14:19 Cufi, Carles
2016-06-08 14:27 ` Ken Brown
2016-06-08 14:33 ` Warren Young
2016-06-08 13:57 Cufi, Carles
2016-06-08 14:06 ` Ken Brown
2016-06-08  9:35 Cufi, Carles
2016-06-08 13:45 ` Ken Brown
2016-06-08 13:56   ` Ken Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=087DA9770269374FB58D517AC05CCA3F017497826F@mbx04.nvlsi.no \
    --to=carles.cufi@nordicsemi.no \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).