Commit Graph

49 Commits

Author SHA1 Message Date
Ethan Roseman eb7534be0d Black (#380)
* Initial format

* action

* git subrepo pull --force backend/asm_differ

subrepo:
  subdir:   "backend/asm_differ"
  merged:   "ee239a2b"
upstream:
  origin:   "https://github.com/simonlindholm/asm-differ"
  branch:   "main"
  commit:   "ee239a2b"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "2f68596"

* git subrepo pull --force backend/mips_to_c

subrepo:
  subdir:   "backend/mips_to_c"
  merged:   "6704d61f"
upstream:
  origin:   "https://github.com/matt-kempster/mips_to_c"
  branch:   "master"
  commit:   "6704d61f"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "2f68596"

* vscode

* fix

* .
2022-02-20 23:21:38 +09:00
Alex Bates e764bfcebd split models.py into submodules (#359) 2022-02-18 03:47:04 +09:00
Ethan Roseman 169a838280 Make max_score populate even if the compilation fails (#357)
* Make max_score populate even if the compilation fails

* comment go bye bye

* test for last_updated
2022-02-18 03:11:21 +09:00
Ethan Roseman fbc1649ac9 Give target asm object to asm_differ as a byte array (#347) 2022-02-07 04:24:52 +09:00
Léo Lam 3cd9a4b0a8 backend: Ignore address differences when diffing code (#345)
For obvious reasons, function and variable addresses will not match the
original code. asm-differ has an option to ignore address differences
and make the diff less noisy. (This only has an effect for 32-bit ARM
and AArch64 at the moment.)
2022-02-07 04:18:27 +09:00
Léo Lam b42642fbc7 Use objdump --disassemble to avoid diffing past function end (when possible) (#343)
* Refactor objdump flag logic into separate function

Helps avoid nested ifs and mutable variables

* Use objdump --disassemble to avoid diffing past function end (when possible)

...and only when a diff_label was specified by the user.

* coreapp: Move label check into get_objdump_target_function_flags
2022-02-06 02:42:45 +09:00
Ethan Roseman 811aa89cc0 Update m2c and asm_differ, add support for decompiling ppc (#339)
* git subrepo pull --force backend/asm_differ

subrepo:
  subdir:   "backend/asm_differ"
  merged:   "1e73cd4"
upstream:
  origin:   "https://github.com/simonlindholm/asm-differ"
  branch:   "main"
  commit:   "1e73cd4"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "2f68596"

* git subrepo pull --force backend/mips_to_c

subrepo:
  subdir:   "backend/mips_to_c"
  merged:   "46c55a0"
upstream:
  origin:   "https://github.com/matt-kempster/mips_to_c"
  branch:   "master"
  commit:   "46c55a0"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "2f68596"

* Update asm_differ and mips_to_c integration, add support and test for ppc

* git subrepo pull --force backend/asm_differ

subrepo:
  subdir:   "backend/asm_differ"
  merged:   "76597c6"
upstream:
  origin:   "https://github.com/simonlindholm/asm-differ"
  branch:   "main"
  commit:   "76597c6"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "2f68596"
2022-02-05 01:40:05 +09:00
Ethan Roseman a293e6c290 /compile GET updates scratch scores (#287)
* /compile GET updates scratch scores, some slight refactoring

* cleanup
2022-01-05 00:35:37 +09:00
Ethan Roseman 323dab45d9 Prevent profiles being created for SSR requests, serializer cleanup (#274)
* Prevent profiles being created for SSR requests, serializer cleanup

* Log exceptions for diff assert errors

* oopth

* PR comments

* test

* oops

* test2
2022-01-01 22:55:01 +09:00
Mark Street a5fdd16aa2 Better parsing of start_address from nm output (#255) 2021-12-27 18:40:02 +09:00
Ethan Roseman f929174399 Dummy compiler + better error handling and reporting (#246)
* Initial work on dummy compiler + better exception / error stuff

* mypy

* Add more dummy functionality, fix some error handling, and organize views

* Imports, suggestion

* force include the dummy compiler

* attempt to fix issues

* Fix docker?

* undo dumb

* suggestion

* sugg2

* Turn off sandbox on winders

* oops

* PR suggestions, a new test, cleanup

* mypy

* Front-end dummy compiler, logging fix

* new prod option that removes dummy

* Cleanup, fixes

* cleanup

* more cleanin

* PROD -> DUMMY_COMPILER, move dummy config out of fs

* DJANGO_LOG_LEVEL as environ setting

* fix Dockerfile

* suggestion

* dummy off
2021-12-26 20:30:21 +09:00
Ethan Roseman 2abfbe07fb Remove Compilation (#212) 2021-11-21 02:33:18 +09:00
Ethan Roseman f5468a5c03 2 more things (#211)
* Ram cache for elf_object (fixes #207) and better diff label detecti
on / explanation (fixes #188)

* PR suggestions
2021-11-20 03:51:11 +09:00
Ethan Roseman bf1a8bed6d Backend stuffs (#190)
* Require and validate compiler on scratch creation (fixes #164)

* git subrepo pull backend/mips_to_c

subrepo:
  subdir:   "backend/mips_to_c"
  merged:   "67594e9"
upstream:
  origin:   "https://github.com/matt-kempster/mips_to_c"
  branch:   "master"
  commit:   "67594e9"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "2f68596"

* git subrepo pull backend/asm_differ

subrepo:
  subdir:   "backend/asm_differ"
  merged:   "c379de7"
upstream:
  origin:   "https://github.com/simonlindholm/asm-differ"
  branch:   "main"
  commit:   "c379de7"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "2f68596"

* Add max_score, remove original_context, compiler m2c flag

* Rename cc_opts to compiler_flags across the board (fixes #168)

* Rename cc_opts to compiler_flags across the board (fixes #168)

* PR comments, squash migrations
2021-10-26 21:14:48 +09:00
Mark Street 157acc3fa1 Move from 'arch' to 'platform' (#177)
* Move from 'arch' to 'platform'

* Fix linting / github actions failures

* PR feedback

* rebase against main

* update asm_prelude for ps2
2021-10-16 16:06:57 +09:00
alex 4e8b07efaa Diff from label (#151)
* Backend changes to diff from label rather than 0, also possibly fix #109

* implement diff_label frontend & fix assemble_asm

* Log stack trace if asm-differ fails

* don't return { obj } from api

* slight change in stub func code

* GET /compilers returns arches for compilers

* GET /compilers returns arches for compilers

* keep compiler_ids

* Obtain ido from download script, add comment for permuter api support

* Clean m2c wrapper code, add left pointer style, add test

* fix 3 tests

* list arches from api

* fix cookies in DEBUG

SameSite=None is incompatible with Secure, and this causes some browsers
to ignore the cookie altogether.

* fix test

Regression due to changing API to not return { "user": User } but
rather just the User object itself.

* fix create scratch without glabel

This works around a backend bug

* add label select on scratch creation

* show compilers/presets for current arch only

- fixes #92
- fixes #132

* fix mypy issues

* arch on scratch

* use .env.local instead of local.env

* fix unset compiler not considering arch

* fix compiler opts not displaying on first load if compiler is not gcc 2.8.1

Co-authored-by: Ethan Roseman <ethteck@gmail.com>
2021-10-12 00:59:33 +09:00
Ethan Roseman a43ab3e54d try 2 2021-10-05 20:51:30 +09:00
Ethan Roseman b058153fd1 Better diff.py error handling (fixes #109) 2021-10-05 20:47:05 +09:00
Zach Banks 82401ceb86 Use new asm_differ; do not show source or line numbers 2021-09-21 18:28:49 -04:00
Zach Banks 75d02135db Fix get_arch argument 2021-09-18 17:28:08 -04:00
Zach Banks 613f6781b3 Use improved asm_differ api 2021-09-18 12:43:02 -04:00
Zach Banks f699f2faf6 Partially incorporate PR feedback from Alex
- Reference `asm_differ` issue 56
- Add Typescript type for `DiffResponse`
- Make `FormatDiffText` a JSX component
- Handle missing `row.base`/`row.current`
2021-09-17 18:28:44 -04:00
Zach Banks 8a77660091 Use JSON format from asm_differ 2021-09-16 15:38:53 -04:00
Simon Lindholm d20fef1464 Cope with mypy-typechecking asm-differ/m2c 2021-09-06 15:39:13 +02:00
Ethan Roseman 694088d4dc Fix diff output 2021-09-06 18:17:56 +09:00
Ethan Roseman 166224bfdf mypy 2021-09-06 17:52:07 +09:00
Ethan Roseman 64c8925a59 Fix asm-differ integration 2021-09-06 17:38:01 +09:00
Zach Banks c05d7f07a0 Add mypy type checking (#100)
* Add mypy type checking

* PR Feedback

- Remove TODO-stubbed code
- Annotate `*args` as `str`s
- Push `Optional[str] --> ""` into callers
2021-08-26 14:49:33 -04:00
Ethan Roseman 3710c95fe6 diff.py upgrade oopz 2021-08-27 01:39:06 +09:00
Ethan Roseman 6abeb432bf fix Asm cache bug, remove as_opts 2021-08-27 01:05:51 +09:00
alex 4afc0b57be fix objdump 2021-08-26 14:05:10 +01:00
Ethan Roseman 2306500b0f Merge branch 'main' into compiler-opts-default 2021-08-25 23:22:59 +09:00
Simon Lindholm 5c1e9ceb74 Permuter import follow-ups 2021-08-25 13:23:50 +02:00
Ethan Roseman d408e80210 working on default compiler opts 2021-08-25 05:06:58 +09:00
Ethan Roseman 6b8cd23948 Intiial progress on arch refactor 2021-08-23 20:58:18 +09:00
Zach Banks e3f92a5fc5 Make sandbox easier to configure
- Read `USE_SANDBOX_JAIL` from `.env`
- Rename `SandboxWrapper` -> `Sandbox`
- Remove `--user`/`--group` from `nsjail` wrapper
- Refactor `Dockerfile` to build nsjail
2021-08-11 13:52:39 -04:00
Zach Banks 8281dd3a57 Run compiler commands in an nsjail 2021-08-10 23:11:14 -04:00
Ethan Roseman d1e78ea12b attempt to regenerate new/base asm if it doesn't exist in the db 2021-08-10 02:51:57 +09:00
Ethan Roseman 0143c7321e re-enable caching 2021-08-10 02:32:29 +09:00
Ethan Roseman 9de2792b9b better errors, disable caching temporarily 2021-08-10 01:08:33 +09:00
Ethan Roseman a0b92b39ca -quiet for gcc 2.8.1, remove unnecessary cod 2021-08-10 00:17:21 +09:00
Ethan Roseman 3362d06fcd Merge branch 'main' into compileropts 2021-08-09 23:35:34 +09:00
Zach Banks ca8cad4d07 Move object files from the filesystem into the database 2021-08-09 02:38:22 -04:00
Ethan Roseman b6f34bc754 Compiler configuration refactor, CHANGELOG, etc 2021-08-08 21:00:03 +09:00
Ethan Roseman 94de1e3aec Scratch updating, fix various bugs, toast 2021-08-02 22:45:57 +09:00
Ethan Roseman d7c5f4baa6 diff.py integration working in the backend 2021-08-01 03:58:24 +09:00
Ethan Roseman d87eddfa12 diff.py integration progress 2021-08-01 03:35:42 +09:00
Ethan Roseman a533712e17 everything done except for asm_diff_wrapper 2021-08-01 02:42:11 +09:00
Ethan Roseman b4879c9fb2 refactoring to get diff.py integration working 2021-08-01 02:29:21 +09:00