Commit Graph
9 Commits
Author SHA1 Message Date
pk19604014 85080fe49a added missing text_format dep (#1214) 2022-04-27 12:35:45 -04:00
pk19604014 0b4e9b5ecb Split executable semantics fuzzer into cc_binary and cc_test
This is a workaround for #1208, allowing to remove manual tag to allow building and testing fuzzer code during precommits and in bazel test ...

Tested:
bazel test -k ...
bazel build -c opt executable_semantics/fuzzing:executable_semantics_fuzzer
bazel-bin/executable_semantics/fuzzing/executable_semantics_fuzzer
2022-04-25 15:35:12 -04:00
Jon Meow 770555d8c9 Update check_deps, make reusing scripts easier (#1187)
I went down this route because I figured the installer binary should be in `check_deps`. The result:

- Add thin wrapper scripts for `buildozer` and `bazel`, similar to the `buildifier` wrapper that's already there.
  - These are mainly to avoid deduplicating logic, and dodging intricacies of Python imports that I don't understand well through instead subprocessing.
- Fix update_roots.py (it was missing a `.parent`, must've been relocated without a re-run at some point)
- Fix fuzzer proto code to be `testonly`
- Update the `check_deps` targets
2022-04-14 19:48:51 -07:00
Jon Meow 87e58f5db3 Switch executable semantics to use ErrorBuilder directly and relocate macros (#1184) 2022-04-13 09:05:21 -07:00
pk19604014andJon Meow 22462a0d7f Carbon fuzzing 3/3: added actual fuzzer implementation and a fuzzverter utility for investigating crashing protos (#1156)
* finished fuzzer and added fuzzverter util

* fixed typo

* renamed cmd line params

* fixed libproto_mutator download path

* small fixes

* small fixes

* small fixes

* renamed sample corpus proto

* small fixes

* try building on github with LIBCPP_DEBUG enabled

* temporarily marked proto fuzzer as a manual test

* code review

* use a dedicated proto-fuzzer feature to work around LIBCPP_DEBUG=1 crash in proto code

* code review comments, added README.md

* minor fixes to the text

* Update bazel/cc_toolchains/clang_cc_toolchain_config.bzl

Co-authored-by: Jon Meow <jperkins@google.com>

* use Carbon source representation for "empty Main()" instead of text format proto representation

* fixed typo

* made FuzzerUtil produce the full carbon source (proto converted + Main if needed) to decrease code duplication a bit

* typo

* switched to text proto format per code review

* Update executable_semantics/prelude.h

Co-authored-by: Jon Meow <jperkins@google.com>

* Update executable_semantics/fuzzing/README.md

Co-authored-by: Jon Meow <jperkins@google.com>

* Update executable_semantics/fuzzing/README.md

Co-authored-by: Jon Meow <jperkins@google.com>

* Update executable_semantics/fuzzing/README.md

Co-authored-by: Jon Meow <jperkins@google.com>

* Update executable_semantics/fuzzing/README.md

Co-authored-by: Jon Meow <jperkins@google.com>

* Update executable_semantics/fuzzing/README.md

Co-authored-by: Jon Meow <jperkins@google.com>

* review comments

* removed unnecessary file mode variables

* Update executable_semantics/fuzzing/fuzzverter.cpp

Co-authored-by: Jon Meow <jperkins@google.com>

* Update executable_semantics/fuzzing/README.md

Co-authored-by: Jon Meow <jperkins@google.com>

* Update executable_semantics/fuzzing/README.md

Co-authored-by: Jon Meow <jperkins@google.com>

* code review comments

* Update executable_semantics/syntax/BUILD

Co-authored-by: Jon Meow <jperkins@google.com>

* buildifier

Co-authored-by: Jon Meow <jperkins@google.com>
2022-04-11 16:47:03 -04:00
f8ded337fb Carbon fuzzing 2/3: added logic for converting carbon.proto to a Carbon source string. (#1155)
* Carbon fuzzing 2/3: added logic for converting carbon.proto to a Carbon source string.

* adjusted to proto changes in proto PR

* addressed todos

* removed unnecessary has_xx() calls

* minor fix

* sync from part 1

* Update executable_semantics/fuzzing/proto_to_carbon_test.cpp

Co-authored-by: Geoff Romer <gromer@google.com>

* review comments

* Update common/fuzzing/proto_to_carbon.cpp

Co-authored-by: Jon Meow <jperkins@google.com>

* Update common/fuzzing/proto_to_carbon.cpp

Co-authored-by: Jon Meow <jperkins@google.com>

* code review

* code review

* Update common/fuzzing/proto_to_carbon.cpp

Co-authored-by: Jon Meow <jperkins@google.com>

* code review

* merged + added support for type_params in class

* use <> includes for protobuf

* review comments

* code review comments

Co-authored-by: Geoff Romer <gromer@google.com>
Co-authored-by: Jon Meow <jperkins@google.com>
2022-03-30 14:29:35 -04:00
pk19604014 a89be4ffea Added a filegroup for prelude.carbon for easier referencing from other BUILD files and to help with internal build visibility issue (#1160)
* added a filegroup for prelude.carbon

* renamed prelude_files filegroup to standard_libraries per code review comment
2022-03-30 12:50:46 -04:00
210856dd57 Generic classes (#1124)
* start of generic classes

* fix regressions

* class functions in interfaces

* access to class function on interface from class parameter

* more stuff working for generic classes

* fixing bugs

* update TypeEqual for generic classes

* fixing bugs and finding new ones

* disable unqualified access to members from other members for now

* minor edits

* bug fixes

* introduce compile_time_value to use in type checker instead of constant_value

* cleanup

* put a CHECK back in

* failure test cases for the new FATAL_COMPILATION_ERROR

* change a runtime FATAL into a FATAL_COMPILATION_ERROR

* Update executable_semantics/ast/declaration.h

Co-authored-by: Jon Meow <jperkins@google.com>

* Update executable_semantics/interpreter/action_stack.cpp

Co-authored-by: Jon Meow <jperkins@google.com>

* Update executable_semantics/interpreter/interpreter.cpp

Co-authored-by: Jon Meow <jperkins@google.com>

* Update executable_semantics/interpreter/value.cpp

Co-authored-by: Jon Meow <jperkins@google.com>

* Update executable_semantics/interpreter/value.cpp

Co-authored-by: Jon Meow <jperkins@google.com>

* Update executable_semantics/interpreter/interpreter.cpp

Co-authored-by: Jon Meow <jperkins@google.com>

* Update executable_semantics/interpreter/value.cpp

Co-authored-by: Jon Meow <jperkins@google.com>

* Update executable_semantics/interpreter/value.cpp

Co-authored-by: Jon Meow <jperkins@google.com>

* Update executable_semantics/interpreter/resolve_names.cpp

Co-authored-by: Jon Meow <jperkins@google.com>

* Update executable_semantics/interpreter/type_checker.cpp

Co-authored-by: Jon Meow <jperkins@google.com>

* Update executable_semantics/interpreter/type_checker.cpp

Co-authored-by: Jon Meow <jperkins@google.com>

* Update executable_semantics/interpreter/type_checker.cpp

Co-authored-by: Jon Meow <jperkins@google.com>

* responses to reviews

* Update executable_semantics/interpreter/type_checker.cpp

Co-authored-by: Jon Meow <jperkins@google.com>

* rename compile_time_value to symbolic_identity

* Update executable_semantics/interpreter/type_checker.cpp

Co-authored-by: Jon Meow <jperkins@google.com>

* Update executable_semantics/interpreter/type_checker.cpp

Co-authored-by: Jon Meow <jperkins@google.com>

* Update executable_semantics/interpreter/type_checker.cpp

Co-authored-by: Jon Meow <jperkins@google.com>

* Update executable_semantics/interpreter/type_checker.cpp

Co-authored-by: Jon Meow <jperkins@google.com>

* Update executable_semantics/interpreter/type_checker.cpp

Co-authored-by: Jon Meow <jperkins@google.com>

* Update executable_semantics/interpreter/type_checker.cpp

Co-authored-by: Jon Meow <jperkins@google.com>

* Update executable_semantics/interpreter/value.cpp

Co-authored-by: Jon Meow <jperkins@google.com>

* Update executable_semantics/interpreter/value.cpp

Co-authored-by: Jon Meow <jperkins@google.com>

* Update executable_semantics/interpreter/value.cpp

Co-authored-by: Jon Meow <jperkins@google.com>

* more edits from review

* Apply suggestions from code review

Co-authored-by: Geoff Romer <gromer@google.com>

* review responses

* Update executable_semantics/interpreter/interpreter.cpp

Co-authored-by: Geoff Romer <gromer@google.com>

* const impl_scope for TypeCheckChoiceDeclaration

* add some const

Co-authored-by: Jon Meow <jperkins@google.com>
Co-authored-by: Geoff Romer <gromer@google.com>
2022-03-29 13:09:41 -04:00
pk19604014andJon Meow 5ae6d22415 Carbon fuzzing 1/3: added a proto for representing Carbon AST + ast_to_proto library (#1128)
* initial fuzzer proto

* visibility change

* use newer protocol buffer version which has the defs.bzl bug fixed

* Adjusted fix_cc_deps to work with protobuf external repo

* explicitly load rules_cc to avoid a frozenset bug in the version loaded by protobuf

* use explit deps, use llvm's zlib

* restored cxx settings

* deps change

* Cleaned up WORKSPACE and changed the test to read carbon sources from testdata

* updated comment

* adapted to new ErrorOr return value

* proto buffer 3.19.2 -> 3.19.4

* changed comment

* Apply suggestions from code review

Co-authored-by: Jon Meow <jperkins@google.com>

* Apply suggestions from code review

Co-authored-by: Jon Meow <jperkins@google.com>

* Update executable_semantics/fuzzing/BUILD

Co-authored-by: Jon Meow <jperkins@google.com>

* addressed review comments

* updated Unimplemented error message

* Addressed review comments

* more review comments

* switched to loading protobuf via rules_proto()

* Ignore protobuf headers in fix_cc_deps.py until the script supports alias rules

* renamed repeated proto fields to be plural

* added @zlib to check_non_test_cc_deps

* Update common/fuzzing/BUILD

Co-authored-by: Jon Meow <jperkins@google.com>

* review comments

* set is_omitted_expression for return value

Co-authored-by: Jon Meow <jperkins@google.com>
2022-03-25 15:29:31 -04:00