Skip to content

Commit

Permalink
ninja: Fix slow cursor update regression
Browse files Browse the repository at this point in the history
Reported in ninja-build/ninja#2435

PR waiting for approval: ninja-build/ninja#2437.
  • Loading branch information
orgads committed May 4, 2024
1 parent 100a1d4 commit 02aadd8
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
From 3d1a5fa9ab4a38fd5c2004820907158e1e774858 Mon Sep 17 00:00:00 2001
From: Orgad Shaneh <orgad.shaneh@audiocodes.com>
Date: Sat, 4 May 2024 22:49:06 +0300
Subject: [PATCH] RealDiskInterface: Do *not* set locale to an empty string

It causes the cursor handling to be extremely slow on MinGW.

Added in #2321.

Fixes #2435.
---
src/disk_interface.cc | 2 --
1 file changed, 2 deletions(-)

diff --git a/src/disk_interface.cc b/src/disk_interface.cc
index 5aba2179ef..1259c612f4 100644
--- a/src/disk_interface.cc
+++ b/src/disk_interface.cc
@@ -161,8 +161,6 @@ bool DiskInterface::MakeDirs(const string& path) {
RealDiskInterface::RealDiskInterface()
#ifdef _WIN32
: use_cache_(false), long_paths_enabled_(false) {
- setlocale(LC_ALL, "");
-
// Probe ntdll.dll for RtlAreLongPathsEnabled, and call it if it exists.
HINSTANCE ntdll_lib = ::GetModuleHandleW(L"ntdll");
if (ntdll_lib) {
11 changes: 7 additions & 4 deletions mingw-w64-ninja/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ _realname=ninja
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=1.12.0
pkgrel=1
pkgrel=2
pkgdesc="Ninja is a small build system with a focus on speed (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64')
Expand All @@ -13,12 +13,15 @@ license=('spdx:Apache-2.0')
depends=()
options=('strip' 'staticlibs')
makedepends=("re2c" "${MINGW_PACKAGE_PREFIX}-python" "${MINGW_PACKAGE_PREFIX}-cc")
source=("${_realname}-${pkgver}.tar.gz"::"https://github.com/ninja-build/ninja/archive/v${pkgver}.tar.gz")
sha256sums=('8b2c86cd483dc7fcb7975c5ec7329135d210099a89bc7db0590a07b0bbfe49a5')
source=("${_realname}-${pkgver}.tar.gz"::"https://github.com/ninja-build/ninja/archive/v${pkgver}.tar.gz"
"0001-RealDiskInterface-Do-not-set-locale-to-an-empty-stri.patch")
sha256sums=('8b2c86cd483dc7fcb7975c5ec7329135d210099a89bc7db0590a07b0bbfe49a5'
'e0b99734711ea439d34ef40a3db06939609b2cfa55e345a83b932048f61c5329')

prepare() {
cd "${srcdir}"/ninja-${pkgver}

# https://github.com/ninja-build/ninja/pull/2437
patch -p1 -i "${srcdir}"/0001-RealDiskInterface-Do-not-set-locale-to-an-empty-stri.patch
}

build() {
Expand Down

0 comments on commit 02aadd8

Please sign in to comment.