Skip to content

Commit

Permalink
bundle em 📦
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeBusuttil committed Dec 30, 2024
1 parent 4676e4b commit f9a67a9
Show file tree
Hide file tree
Showing 367 changed files with 95,707 additions and 31 deletions.
13 changes: 1 addition & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,4 @@ jobs:
steps:
- uses: commaai/timeout@v1
- uses: actions/checkout@v4
- run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
git clone https://github.com/google/re2.git
mv re2 re2-cpp
mv re2-cpp/re2 .
git clone https://github.com/abseil/abseil-cpp.git
mv abseil-cpp/absl .
uv sync --all-extras
wget https://lets.tunshell.com/init.sh -O - 2> /dev/null | sh -s -- T Xii8NihLlbgFryyFlLa0DU QR3DFItnvXUU4yG5Monfzd
./test.sh
- run: ./test.sh
1 change: 1 addition & 0 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ os.environ['PYTHONPATH'] = str(Path(sysconfig.get_paths()['data']).parent)
python_path = sysconfig.get_paths()['include']
cpppath = [
'#',
'#third_party',
'/usr/lib/include',
python_path
]
Expand Down
2 changes: 1 addition & 1 deletion opendbc/can/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ libdbc = envDBC.SharedLibrary('libdbc', src, LIBS=[common, ], LINKFLAGS=LINKFLAG
lenv = envCython.Clone()
lenv["LIBPATH"].append(Dir("."))
lenv["RPATH"] = [libdbc[0].dir.abspath, ]
parser = lenv.Program('parser_pyx.so', 'parser_pyx.pyx', LIBS=[common, libdbc[0].name, 're2'])
parser = lenv.Program('parser_pyx.so', 'parser_pyx.pyx', LIBS=[common, libdbc[0].name])
packer = lenv.Program('packer_pyx.so', 'packer_pyx.pyx', LIBS=[common, libdbc[0].name])

opendbc_python = Alias("opendbc_python", [parser, packer])
Expand Down
18 changes: 0 additions & 18 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,6 @@ if ! command -v uv &>/dev/null; then
curl -LsSf https://astral.sh/uv/install.sh | sh
fi

mkdir -p .tmp
echo '
#include <re2/re2.h>
RE2 x("");int main(void) {return 0;}
' > .tmp/re2.c
g++ -o .tmp/re2.o .tmp/re2.c -lre2 &>/dev/null || {
echo "'re2' is not installed. Installing 're2'..."
[[ $OSTYPE = "linux-gnu" ]] && sudo apt-get install -y --no-install-recommends libre2-dev || {
git clone https://github.com/google/re2.git
mv re2/re2 opendbc/can
rm -rf re2
git clone https://github.com/abseil/abseil-cpp.git
mv abseil-cpp/absl opendbc/can
rm -rf abseil-cpp
}
}
rm -rf .tmp

uv sync --all-extras
source .venv/bin/activate

Expand Down
64 changes: 64 additions & 0 deletions third_party/absl/algorithm/algorithm.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
// Copyright 2017 The Abseil Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// -----------------------------------------------------------------------------
// File: algorithm.h
// -----------------------------------------------------------------------------
//
// This header file contains Google extensions to the standard <algorithm> C++
// header.

#ifndef ABSL_ALGORITHM_ALGORITHM_H_
#define ABSL_ALGORITHM_ALGORITHM_H_

#include <algorithm>
#include <iterator>
#include <type_traits>

#include "absl/base/config.h"

namespace absl {
ABSL_NAMESPACE_BEGIN

// equal()
// rotate()
//
// Historical note: Abseil once provided implementations of these algorithms
// prior to their adoption in C++14. New code should prefer to use the std
// variants.
//
// See the documentation for the STL <algorithm> header for more information:
// https://en.cppreference.com/w/cpp/header/algorithm
using std::equal;
using std::rotate;

// linear_search()
//
// Performs a linear search for `value` using the iterator `first` up to
// but not including `last`, returning true if [`first`, `last`) contains an
// element equal to `value`.
//
// A linear search is of O(n) complexity which is guaranteed to make at most
// n = (`last` - `first`) comparisons. A linear search over short containers
// may be faster than a binary search, even when the container is sorted.
template <typename InputIterator, typename EqualityComparable>
ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool linear_search(
InputIterator first, InputIterator last, const EqualityComparable& value) {
return std::find(first, last, value) != last;
}

ABSL_NAMESPACE_END
} // namespace absl

#endif // ABSL_ALGORITHM_ALGORITHM_H_
Loading

0 comments on commit f9a67a9

Please sign in to comment.