Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ninja: Fix slow cursor update regression #20807

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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