delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/04/20/16:59:37

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:references
:mime-version:content-type:in-reply-to; q=dns; s=default; b=pw3i
ySYHHjIR4r6saY1F7BcijSRsEO4zTc4ycEmPRK9C64TOkuSKMr4hhfIV/tOUEnw8
YdvzyjhgJNE1zcrf1kXHWTlnjahqb3G2iLTxDVSzX5Ys/PtTNadLNrERUqneBOF6
8hwINxk/hKkcE3aGcmdRJt0AvQAgPh+lgW5sDVQ=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:references
:mime-version:content-type:in-reply-to; s=default; bh=87nkzP7G/k
mBs8NIgmLc2DiqwXE=; b=HViYRI4lMKQZS7GWkGJWTH1gxZ2iQt3U4S7MiLmXqm
4gE0LfdfDS800Wd/O5Dny3ZMqWUJ4uEgwR0hujBauJ23NAd5ocn01EOLo1kyDeG7
rEfc+S1erRgec6+QTTIDm2cDHlJsoqXUAGtZUmcf5ftID8soCxw+qiaXXsatUHd5
8=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=judgement, H*f:sk:5717D8D, H*i:sk:5717D8D, Hx-languages-length:2868
X-HELO: mail-wm0-f51.google.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=3oCw/XAtAtv+4aIV78m6x40Fz5ztwdijOO83rH2iYwU=; b=CL+2C9FVs+7AJIfUygp28ztYmw7VtldLpfFX9MfXOo7XydcVDT8QXUup/ptVhVl50O 1gk1e2BW32B99yBv3iMcFoUWKeAW/D6vxL4vulqwJjkfj3J4i3NsVb4B+1kA16kstNpn 3yhpYJLGJisWKMazI/LEPPuiYBURHnuikMGCXa9qLxUE5lK0IocEuJc6+9HZA7XqUCuC DC5i1NTtOPOrEyo/GgD3LadxAb3o3QowDTfdNSR9cRV6QJ2sKh9pg3J4/L6jpmIBUE+S ZNSEkdVe/slet1GQsmjDBACrudBGqmxR53pHoMJteeo5CgZkmeKo97Ce6j1Kz9exC/+r 4uKw==
X-Gm-Message-State: AOPr4FXUSOAV86M8gGIkVu4/Pjwp5ApSjfpROgLtvYUELNMfL6oZOzVSTPE37gv03UwcrQ==
X-Received: by 10.28.39.5 with SMTP id n5mr24494768wmn.13.1461185946573; Wed, 20 Apr 2016 13:59:06 -0700 (PDT)
Date: Wed, 20 Apr 2016 21:59:04 +0100
From: Adam Dinwoodie <adam AT dinwoodie DOT org>
To: cygwin AT cygwin DOT com
Subject: Re: introduction, fix for npm w.r.t. git, and questions
Message-ID: <20160420205904.GK2345@dinwoodie.org>
References: <BLUPR03MB230DECD3A735AF3CB2225CBDF6D0 AT BLUPR03MB230 DOT namprd03 DOT prod DOT outlook DOT com> <20160420185011 DOT GJ2345 AT dinwoodie DOT org> <5717D8D9 DOT 2030600 AT gmail DOT com>
MIME-Version: 1.0
In-Reply-To: <5717D8D9.2030600@gmail.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-IsSubscribed: yes

On Wed, Apr 20, 2016 at 09:30:33PM +0200, silverwind wrote:
> >I think the "correct" fix would be to get npm (or possibly the
> >JavaScript engine itself?) to stop acting as if it's in a Windows
> >environment
> You're on the right track. The root issue is that Node.js (on which
> npm runs) is a native Windows binary in pretty much all cases, as
> it's not possible to build it or v8 (the JS engine) through Cygwin's
> toolchain, at least not without numerous modifications. Node.js had
> actual support for Cygwin until 0.4.2 (which is ancient), after
> which it was dropped, presumably because of v8 build issues.
> 
> If one were to obtain a Cygwin-built Node.js binary,
> `process.platform` would be `Linux` and npm would happily feed POSIX
> paths into git.

I think, sadly, this is something that's just not intended to work.  It
does work sometimes, but it's as much luck as judgement when it does.

Fundamentally you're need a native Windows application (Node.js/v8) to
be aware of Cygwin -- possible in specific instances by using wrapper
scripts or interface layers, but impossible in general because, for a
start, a native Windows application isn't going to have linked to
cygwin1.dll -- or a native Cygwin application (in this case Git) to be
aware of Windows, which goes against the principle of Cygwin providing a
compatibility layer that means *nix source code can be compiled without
needing to care about the fact that it's actually running in a Windows
environment.

(Yes Git has some Cygwin-specific code, but I think the bits that are
actually specific to Cygwin only are very small; most of it is just
different build options to account for differences in the same way Git
has BSD or Darwin-specific build options.)

Ideally, you'd get Node.js and v8 to compile and run within Cygwin.
Having attempted a similar task for the Golang compiler, though, I'm not
expecting that to be feasible, if it isn't supported upstream, at least
without some significant effort.

Failing that, given you're using native Windows v8, Node.js and npm,
your best bet may be to use the native Windows Git client, so npm's
entire toolchain is native Windows applications rather than a mix of
native Windows and Cygwin.  It's been a while since I tried it, but I
_think_ you can generally use Cygwin Git and Windows Git on the same
working copy without any difficulties, at least if you avoid the common
pain points like line ending rewriting and symlinks.

The final option, given you have a patch for npm that apparently gets
this all working anyway, may just be to create a fork of npm yourself,
patch support for Cygwin back in, and use that instead.  If the fixes to
get Cygwin working are simple enough, it should be reasonably easy to
keep merging changes in the upstream repository to your fork.

HTH

Adam

--
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019