From f8ed61b11ca78c16828deb64a57b8346fb3eb6ce Mon Sep 17 00:00:00 2001 From: Andres_Github <81278332+Slushi-Github@users.noreply.github.com> Date: Tue, 10 Nov 2026 12:24:31 -0400 Subject: [PATCH 1/5] Add another way to show the compilation progress Now you can define `HXCPP_PROGRESS_PERCENT` for see the compilation progress as a percentage --- tools/hxcpp/BuildTool.hx | 2 +- tools/hxcpp/Progress.hx | 32 ++++++++++++++++++++------------ 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/tools/hxcpp/BuildTool.hx b/tools/hxcpp/BuildTool.hx index 3bda4d3d..7fa8dc4d 100644 --- a/tools/hxcpp/BuildTool.hx +++ b/tools/hxcpp/BuildTool.hx @@ -688,7 +688,7 @@ class BuildTool } : null; Profile.push("compile"); - var progress = new Progress(to_be_compiled.length); + var progress = new Progress(to_be_compiled.length, mDefines.exists("HXCPP_PROGRESS_PERCENT")); if (threadPool==null) { for(file in to_be_compiled) diff --git a/tools/hxcpp/Progress.hx b/tools/hxcpp/Progress.hx index 0bbc560d..6a75642a 100644 --- a/tools/hxcpp/Progress.hx +++ b/tools/hxcpp/Progress.hx @@ -1,25 +1,33 @@ // How many of a group's files have compiled, shown before each file as it starts -class Progress -{ +class Progress { var finished:Int; var total:Int; + var usePercent:Bool; - public function new(inTotal:Int) - { + public function new(inTotal:Int, usePercent:Bool = false) { finished = 0; total = inTotal; + this.usePercent = usePercent; } - public function label():String - { - var done = Std.string(finished); - while (done.length < Std.string(total).length) - done = " " + done; - return "\x1b[1m[" + done + "/" + total + "]\x1b[0m"; + public function label():String { + if (usePercent) { + var percent = finished / total; + var pct = Std.int(percent * 1000) / 10; + var str = Std.string(pct); + if (Std.int(pct) == pct) { + str += ".0"; + } + return "\x1b[1m[" + str + "%]\x1b[0m"; + } else { + var done = Std.string(finished); + while (done.length < Std.string(total).length) + done = " " + done; + return "\x1b[1m[" + done + "/" + total + "]\x1b[0m"; + } } - public function fileDone() - { + public function fileDone() { Log.lock(); finished++; Log.unlock(); From ab35bfa5a8e1092fc2671fe2461ba3a8acf20003 Mon Sep 17 00:00:00 2001 From: Chris Speciale Date: Wed, 11 Nov 2026 19:36:23 -0500 Subject: [PATCH 2/5] Pad the progress percentage and document HXCPP_PROGRESS_PERCENT The percentage is padded to the width of 100.0, as the count is padded to the width of the total, so the file names after it stay in one column. Progress.hx keeps the brace style of the rest of the build tool, and the define has a line in Defines.md and in Changes.md. --- Changes.md | 1 + docs/build_xml/Defines.md | 1 + tools/hxcpp/Progress.hx | 42 +++++++++++++++++++++------------------ 3 files changed, 25 insertions(+), 19 deletions(-) diff --git a/Changes.md b/Changes.md index 844cf9c9..7d247321 100644 --- a/Changes.md +++ b/Changes.md @@ -2,6 +2,7 @@ libhxcpp 6.0.0 (unreleased) ------------------------------------------------------------ +* Added HXCPP_PROGRESS_PERCENT, which shows a group's compile progress as a percentage of its files, [ 42.5%], instead of a count, [425/1000] * Fixed the 32-bit x86 collector missing live objects held only in EBP when frame pointers are omitted. It now captures EBP with the other callee-saved registers; the lost strings in the Linux 32 CFFI tests were one consequence (libhxcpp #430) * Fixed GCC TSan builds reporting allocator races because a Clang sanitizer annotation also disabled instrumentation of the block-claim atomics on newer GCC. GCC keeps those atomics instrumented, without adding suppressions, and the Linux 32 and TSan jobs run on ubuntu-latest again (libhxcpp #430) * Fixed the fuzz job failing to find libFuzzer on Ubuntu 26.04 with Clang 21, whose reported runtime directory differs from the compiler-rt package's lib/linux directory. Setup and the fuzz build now check both locations for the native archive diff --git a/docs/build_xml/Defines.md b/docs/build_xml/Defines.md index 263fecfe..fdd3df97 100755 --- a/docs/build_xml/Defines.md +++ b/docs/build_xml/Defines.md @@ -80,6 +80,7 @@ Other defines: | *HXCPP_QUIET* | Print less output from the build tool | | *HXCPP_SILENT* | Print only errors from the build tool | | *HXCPP_COMPILE_THREADS* | Number of files to compile at once (also read from the environment) | +| *HXCPP_PROGRESS_PERCENT* | Show a group's progress as a percentage of its files, instead of a count | | *HXCPP_COMPILE_CACHE* | Directory for the compile cache, usually set in the environment. See [CompileCache.md](../CompileCache.md) | | *HXCPP_TIMES* | Show some basic profiling information | | *HXCPP_NEKO_BUILDTOOL* | Force use of hxcpp.n, rather than compiled BuildTool.exe diff --git a/tools/hxcpp/Progress.hx b/tools/hxcpp/Progress.hx index 6a75642a..80e49ecd 100644 --- a/tools/hxcpp/Progress.hx +++ b/tools/hxcpp/Progress.hx @@ -1,33 +1,37 @@ -// How many of a group's files have compiled, shown before each file as it starts -class Progress { +// How many of a group's files have compiled, shown before each file as it +// starts: a count, or with HXCPP_PROGRESS_PERCENT a percentage +class Progress +{ var finished:Int; var total:Int; - var usePercent:Bool; + var percent:Bool; - public function new(inTotal:Int, usePercent:Bool = false) { + public function new(inTotal:Int, inPercent = false) + { finished = 0; total = inTotal; - this.usePercent = usePercent; + percent = inPercent; } - public function label():String { - if (usePercent) { - var percent = finished / total; - var pct = Std.int(percent * 1000) / 10; - var str = Std.string(pct); - if (Std.int(pct) == pct) { - str += ".0"; - } - return "\x1b[1m[" + str + "%]\x1b[0m"; - } else { - var done = Std.string(finished); - while (done.length < Std.string(total).length) + public function label():String + { + if (percent) + { + // In tenths, padded to the width of 100.0 so the file names line up + var tenths = total > 0 ? Std.int(finished * 1000 / total) : 1000; + var done = Std.int(tenths / 10) + "." + (tenths % 10); + while (done.length < 5) done = " " + done; - return "\x1b[1m[" + done + "/" + total + "]\x1b[0m"; + return "\x1b[1m[" + done + "%]\x1b[0m"; } + var done = Std.string(finished); + while (done.length < Std.string(total).length) + done = " " + done; + return "\x1b[1m[" + done + "/" + total + "]\x1b[0m"; } - public function fileDone() { + public function fileDone() + { Log.lock(); finished++; Log.unlock(); From e45332d05c248902217fea421af2a4fdd98b0e6e Mon Sep 17 00:00:00 2001 From: Andres_Github <81278332+Slushi-Github@users.noreply.github.com> Date: Wed, 11 Nov 2026 22:25:12 -0400 Subject: [PATCH 3/5] Update progress label formatting and padding to the left of the label Now, when the progress bar is in percentage format, it appears as [42.5% ] instead of [ 42.5%]. --- tools/hxcpp/Progress.hx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/hxcpp/Progress.hx b/tools/hxcpp/Progress.hx index 80e49ecd..b21b75e2 100644 --- a/tools/hxcpp/Progress.hx +++ b/tools/hxcpp/Progress.hx @@ -17,12 +17,12 @@ class Progress { if (percent) { - // In tenths, padded to the width of 100.0 so the file names line up + // Pad to the width of 100.0% so the file names line up var tenths = total > 0 ? Std.int(finished * 1000 / total) : 1000; - var done = Std.int(tenths / 10) + "." + (tenths % 10); - while (done.length < 5) - done = " " + done; - return "\x1b[1m[" + done + "%]\x1b[0m"; + var done = Std.int(tenths / 10) + "." + (tenths % 10) + "%"; + while (done.length < 6) + done = done + " "; + return "\x1b[1m[" + done + "]\x1b[0m"; } var done = Std.string(finished); while (done.length < Std.string(total).length) From 196a581a4fa2d3c27d32181f81e9f603a7271b99 Mon Sep 17 00:00:00 2001 From: Andres_Github <81278332+Slushi-Github@users.noreply.github.com> Date: Wed, 11 Nov 2026 22:26:22 -0400 Subject: [PATCH 4/5] Update documentation --- Changes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Changes.md b/Changes.md index 7d247321..0a05373d 100644 --- a/Changes.md +++ b/Changes.md @@ -2,7 +2,7 @@ libhxcpp 6.0.0 (unreleased) ------------------------------------------------------------ -* Added HXCPP_PROGRESS_PERCENT, which shows a group's compile progress as a percentage of its files, [ 42.5%], instead of a count, [425/1000] +* Added HXCPP_PROGRESS_PERCENT, which shows a group's compile progress as a percentage of its files, [42.5% ], instead of a count, [425/1000] * Fixed the 32-bit x86 collector missing live objects held only in EBP when frame pointers are omitted. It now captures EBP with the other callee-saved registers; the lost strings in the Linux 32 CFFI tests were one consequence (libhxcpp #430) * Fixed GCC TSan builds reporting allocator races because a Clang sanitizer annotation also disabled instrumentation of the block-claim atomics on newer GCC. GCC keeps those atomics instrumented, without adding suppressions, and the Linux 32 and TSan jobs run on ubuntu-latest again (libhxcpp #430) * Fixed the fuzz job failing to find libFuzzer on Ubuntu 26.04 with Clang 21, whose reported runtime directory differs from the compiler-rt package's lib/linux directory. Setup and the fuzz build now check both locations for the native archive From 89b4cf762d231cd5cf9a76549a422e9323510094 Mon Sep 17 00:00:00 2001 From: Chris Speciale Date: Thu, 12 Nov 2026 03:11:49 -0500 Subject: [PATCH 5/5] Indent the percentage label with spaces like the rest of Progress.hx --- tools/hxcpp/Progress.hx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/hxcpp/Progress.hx b/tools/hxcpp/Progress.hx index b21b75e2..335c2a87 100644 --- a/tools/hxcpp/Progress.hx +++ b/tools/hxcpp/Progress.hx @@ -20,9 +20,9 @@ class Progress // Pad to the width of 100.0% so the file names line up var tenths = total > 0 ? Std.int(finished * 1000 / total) : 1000; var done = Std.int(tenths / 10) + "." + (tenths % 10) + "%"; - while (done.length < 6) - done = done + " "; - return "\x1b[1m[" + done + "]\x1b[0m"; + while (done.length < 6) + done = done + " "; + return "\x1b[1m[" + done + "]\x1b[0m"; } var done = Std.string(finished); while (done.length < Std.string(total).length)