Skip to content

Commit c78ef20

Browse files
committed
Make sure size_test CI uses -Wall -Werror
1 parent 88886b8 commit c78ef20

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

CONTRIBUTING.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,11 @@ must work with threading**
215215

216216
## Testing
217217

218+
### Running Tests
219+
220+
The `sh test/build_size_test.sh` script will compile the runtime along with portable kernels.
221+
The `test/run_oss_cpp_tests.sh` script will build and run C++ tests locally.
222+
218223
### Writing Tests
219224
To help keep code quality high, ExecuTorch uses a combination of unit tests and
220225
end-to-end (e2e) tests. If you add a new feature or fix a bug, please add tests
@@ -229,8 +234,6 @@ If it's not clear how to add a test for your PR, take a look at the blame for
229234
the code you're modifying and find an author who has more context. Ask them
230235
for their help in the PR comments.
231236

232-
The `test/run_oss_cpp_tests.sh` script will build and run C++ tests locally.
233-
234237
### Continuous Integration
235238
See https://hud.pytorch.org/hud/pytorch/executorch/main for the current state of
236239
the CI (continuous integration) jobs. If `main` is broken, consider rebasing

runtime/kernel/operator_registry.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ void make_kernel_key_string(Span<const TensorMeta> key, char* buf) {
135135
// If no tensor is present in an op, kernel key does not apply
136136
return;
137137
}
138-
strncpy(buf, "v1/", 3);
138+
strcpy(buf, "v1/");
139139
buf += 3;
140140
for (size_t i = 0; i < key.size(); i++) {
141141
auto& meta = key[i];

test/build_size_test.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,14 @@ set -e
1111
# shellcheck source=/dev/null
1212
source "$(dirname "${BASH_SOURCE[0]}")/../.ci/scripts/utils.sh"
1313

14+
# Remove -Wno-sign-compare (https://github.com/pytorch/executorch/issues/8149)
15+
COMMON_CXXFLAGS="-fno-exceptions -fno-rtti -Wall -Werror -Wno-sign-compare -Wno-unknown-pragmas"
16+
1417
cmake_install_executorch_lib() {
1518
echo "Installing libexecutorch.a"
1619
clean_executorch_install_folders
17-
18-
CXXFLAGS="-fno-exceptions -fno-rtti" retry cmake -DBUCK2="$BUCK2" \
20+
21+
CXXFLAGS="$COMMON_CXXFLAGS" retry cmake -DBUCK2="$BUCK2" \
1922
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
2023
-DCMAKE_INSTALL_PREFIX=cmake-out \
2124
-DCMAKE_BUILD_TYPE=Release \
@@ -27,7 +30,7 @@ cmake_install_executorch_lib() {
2730
}
2831

2932
test_cmake_size_test() {
30-
CXXFLAGS="-fno-exceptions -fno-rtti" retry cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=cmake-out -Bcmake-out/test test
33+
CXXFLAGS="$COMMON_CXXFLAGS" retry cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=cmake-out -Bcmake-out/test test
3134

3235
echo "Build size test"
3336
cmake --build cmake-out/test -j9 --config Release

0 commit comments

Comments
 (0)