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

Add racc (fix nokogiri) #38

Merged
merged 6 commits into from
Sep 20, 2024
Merged
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,61 @@
From d16b0c927b33d9ff24889c9dbde00e9186a010d7 Mon Sep 17 00:00:00 2001
From: Brice Videau <[email protected]>
Date: Thu, 19 Sep 2024 15:48:08 -0500
Subject: [PATCH] Prevent null character from stopping string decoding.

---
src/plugins/ctf/common/src/msg-iter.cpp | 33 +++----------------------
1 file changed, 3 insertions(+), 30 deletions(-)

diff --git a/src/plugins/ctf/common/src/msg-iter.cpp b/src/plugins/ctf/common/src/msg-iter.cpp
index 36e2088b8..fc4082998 100644
--- a/src/plugins/ctf/common/src/msg-iter.cpp
+++ b/src/plugins/ctf/common/src/msg-iter.cpp
@@ -748,41 +748,14 @@ void MsgIter::_handleBlobRawDataItem(const RawDataItem& item)

void MsgIter::_handleStrRawDataItem(const RawDataItem& item)
{
- if (_mHaveNullChar) {
- /* No more text data */
- return;
- }
-
if (_mCurStrFieldEncoding == StrEncoding::Utf8) {
- /* Try to find the first U+0000 codepoint */
- const auto endIt = std::find(item.data().begin(), item.data().end(), 0);
- _mHaveNullChar = endIt != item.data().end();
-
/* Append to current string field */
this->_stackTopCurSubField().asString().append(
- reinterpret_cast<const char *>(item.data().data()), endIt - item.data().begin());
+ reinterpret_cast<const char *>(item.data().data()),
+ item.data().end() - item.data().begin());
} else {
- /* Try to find the first U+0000 codepoint */
- auto endIt = item.data().end();
- const auto afterNullCpIt = bt2c::call([this, &item] {
- if (_mCurStrFieldEncoding == StrEncoding::Utf16Be ||
- _mCurStrFieldEncoding == StrEncoding::Utf16Le) {
- return _mUtf16NullCpFinder.findNullCp(item.data());
- } else {
- BT_ASSERT_DBG(_mCurStrFieldEncoding == StrEncoding::Utf32Be ||
- _mCurStrFieldEncoding == StrEncoding::Utf32Le);
- return _mUtf32NullCpFinder.findNullCp(item.data());
- }
- });
-
- if (afterNullCpIt) {
- /* Found U+0000 */
- endIt = *afterNullCpIt;
- _mHaveNullChar = true;
- }
-
/* Append to current string buffer */
- _mStrBuf.insert(_mStrBuf.end(), item.data().begin(), endIt);
+ _mStrBuf.insert(_mStrBuf.end(), item.data().begin(), item.data().end());
}
}

--
2.39.3 (Apple Git-146)

16 changes: 0 additions & 16 deletions packages/babeltrace2/d2d2e6cc_cpp.patch

This file was deleted.

2 changes: 1 addition & 1 deletion packages/babeltrace2/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class Babeltrace2(AutotoolsPackage):

# Add varient pour esam
patch('d2d2e6cc.patch', when='@:2.0.999')
patch('d2d2e6cc_cpp.patch', when='@2.1:')
patch('0001-Prevent-null-character-from-stopping-string-decoding.patch', when='@2.1:')

patch('0db1832.patch', when='@:2.0.4')
patch('3079913.patch', when='@:2.0.999')
Expand Down
2 changes: 1 addition & 1 deletion packages/lttng-tools/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class LttngTools(AutotoolsPackage):
depends_on('libtool', type='build')
depends_on('libuuid')
depends_on('[email protected]:')
depends_on('[email protected].0:', when='@2.14:')
depends_on('[email protected].1:', when='@2.14:')
depends_on('[email protected]:', when='@2.11:')
depends_on('[email protected]:', when='@:2.10.999')
depends_on('[email protected]:')
Expand Down
1 change: 0 additions & 1 deletion packages/ruby-ffi/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@ class RubyFfi(RubyPackage):

version('1.15.4', sha256='56cfca5261ead48688241236adfefb07a000a6d17184d7a4eed48d55b9675d6b', expand=False)

depends_on('[email protected]:', type=('build'))
depends_on('[email protected]:', type=('build', 'run'))
2 changes: 1 addition & 1 deletion packages/ruby-nokogiri/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ class RubyNokogiri(RubyPackage):
version('1.12.5', sha256='2b20905942acc580697c8c496d0d1672ab617facb9d30d156b3c7676e67902ec', expand=False)

depends_on('[email protected]:', type=('build', 'run'))
depends_on('ruby-[email protected]:', type=('build'))
depends_on('ruby-[email protected]:', type=('build','run'))
depends_on('[email protected]', type=('build', 'run'))
16 changes: 16 additions & 0 deletions packages/ruby-racc/package.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)


class RubyRacc(RubyPackage):
""" Racc is an LALR(1) parser generator.
It is written in Ruby itself, and generates Ruby program."""

homepage = "https://rubygems.org/gems/racc"
url = "https://rubygems.org/downloads/racc-1.8.1.gem"

version('1.8.1', sha256='4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f', expand=False)

depends_on('[email protected]:', type=('build', 'run'))
1 change: 1 addition & 0 deletions packages/userspace-rcu/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class UserspaceRcu(AutotoolsPackage):
homepage = "https://liburcu.org/"
url = "https://github.com/urcu/userspace-rcu/archive/v0.11.1.tar.gz"

version('0.14.1', sha256='d8f883c774e1be4fecb216e0ed594fb595ecb04a15720db876ae29a41e198437')
version('0.14.0', sha256='42fb5129a3fffe5a4b790dfe1ea3a734c69ee095fefbf649326269bba94c262d')
version('0.13.3', sha256='2752d58f05859e8d1c458c6d162f03625dcd51c28e65c54fb419f4074bb07a65')
version('0.13.2', sha256='312d95376e76068b8cc70347676f1570f4f20b3014862f729dc538a316593824')
Expand Down