-
-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
simdutf 6.1.0 #205349
simdutf 6.1.0 #205349
Conversation
|
This patch may fix the issue: diff --git a/singleheader/amalgamate.py b/singleheader/amalgamate.py
index 5b18ea16..d600647e 100755
--- a/singleheader/amalgamate.py
+++ b/singleheader/amalgamate.py
@@ -7,6 +7,7 @@
import os.path
import subprocess
import os
+import pathlib
import re
import shutil
import datetime
@@ -229,15 +230,24 @@ def get_timestamp():
# Forcing it to be UTC is difficult, because it needs to be portable
# between gnu date and busybox date.
try:
- ret = subprocess.run(['git', 'show', '-s', '--format=%ci', 'HEAD'],
- stdout=subprocess.PIPE)
+ # avoid git going outside simdutf, which could happen when
+ # unpacking a release tarball inside a subdirectory of an unrelated
+ # git repository. that would lead to picking up the timestamp of the
+ # unrelated git repository.
+ parent = pathlib.Path(SCRIPTPATH).absolute().parent
+ GIT_CEILING_DIRECTORIES = str(parent)
+ ret = subprocess.run(['git', '-C', SCRIPTPATH, 'show', '-s', '--format=%ci', 'HEAD'],
+ stdout=subprocess.PIPE,
+ env=dict(os.environ, GIT_CEILING_DIRECTORIES=GIT_CEILING_DIRECTORIES))
if ret.returncode != 0:
- raise ValueError(f"non-zero exit code {ret.returncode}")
+ print(f"git called resulted in non-zero exit code {ret.returncode}")
+ print("timestamp based on current time")
+ return str(datetime.datetime.now())
return ret.stdout.decode('utf-8').strip()
except (UnicodeDecodeError, FileNotFoundError):
- print("git not found, timestamp based on current time")
+ print("UnicodeDecodeError or FileNotFoundError, timestamp based on current time")
return str(datetime.datetime.now()) |
@botantony yeah, that is what I was thinking yesterday :) can you filed an upstream PR on it? thanks! 🙏 |
Unfortunately I cannot do upstream PR due to lack of permissions (I am a contributor, not organization member). class Simdutf < Formula
desc "Unicode conversion routines, fast"
homepage "https://github.com/simdutf/simdutf"
url "https://github.com/simdutf/simdutf/archive/refs/tags/v6.1.0.tar.gz"
sha256 "ef2903a7f085090c58f3acfa93a62733ae92a3f9b1d50800edec77a6816d7d67"
license any_of: ["Apache-2.0", "MIT"]
head "https://github.com/simdutf/simdutf.git", branch: "master"
livecheck do
url :stable
regex(/^v?(\d+(?:\.\d+)+)$/i)
end
bottle do
sha256 cellar: :any, arm64_sequoia: "e4e6f6c35a03b5298d8fc5e903f4f052f6a836d714182f8cdf8a6a249fd95a3c"
sha256 cellar: :any, arm64_sonoma: "78d81462239a71c50179a65e9ae63bda64ab170e1a0f54e97db4f765ab2e4265"
sha256 cellar: :any, arm64_ventura: "0847766dd42149d771e60db322a329e54bb8b65c8feb1031b0a6cd35bca79b3a"
sha256 cellar: :any, sonoma: "1f6835d989644af3e6db2ac1c785b37c2e14bb8ad539d78e773baac200c8bc3f"
sha256 cellar: :any, ventura: "680f6afecf5b1b5e35330e5351e6eb34d87486e961f52f66b8fa5cf8cab9e056"
end
depends_on "cmake" => :build
depends_on "icu4c@76"
depends_on macos: :catalina
uses_from_macos "python" => :build
patch :DATA
# VERSION=#{version} && curl -s https://raw.githubusercontent.com/simdutf/simdutf/v$VERSION/benchmarks/base64/CMakeLists.txt | grep -C 1 'VERSION'
resource "base64" do
url "https://github.com/aklomp/base64/archive/refs/tags/v0.5.2.tar.gz"
sha256 "723a0f9f4cf44cf79e97bcc315ec8f85e52eb104c8882942c3f2fba95acc080d"
end
def install
(buildpath/"base64").install resource("base64")
args = %W[
-DBUILD_SHARED_LIBS=ON
-DCMAKE_INSTALL_RPATH=#{rpath}
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON
-DFETCHCONTENT_SOURCE_DIR_BASE64=#{buildpath}/base64
-DPython3_EXECUTABLE=#{which("python3")}
-DSIMDUTF_BENCHMARKS=ON
]
system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args
system "cmake", "--build", "build"
system "cmake", "--install", "build"
bin.install "build/benchmarks/benchmark" => "sutf-benchmark"
end
test do
system bin/"sutf-benchmark", "--random-utf8", "1024", "-I", "20"
end
end
__END__
diff --git a/singleheader/amalgamate.py b/singleheader/amalgamate.py
index 5b18ea16..d600647e 100755
--- a/singleheader/amalgamate.py
+++ b/singleheader/amalgamate.py
@@ -7,6 +7,7 @@
import os.path
import subprocess
import os
+import pathlib
import re
import shutil
import datetime
@@ -229,15 +230,24 @@ def get_timestamp():
# Forcing it to be UTC is difficult, because it needs to be portable
# between gnu date and busybox date.
try:
- ret = subprocess.run(['git', 'show', '-s', '--format=%ci', 'HEAD'],
- stdout=subprocess.PIPE)
+ # avoid git going outside simdutf, which could happen when
+ # unpacking a release tarball inside a subdirectory of an unrelated
+ # git repository. that would lead to picking up the timestamp of the
+ # unrelated git repository.
+ parent = pathlib.Path(SCRIPTPATH).absolute().parent
+ GIT_CEILING_DIRECTORIES = str(parent)
+ ret = subprocess.run(['git', '-C', SCRIPTPATH, 'show', '-s', '--format=%ci', 'HEAD'],
+ stdout=subprocess.PIPE,
+ env=dict(os.environ, GIT_CEILING_DIRECTORIES=GIT_CEILING_DIRECTORIES))
if ret.returncode != 0:
- raise ValueError(f"non-zero exit code {ret.returncode}")
+ print(f"git called resulted in non-zero exit code {ret.returncode}")
+ print("timestamp based on current time")
+ return str(datetime.datetime.now())
return ret.stdout.decode('utf-8').strip()
except (UnicodeDecodeError, FileNotFoundError):
- print("git not found, timestamp based on current time")
+ print("UnicodeDecodeError or FileNotFoundError, timestamp based on current time")
return str(datetime.datetime.now()) |
forgot to ping @chenrui333 |
oh, there is already a PR on this, simdutf/simdutf#657 |
simdutf: add git patch Signed-off-by: Rui Chen <[email protected]>
6eb7325
to
76470a3
Compare
🤖 An automated task has requested bottles to be published to this PR. |
Created by
brew bump
Created with
brew bump-formula-pr
.resource
blocks have been checked for updates.release notes