Commit Graph

34 Commits

Author SHA1 Message Date
Navidem 69ba24b86d
Enable Introspector for jvm (#9440) 2023-01-19 13:13:09 -08:00
DavidKorczynski beef253ac7
infra: build: functions: cut corpus directory by last period (#9302)
When a corpus zip file is unzipped the destination folder is set to be
the directory corresponding to the filepath of the zip file but without
".zip" in the name. This is achieved by `for f in /corpus/*.zip; do
unzip -q $f -d ${f%%.*}` where `f%%.*` substitutes the path of `f` based
on the first occurrence of ".". This causes some issues with fuzztest
fuzzers where a fuzzer name always has a "." in it, e.g.

`escaping_test@EscapingTest.EscapingAStringNeverTriggersUndefinedBehavior`

Substituting the name in this way causes issues for some coverage builds
e.g.
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=53479

This changes it to substiute based on the last occurrence of ".", i.e.
just cutting off the ".zip".

Alternatively, we could substitute over
e.g. ".zip", however, this may cause some issues as a fuzztest fuzzer
may have ".zip" in the name.

Signed-off-by: David Korczynski <david@adalogics.com>

Signed-off-by: David Korczynski <david@adalogics.com>
2023-01-04 09:52:09 +11:00
Navidem 426b8f5f19
Fix Introspector trial build (#8971)
Skip using `-testing` bucket as it breaks coverage download under
`trial_build`.
2022-11-10 13:54:57 -08:00
Navidem fb2592f6f8
Fix Python Coverage Build (#8959)
Skip per_target coverage copy for python.

Co-authored-by: Dongge Liu <donggeliu@google.com>
2022-11-09 17:48:50 -08:00
Navidem 490a91a265
Enable Introspector on Python projects (#8945) 2022-11-07 22:48:16 +00:00
Navidem 165ee30241
Set introspector env variable in compile (#8878) 2022-10-28 12:06:15 -07:00
jonathanmetzman 998791514d
Get rid of :introspector images. Build introspector in main images (#8868)
Actually install introspector in every image.
Don't do extra introspector build steps.
Fixes https://github.com/google/oss-fuzz/issues/8625
2022-10-27 08:27:12 -04:00
Navidem f5e748bb84
Test OSS-Fuzz with introspector images [DO NOT MERGE] (#8628) 2022-10-25 16:31:04 -07:00
jonathanmetzman 1ab5e408e5
[trial builds] Support forks (#8519)
Fix https://github.com/google/oss-fuzz/issues/8273
2022-09-18 08:04:33 -04:00
jonathanmetzman 9f150d831f
Fix trial build for coverage (#8268)
* Fix trial build for coverage

* Fix
2022-08-16 08:59:28 -04:00
jonathanmetzman ddd25e3c3f
[AArch64] Support building on GCB (#8197)
Implemented using buildx to emulate aarch64 using QEMU
Related: #8164
2022-08-11 16:34:13 -04:00
jonathanmetzman 54e2b96603
Remove build-infra support for DFSan. (#7971)
Related: #7964
2022-07-11 11:43:50 +02:00
Navidem 8988e2b8d8
Set PROJECT_NAME env and update download_corpora_step() (#7873) 2022-06-16 02:19:08 +00:00
jonathanmetzman 4734e40832
[trial_build] Fix bugs (#7764)
* Fix bugs

1. Don't try to build the script name as a project.
2. Add a flag to force builds of projects that previously failed.
3. Make sure we build projects from our PR branch.
4. Wait on all builds not just builds of the last type.
5. Don't use test bucket for corpus or coverage (will corpus work or fail because of creds?)

Add tests for these features.
2022-06-08 21:59:06 -04:00
jonathanmetzman 4f932b199b
[infra] Enable coverage builds for python projects (#7561)
* Python now has coverage support

* fmt
2022-04-13 09:35:19 +10:00
jonathanmetzman 2e60f2dde9
[infra] Add test script for infra changes (#7388)
This adds ci.py a script that can be used to test changes to the base-images.
The script does the following:
1. Builds and pushes a test image for each base image. This will be used in step 3.
2. Finds which projects are buildable based on user specifications of: projects, build type (e.g. sanitizer/fuzzing engine) and which of these succeeded in production.
3. Submits builds for those projects.
4. Polls GCB to check which builds succeeded and which failed.
5. Returns 0 if all builds succeeded.

Currently this script is only useful to run locally.
Related: https://github.com/google/oss-fuzz/issues/7145
2022-03-21 15:17:07 -04:00
Oliver Chang 018c86e7c8
Reland "Upload per target coverage report. (#7389)" (#7400)" (#7407)
Only upload per-target reports for C/C++.

This reverts commit 1ae57df24d.
2022-03-21 03:57:55 +00:00
jonathanmetzman 1ae57df24d
Revert "Upload per target coverage report. (#7389)" (#7400)
This reverts commit a56b6259eb.
2022-03-18 18:45:32 -04:00
Oliver Chang a56b6259eb
Upload per target coverage report. (#7389)
For #7015.
2022-03-17 10:03:34 +11:00
jonathanmetzman d5d7600072
[build] Don't assume textcov reports exist for non-C/C++ projects (#7229) 2022-02-02 18:14:20 +00:00
Navidem 7a5a747ef6
Handle error in downloading coverage data (#7215)
* Returning empty list of steps in case of error when downloading coverage data

* Better error handling

* Using logging.warning and more informative message
2022-02-01 11:01:03 +11:00
Oliver Chang fb6e9fdfef
Fuzz introspector build fixes. (#7211)
- Point `compile` to the right `fuzz-introspector` location (since it's no longer checked out in $SRC).
- Rename build tag to "introspector" to be more consistent with other
  tags.
- Fix bad merge in deploy.sh script.
- Add introspector setup to project sync.
- Enable more logging for project sync cron.
2022-02-01 07:56:59 +11:00
Navidem 42880c1e2b
FuzzIntrospector build steps (#7162)
Adds build steps for fuzz introspector to the coverage build.
2022-01-31 11:56:22 +11:00
Catena cyber dd8e46c38b
Swift ideal integration (#6312)
* Helper flags for swift compilation

* Documentation for swift project integration

* Adds swift to the languages with coverage

* Only thread sanitizer is supported

* Fixes swift coverage target compilation

* fixup flags facotring

* swift: run on new ubuntu

* fixup

* swift: right copy for symbolizer
2021-09-02 14:56:01 -07:00
jonathanmetzman 5ef1f7b588
[language builders] Get rid of base-builder-new (#6361)
Build all C/C++ projects in an image without rust, java,
atheris (python), or go.
2021-09-01 13:36:17 -07:00
jonathanmetzman 370fb73473
[build][infra] Improve build functions. (#6296)
Important functional changes involve mostly improvements to
the command line scripts (this doesn't affect the build infra, only
local use):

1. Make sure scripts use the same builder as builds requested by infra, otherwise builds
will be very slow and will fail for larger projects.
2. Allow users to specify --test-images to use base images with suffix "-testing"
3. Allow script users to specify --parallel for parallel builds.
4. Allow script users to specify --testing so that builds are uploaded to testing buckets.
5. Allow script users to specify --branch so that builds use specified branch instead of master.
6. Clone oss-fuzz with depth 1 for improved speed and space usage.
7. Use logging instead of writing to stderr or print.
8. Allow scripts to accept multiple projects.
9. Allow script to keep executing after failure to get build steps.
10. Change scripts to use python3.
11. Tag more so builds are easier to query.
12. Log the gcb page for each build.

Other changes include major refactoring:

1. Don't construct image names from scratch using format strings each time they are used.
Provide a helper function for this.
2. Provide a helper function,  get_env instead of constructing the env from scratch each time.
3. Move compile step into its own function: get_compile_step.
4. Move upload steps into their own helper function get_upload_steps.
5. Don't misuse the name image_project when we really mean cloud project.
6. Move cleanup step into its own helper function: get_cleanup_step.
7. Exit with returncode of main function from build_project.
8. Add unittests for build_project.
9. Make request_build share run_build code with build_project.
10. Use proper spacing in comments.
11. Test builds other than libfuzzer-ASAN-x86_64. Test other sanitizers, fuzzers and architectures
12. Make build_and_run_coverage share more code with build_project.
13. Move tests for build_and_run_coverage_test.py out of requst_coverage_test.py into their own file.
14. Use single quotes for strings.
15. Store state for a build in Build object instead of passing it everywhere.
16. Don't abuse project_yaml dict for storing project state. Use a Project object instead.
17. Better variable naming.
18. Use more classes instead of passing around arguments.
19. Use more f-strings.
20. Make scripts share main function.
21. Begin comments with uppercase and end with period.
22. Don't import functions or classes as dictated by style guide.
23. Share more test code in test_utils

Related: #6180.
2021-08-25 11:44:52 -07:00
jonathanmetzman a3f8ac1403
Fix coverage command and misc fixes (#6262) 2021-08-23 10:18:11 +10:00
jonathanmetzman e407f54e61
[infra][build] Switch to f-strings. (#6182) 2021-08-10 10:48:16 -07:00
Fabian Meumertzheim fee51cc181
[infra] Run JVM coverage builds (#5770) 2021-05-14 17:07:48 -07:00
Catena cyber c41e46ffc8
Rust coverage report (for Suricata) (#4697)
* Rust coverage test

* Workaround to get rust coverage for Suricata
2021-03-08 07:05:35 -08:00
jonathanmetzman 0ac841a1a4
Replace terms that are uninclusive. (#5045) 2021-01-25 08:41:34 -08:00
Max Moroz b97f6e296a
[infra] Allow coverage for Go project on GCB (#2817, #2714). (#4668) 2020-11-19 16:07:35 -08:00
Oliver Chang 3f1d43115f
Clean up build infra. (#4251)
- Remove gcb folder. Move the files that we still need into the
  build/functions dir.
- Remove badge_images. They are now stored on GCS.
- Remove jenins configs.
2020-08-05 11:20:48 +10:00
kabeer27 769c6e80f2
Adding build coverage cloud function, and refactoring test_utils.py (#4151)
* Adding build coverage cloud function, and refactoring test_utils.py

* Multiple changes will add a comment.

* Catching sys.exit() exception and removing useless wrapper build_steps function

* Comment update

* Comment update

* Comment formatting
2020-07-20 16:30:48 +10:00