From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10569 Path: news.gmane.org!.POSTED!not-for-mail From: Newsgroups: gmane.linux.lib.musl.general,gmane.comp.version-control.git Subject: RE: Re: Regression: git no longer works with musl libc's regex impl Date: Tue, 04 Oct 2016 20:00:57 -0700 Message-ID: <20161004200057.dc30d64f61e5ec441c34ffd4f788e58e.efa66ead67.wbe@email15.godaddy.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=_d79da263f1d494114b7e6a3b99b153b0" X-Trace: blaine.gmane.org 1475636487 31173 195.159.176.226 (5 Oct 2016 03:01:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 5 Oct 2016 03:01:27 +0000 (UTC) User-Agent: Workspace Webmail 6.5.1 Cc: Johannes.Schindelin@gmx.de, git@vger.kernel.org, "Jeff King" To: musl@lists.openwall.com Original-X-From: musl-return-10582-gllmg-musl=m.gmane.org@lists.openwall.com Wed Oct 05 05:01:23 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1brcSF-0006GR-IZ for gllmg-musl@m.gmane.org; Wed, 05 Oct 2016 05:01:11 +0200 Original-Received: (qmail 7576 invoked by uid 550); 5 Oct 2016 03:01:11 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 7558 invoked from network); 5 Oct 2016 03:01:11 -0000 X-SID: rf0y1t0010BLAW501 X-Originating-IP: 71.206.170.124 Xref: news.gmane.org gmane.linux.lib.musl.general:10569 gmane.comp.version-control.git:306170 Archived-At: --=_d79da263f1d494114b7e6a3b99b153b0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" =0A< =0A< =0A< -------- Original Message --------=0A< Subject: [musl] Re: R= egression: git no longer works with musl libc's=0A< regex impl=0A< From: Jo= hannes Schindelin =0A< Date: Tue, October 04, 2= 016 9:08 am=0A< To: Rich Felker =0A< Cc: Jeff King , git@vger.kernel.org,=0A< musl@lists.openwall.com=0A< =0A< Hi Rich= ,=0A< =0A< On Tue, 4 Oct 2016, Rich Felker wrote:=0A< =0A< > On Tue, Oct 04= , 2016 at 11:27:22AM -0400, Jeff King wrote:=0A< > > On Tue, Oct 04, 2016 a= t 11:08:48AM -0400, Rich Felker wrote:=0A< > > =0A< > > > 1. is nonzero mod= page size, it just works; the remainder of the=0Alast=0A< > > > page reads= as zero bytes when mmapped.=0A< > > =0A< > > Is that a portable assumption= ?=0A< > =0A< > Yes.=0A< =0A< No, it is not. You quote POSIX, but the matter= of the fact is that we=0Ause=0A< a subset of POSIX in order to be able to = keep things running on=0AWindows.=0A< =0A=0AAs far as I can tell (and as th= e attached program may help demonstrate),=0Athe above assumption has been v= alid on all versions of Windows since at=0Aleast Windows 2000. In this cont= ext, one thing to remember is that the=0Apage-size for the mod operation is= 4096, whereas the POSIX page-size=0A(for the purpose of mmap and mremap) i= s 65536. Note also that in the=0Acase of file-backed mapped sections, using= kernel32.dll or msvcrt.dll or=0Acygwin/newlib or midipix/musl is of little= significance, specifically=0Asince all invoke ZwCreateSection and ZwMapVie= wOfSection under the hood.=0A=0AHTH,=0Amidipix=0A=0A< And quite honestly, t= here are lots of reasons to keep things running=0Aon=0A< Windows, and even = to favor Windows support over musl support. Over=0Afour=0A< million reasons= : the Git for Windows users.=0A< =0A< So rather than getting into an ideolo= gical discussion about "broken"=0A< systems, it would be good to keep thing= s practical, realizing that=0Athose=0A< users make up a very real chunk of = all of Git's users.=0A< =0A< As to making NO_REGEX conditional on REG_START= END: you are talking=0Aabout=0A< apples and oranges here. NO_REGEX is a Mak= efile flag, while=0AREG_STARTEND=0A< is a C preprocessor macro.=0A< =0A< Un= less you can convince the rest of the Git developers (you would not=0A< con= vince me) to simulate autoconf by compiling an executable every=0Atime=0A< = `make` is run, to determine whether REG_STARTEND is defined, this is a=0A< = no-go.=0A< =0A< However, you *can* use autoconf directly, and come up with = a patch to=0Aour=0A< configure.ac that detects the absence of REG_STARTEND = and sets=0ANO_REGEX=3D1.=0A< =0A< Alternatively, you can set NO_REGEX=3D1 i= n your config.mak.=0A< =0A< Or, if you use one of the auto-detected cases i= n config.mak.uname, you=0A< could patch it to set NO_REGEX=3D1.=0A< =0A< An= d lastly, the best alternative would be to teach musl about=0A< REG_STARTEN= D, as it is rather useful a feature.=0A< =0A< Ciao,=0A< Johannes=0A< =0A=0A --=_d79da263f1d494114b7e6a3b99b153b0 Content-Transfer-Encoding: base64 Content-Type: text/x-c; name="mmap_file.c"; Content-Disposition: attachment; filename="mmap_file.c"; I2RlZmluZSBfWE9QRU5fU09VUkNFICAgICAgICAgICAgNTAwDQojZGVmaW5lIE5UX0ZJTEVfQkFD S0VEX1BBR0VfU0laRSA0MDk2DQoNCiNpbmNsdWRlIDx1bmlzdGQuaD4NCiNpbmNsdWRlIDxmY250 bC5oPg0KI2luY2x1ZGUgPHN0ZGlvLmg+DQojaW5jbHVkZSA8ZXJybm8uaD4NCiNpbmNsdWRlIDxz eXMvbW1hbi5oPg0KDQpzdGF0aWMgaW50IHRlc3RfZmlsZV9iYWNrZWRfbW1hcChpbnQgc2l6ZSkN CnsNCglpbnQgICAgIGZkOw0KCWludCAgICAgZXhzaXplOw0KCXZvaWQgKiAgYWRkcjsNCgljaGFy ICogIHRlc3Q7DQoJY2hhciAqICBjYXA7DQoJY2hhciAgICBuYW1lWzEyXTsNCg0KCS8qIGNyZWF0 ZSB0ZXN0IGZpbGUgb2YgZGVzaXJlZCBzaXplICovDQoJc3ByaW50ZihuYW1lLCIlZC50bXAiLHNp emUpOw0KDQoJaWYgKChmZCA9IGNyZWF0KG5hbWUsMDc1NSkpIDwgMCkNCgkJcmV0dXJuIC0xOw0K DQoJaWYgKGZ0cnVuY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