From 8ab98365588d28f6addece632e5d2d062f03d1a1 Mon Sep 17 00:00:00 2001 From: Michal Gregorczyk Date: Sat, 31 Jan 2026 23:58:41 +0100 Subject: [PATCH 1/7] delete workflows related to jdwp --- .github/workflows/black.yml | 17 ----------------- .github/workflows/jdwp.yml | 28 ---------------------------- 2 files changed, 45 deletions(-) delete mode 100644 .github/workflows/black.yml delete mode 100644 .github/workflows/jdwp.yml diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml deleted file mode 100644 index 273fd34..0000000 --- a/.github/workflows/black.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Lint Codebase - -on: [push, pull_request] - -jobs: - lint_codebase: - name: Lint and format codebase - runs-on: ubuntu-22.04 - - steps: - - uses: actions/checkout@v4 - - uses: psf/black@stable - with: - options: "--check --verbose" - src: "./projects/jdwp" - - diff --git a/.github/workflows/jdwp.yml b/.github/workflows/jdwp.yml deleted file mode 100644 index 36e886c..0000000 --- a/.github/workflows/jdwp.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Build jdwp project - -on: [push, pull_request] - -jobs: - build_jdwp_project: - name: Build and Test JDWP Project - runs-on: ubuntu-22.04 - - steps: - - name: Checkout repository and submodules - uses: actions/checkout@v3 - with: - submodules: recursive - - name: Initialize JDWP Project Dependencies - run: make buck2-host python-host pyre-host - - name: Build and run - run: | - eval `make setup-env` - buck2 run //projects/jdwp:main - - name: Run Tests - run: | - eval `make setup-env` - buck2 test //projects/jdwp/tests/... - - name: Run Pyre Type Checking - run: | - eval `make setup-env` - cd projects/jdwp && pyre --version=client check From 5f16aa21a80d4740ca1f1e47453dc40287def3b2 Mon Sep 17 00:00:00 2001 From: Michal Gregorczyk Date: Sun, 1 Feb 2026 00:10:43 +0100 Subject: [PATCH 2/7] remove projects/jdwp --- projects/jdwp/BUCK | 14 -- projects/jdwp/__init__.py | 0 projects/jdwp/build.mk | 16 -- projects/jdwp/codegen/BUCK | 28 --- projects/jdwp/codegen/dataclass_generator.py | 153 -------------- projects/jdwp/codegen/new_type_generator.py | 21 -- projects/jdwp/codegen/types.py | 30 --- projects/jdwp/defs/BUCK | 8 - .../jdwp/defs/command_sets/event_request.py | 154 -------------- .../jdwp/defs/command_sets/reference_type.py | 48 ----- .../jdwp/defs/command_sets/virtual_machine.py | 181 ---------------- projects/jdwp/defs/constants.py | 194 ------------------ projects/jdwp/defs/schema.py | 147 ------------- projects/jdwp/main.py | 9 - projects/jdwp/runtime/BUCK | 25 --- projects/jdwp/runtime/async_streams.py | 181 ---------------- projects/jdwp/runtime/jdwpstruct.py | 20 -- projects/jdwp/tests/BUCK | 11 - projects/jdwp/tests/defs/schema.py | 19 -- projects/jdwp/tests/runtime/import.py | 17 -- .../jdwp/tests/test_dataclass_generator.py | 104 ---------- .../jdwp/tests/test_new_type_generator.py | 16 -- projects/jdwp/tests/test_types.py | 20 -- 23 files changed, 1416 deletions(-) delete mode 100644 projects/jdwp/BUCK delete mode 100644 projects/jdwp/__init__.py delete mode 100644 projects/jdwp/build.mk delete mode 100644 projects/jdwp/codegen/BUCK delete mode 100644 projects/jdwp/codegen/dataclass_generator.py delete mode 100644 projects/jdwp/codegen/new_type_generator.py delete mode 100644 projects/jdwp/codegen/types.py delete mode 100644 projects/jdwp/defs/BUCK delete mode 100644 projects/jdwp/defs/command_sets/event_request.py delete mode 100644 projects/jdwp/defs/command_sets/reference_type.py delete mode 100644 projects/jdwp/defs/command_sets/virtual_machine.py delete mode 100644 projects/jdwp/defs/constants.py delete mode 100644 projects/jdwp/defs/schema.py delete mode 100644 projects/jdwp/main.py delete mode 100644 projects/jdwp/runtime/BUCK delete mode 100644 projects/jdwp/runtime/async_streams.py delete mode 100644 projects/jdwp/runtime/jdwpstruct.py delete mode 100644 projects/jdwp/tests/BUCK delete mode 100644 projects/jdwp/tests/defs/schema.py delete mode 100644 projects/jdwp/tests/runtime/import.py delete mode 100644 projects/jdwp/tests/test_dataclass_generator.py delete mode 100644 projects/jdwp/tests/test_new_type_generator.py delete mode 100644 projects/jdwp/tests/test_types.py diff --git a/projects/jdwp/BUCK b/projects/jdwp/BUCK deleted file mode 100644 index bbad7db..0000000 --- a/projects/jdwp/BUCK +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. - -python_binary( - name = "main", - main = "main.py", - deps = [], -) - - -python_library( - name = "lib", - srcs = glob(["**/*.py"]), - visibility = ["PUBLIC"], -) diff --git a/projects/jdwp/__init__.py b/projects/jdwp/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/projects/jdwp/build.mk b/projects/jdwp/build.mk deleted file mode 100644 index 22f4220..0000000 --- a/projects/jdwp/build.mk +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. - -jdwp-host-prepare: \ - black-host \ - buck2-host \ - python-host \ - pyre-host - -jdwp-check: jdwp-host-prepare - buck2 run //projects/jdwp:main - buck2 test //projects/jdwp/... - pyre check - black projects/jdwp --check - -jdwp-format: black-host - black projects/jdwp diff --git a/projects/jdwp/codegen/BUCK b/projects/jdwp/codegen/BUCK deleted file mode 100644 index f33b9bb..0000000 --- a/projects/jdwp/codegen/BUCK +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. - -python_binary( - name="generate-new-types", - main_module="projects.jdwp.codegen.new_type_generator", - deps=[ - ":codegen", - ], - visibility=["//projects/jdwp/runtime/..."], -) - -python_binary( - name="generate-dataclasses", - main_module="projects.jdwp.codegen.dataclass_generator", - deps=[ - ":codegen", - ], - visibility=["//projects/jdwp/runtime/..."], -) - -python_library( - name="codegen", - srcs=glob(["**/*.py"]), - deps=["//projects/jdwp/defs:defs"], - visibility=[ - "PUBLIC", - ], -) diff --git a/projects/jdwp/codegen/dataclass_generator.py b/projects/jdwp/codegen/dataclass_generator.py deleted file mode 100644 index f336b98..0000000 --- a/projects/jdwp/codegen/dataclass_generator.py +++ /dev/null @@ -1,153 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. - -import enum -from textwrap import dedent -from projects.jdwp.codegen.types import python_type_for -import typing - -from projects.jdwp.defs.schema import ( - Array, - ArrayLength, - Command, - CommandSet, - Field, - Struct, - TaggedUnion, - UnionTag, -) - - -StructLink = typing.Tuple[Struct, Field, Struct] - - -class StructGenerator: - def __init__(self, root: Struct, name: str): - self.__root = root - self.__struct_to_name = compute_struct_names(root, name) - - def __get_python_type_for(self, struct: Struct, field: Field) -> str: - type = field.type - match type: - case Struct(): - return self.__struct_to_name[type] - case Array(): - array_type = typing.cast(Array, type) - return f"typing.List[{self.__struct_to_name[array_type.element_type]}]" - case TaggedUnion(): - tagged_union_type = typing.cast(TaggedUnion, type) - union_types = [ - self.__struct_to_name[case_struct] - for (_, case_struct) in tagged_union_type.cases - ] - union_types_str = ", ".join(union_types) - return f"typing.Union[{union_types_str}]" - case _: - return python_type_for(type) - - def __is_explicit_field(self, field: Field) -> bool: - return not isinstance(field.type, (ArrayLength, UnionTag)) - - def __get_field_name(self, field: Field) -> str: - words = field.name.split(" ") - words = [words[0]] + [word.capitalize() for word in words[1:]] - return "".join(words) - - def __generate_dataclass(self, struct: Struct) -> str: - name = self.__struct_to_name[struct] - fields_def = "\n".join( - f" {self.__get_field_name(field)}: {self.__get_python_type_for(struct, field)}" - for field in struct.fields - if self.__is_explicit_field(field) - ) - class_def = f"@dataclasses.dataclass(frozen=True)\nclass {name}:\n{fields_def}" - return dedent(class_def) - - def generate(self) -> typing.Generator[str, None, None]: - for _, _, nested in reversed(list(nested_structs(self.__root))): - yield self.__generate_dataclass(nested) - yield self.__generate_dataclass(self.__root) - - -def format_enum_name(enum_value: enum.Enum) -> str: - words = enum_value.name.split("_") - formatted_name = "".join(word.capitalize() for word in words) - return f"{formatted_name}Type" - - -def nested_structs(root: Struct) -> typing.Generator[StructLink, None, None]: - for field in root.fields: - field_type = field.type - match field_type: - case Array(): - array_type = typing.cast(Array, field_type) - yield root, field, array_type.element_type - yield from nested_structs(array_type.element_type) - case TaggedUnion(): - tagged_union_type = typing.cast(TaggedUnion, field_type) - for _, struct in tagged_union_type.cases: - yield root, field, struct - yield from nested_structs(struct) - case Struct(): - yield root, field, field_type - yield from nested_structs(field_type) - - -def compute_struct_names(root: Struct, name: str) -> typing.Mapping[Struct, str]: - names = {root: name} - for parent, field, nested in nested_structs(root): - sanitized_field_name = "".join( - word.capitalize() for word in field.name.split(" ") - ) - type = field.type - match type: - case Struct(): - names[nested] = f"{names[parent]}{sanitized_field_name}" - case Array(): - names[nested] = f"{names[parent]}{sanitized_field_name}Element" - case TaggedUnion(): - tagged_union_type = typing.cast(TaggedUnion, type) - for case_value, case_struct in tagged_union_type.cases: - case_name = format_enum_name(case_value) - names[case_struct] = ( - f"{names[parent]}{sanitized_field_name}Case{case_name}" - ) - return names - - -def generate_for_command(command: Command) -> typing.Generator[str, None, None]: - if command.out: - yield from StructGenerator(command.out, f"{command.name}Out").generate() - if command.reply: - yield from StructGenerator(command.reply, f"{command.name}Reply").generate() - - -def generate_for_command_set( - command_set: CommandSet, -) -> typing.Generator[str, None, None]: - for command in command_set.commands: - yield from generate_for_command(command) - - -def generate_for_all_command_sets() -> typing.Generator[str, None, None]: - # TODO: refactor this once PR90 is merged - from projects.jdwp.defs.command_sets.virtual_machine import VirtualMachine - from projects.jdwp.defs.command_sets.reference_type import ReferenceType - from projects.jdwp.defs.command_sets.event_request import EventRequest - - yield from generate_for_command_set(VirtualMachine) - yield from generate_for_command_set(ReferenceType) - yield from generate_for_command_set(EventRequest) - - -def main(): - print("import dataclasses") - print("import typing") - print("from projects.jdwp.runtime.type_aliases import *") - - for struct_definition in generate_for_all_command_sets(): - print() - print(struct_definition) - - -if __name__ == "__main__": - main() diff --git a/projects/jdwp/codegen/new_type_generator.py b/projects/jdwp/codegen/new_type_generator.py deleted file mode 100644 index e034cdb..0000000 --- a/projects/jdwp/codegen/new_type_generator.py +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. - -from projects.jdwp.defs.schema import IdType -from projects.jdwp.codegen.types import python_type_for - - -def get_type_alias_definition(jdwp_type: IdType) -> str: - """Return the type alias definition for a given IdType.""" - python_type = python_type_for(jdwp_type) - return f"{python_type} = typing.NewType('{python_type}', int)" - - -def generate_new_types(): - print("import typing") - for id_type in IdType: - type_alias_definition = get_type_alias_definition(id_type) - print(type_alias_definition) - - -if "__main__" == __name__: - generate_new_types() diff --git a/projects/jdwp/codegen/types.py b/projects/jdwp/codegen/types.py deleted file mode 100644 index b39308b..0000000 --- a/projects/jdwp/codegen/types.py +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. - -from projects.jdwp.defs.schema import ( - ArrayLength, - OpaqueType, - IdType, - IntegralType, - Type, - UnionTag, -) -import typing - - -__OPAQUE_TYPE_MAPPING = { - OpaqueType.BOOLEAN: "bool", - OpaqueType.LOCATION: "typing.Any", - OpaqueType.STRING: "str", -} - - -def python_type_for(jdwp_type: Type) -> str: - match jdwp_type: - case OpaqueType(): - return __OPAQUE_TYPE_MAPPING[jdwp_type] - case IdType(): - return jdwp_type.value[0].upper() + jdwp_type.value[1:] + "Type" - case IntegralType() | ArrayLength() | UnionTag(): - return "int" - case _: - raise Exception("not implemented") diff --git a/projects/jdwp/defs/BUCK b/projects/jdwp/defs/BUCK deleted file mode 100644 index 55cb280..0000000 --- a/projects/jdwp/defs/BUCK +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. - -python_library( - name = "defs", - srcs = glob(["**/*.py"]), - visibility = ["PUBLIC"], - deps = [], -) diff --git a/projects/jdwp/defs/command_sets/event_request.py b/projects/jdwp/defs/command_sets/event_request.py deleted file mode 100644 index 46c4694..0000000 --- a/projects/jdwp/defs/command_sets/event_request.py +++ /dev/null @@ -1,154 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. - -from projects.jdwp.defs.schema import ( - Command, - Field, - Struct, - CommandSet, - IntegralType, - ArrayLength, - Array, - TaggedUnion, - UnionTag, - IdType, - OpaqueType, -) -from projects.jdwp.defs.constants import ErrorType, ModifierKind - - -CountModifier = Struct( - [Field("count", IntegralType.INT, "Count before event. One for one-off.")] -) - -ConditionalModifier = Struct([Field("exprID", IntegralType.INT, "For the future")]) - -ThreadOnlyModifier = Struct([Field("thread", IdType.THREAD_ID, "Required thread")]) - -ClassOnlyModifier = Struct([Field("clazz", IdType.REFERENCE_TYPE_ID, "Required class")]) - -ClassMatchModifier = Struct( - [Field("classPattern", OpaqueType.STRING, "Restricted class pattern")] -) - -StepModifier = Struct( - [ - Field("thread", IdType.THREAD_ID, "Required thread"), - Field("size", IntegralType.INT, "Size of each step"), - Field("depth", IntegralType.INT, "Relative call stack limit"), - ] -) - -ClassExcludeModifier = Struct( - [Field("classPattern", OpaqueType.STRING, "Disallowed class pattern")] -) - -LocationOnlyModifier = Struct([Field("loc", OpaqueType.LOCATION, "Required location")]) - -ExceptionOnlyModifier = Struct( - [ - Field( - "exceptionOrNull", - IdType.REFERENCE_TYPE_ID, - "Exception to report. Null (0) means report exceptions of all types.", - ), - Field("caught", OpaqueType.BOOLEAN, "True if exception was caught"), - Field("uncaught", OpaqueType.BOOLEAN, "True if exception was uncaught"), - ] -) - -FieldOnlyModifier = Struct( - [ - Field( - "declaring", IdType.REFERENCE_TYPE_ID, "Type in which field is declared." - ), - Field("fieldID", IntegralType.INT, "Required field"), - ] -) - -InstanceOnlyModifier = Struct( - [Field("instance", IdType.OBJECT_ID, "Required 'this' object")] -) - -SourceNameMatchModifier = Struct( - [Field("sourceNamePattern", OpaqueType.STRING, "Required source name pattern")] -) - -__SetCommand_out_modKind = Field( - "modKind", UnionTag(IntegralType.BYTE, ModifierKind), "Modifier kind" -) - -__SetCommand_outArray_element_modifier = Field( - "Modifier cases", - TaggedUnion( - __SetCommand_out_modKind, - [ - (ModifierKind.COUNT, CountModifier), - (ModifierKind.CONDITIONAL, ConditionalModifier), - (ModifierKind.THREAD_ONLY, ThreadOnlyModifier), - (ModifierKind.CLASS_ONLY, ClassOnlyModifier), - (ModifierKind.CLASS_MATCH, ClassMatchModifier), - (ModifierKind.CLASS_EXCLUDE, ClassExcludeModifier), - (ModifierKind.STEP, StepModifier), - (ModifierKind.LOCATION_ONLY, LocationOnlyModifier), - (ModifierKind.EXCEPTION_ONLY, ExceptionOnlyModifier), - (ModifierKind.FIELD_ONLY, FieldOnlyModifier), - (ModifierKind.INSTANCE_ONLY, InstanceOnlyModifier), - (ModifierKind.SOURCE_NAME_MATCH, SourceNameMatchModifier), - ], - ), - "Modifier cases.", -) - -__SetCommand_outModifierArray_length = Field( - "modifiers", - ArrayLength(IntegralType.INT), - "Constraints used to control the number of generated events.", -) -__SetCommand_out = Struct( - [ - Field("eventKind", IntegralType.BYTE, "The kind of event to request."), - Field("suspendPolicy", IntegralType.BYTE, "The suspend policy to use."), - __SetCommand_outModifierArray_length, - Field( - "outModifiers", - Array( - Struct( - [ - __SetCommand_out_modKind, - __SetCommand_outArray_element_modifier, - ] - ), - __SetCommand_outModifierArray_length, - ), - "Modifier Array", - ), - ] -) - -SetCommand = Command( - name="SetCommand", - id=1, - out=__SetCommand_out, - reply=Struct([Field("requestID", IntegralType.INT, "ID of the request created.")]), - error={ - ErrorType.INVALID_EVENT_TYPE, - ErrorType.INVALID_CLASS, - ErrorType.INVALID_STRING, - ErrorType.INVALID_OBJECT, - ErrorType.INVALID_COUNT, - ErrorType.INVALID_FIELDID, - ErrorType.INVALID_METHODID, - ErrorType.INVALID_LOCATION, - ErrorType.INVALID_EVENT_TYPE, - ErrorType.NOT_IMPLEMENTED, - ErrorType.VM_DEAD, - }, -) - -EventRequest = CommandSet( - name="EventRequest", - id=1, - commands=[ - SetCommand, - ], -) diff --git a/projects/jdwp/defs/command_sets/reference_type.py b/projects/jdwp/defs/command_sets/reference_type.py deleted file mode 100644 index 852a365..0000000 --- a/projects/jdwp/defs/command_sets/reference_type.py +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. - -"""Command Set: ReferenceType.""" - - -from projects.jdwp.defs.schema import ( - Command, - Field, - Struct, - CommandSet, - IdType, - OpaqueType, -) -from projects.jdwp.defs.constants import ErrorType - - -Signature = Command( - name="Signature", - id=1, - out=Struct( - [ - Field("refType", IdType.REFERENCE_TYPE_ID, "The Reference type ID."), - ] - ), - reply=Struct( - [ - Field( - "signature", - OpaqueType.STRING, - "The JNI signature for the reference type.", - ), - ] - ), - error={ - ErrorType.INVALID_CLASS, - ErrorType.INVALID_OBJECT, - ErrorType.VM_DEAD, - }, -) - - -ReferenceType = CommandSet( - name="ReferenceType", - id=2, - commands=[ - Signature, - ], -) diff --git a/projects/jdwp/defs/command_sets/virtual_machine.py b/projects/jdwp/defs/command_sets/virtual_machine.py deleted file mode 100644 index 497d35c..0000000 --- a/projects/jdwp/defs/command_sets/virtual_machine.py +++ /dev/null @@ -1,181 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. - -"""JDWP Commands for ThreadReference Command Set.""" - -from projects.jdwp.defs.schema import ( - Command, - Field, - Struct, - IdType, - OpaqueType, - Array, - CommandSet, - ArrayLength, - IntegralType, -) -from projects.jdwp.defs.constants import ErrorType - - -__AllClasses_reply_classes = Field( - "classes", - ArrayLength(IntegralType.INT), - "Number of reference type that follow", -) - - -__AllClasses_reply_classesArray_element = Struct( - [ - Field("refTypeTag", IntegralType.BYTE, "Kind of following reference type"), - Field("typeID", IdType.REFERENCE_TYPE_ID, "Loaded reference type"), - Field( - "signature", - OpaqueType.STRING, - "The JNI signature of the loaded reference type", - ), - Field("status", IntegralType.INT, "The current class status"), - ] -) - -__AllClasses_reply = Struct( - [ - __AllClasses_reply_classes, - Field( - "classesArray", - Array(__AllClasses_reply_classesArray_element, __AllClasses_reply_classes), - "Array of reference type.", - ), - ] -) - -AllClasses = Command( - name="AllClasses", - id=3, - out=None, - reply=__AllClasses_reply, - error={ - ErrorType.VM_DEAD, - }, -) - -__Version_reply = Struct( - [ - Field("description", OpaqueType.STRING, "Text information on the VM version"), - Field("jdwpMajor", IntegralType.INT, "JDWP major version number"), - Field("jdwpMinor", IntegralType.INT, "JDWP minor version number"), - Field( - "vmVersion", - OpaqueType.STRING, - "Target VM JRE version, as in the java.version property", - ), - Field( - "vmName", - OpaqueType.STRING, - "Target VM name, as in the java.vm.name property", - ), - ] -) - -Version = Command( - name="Version", - id=1, - out=None, - reply=__Version_reply, - error={ErrorType.VM_DEAD}, -) - -Dispose = Command( - name="Dispose", - id=6, - out=None, - reply=None, - error=set(), -) - -__IDSizes_reply = Struct( - [ - Field("fieldIDSize", IntegralType.INT, "fieldID size in bytes"), - Field("methodIDSize", IntegralType.INT, "methodID size in bytes"), - Field("objectIDSize", IntegralType.INT, "objectID size in bytes"), - Field("referenceTypeIDSize", IntegralType.INT, "referenceTypeID size in bytes"), - Field("frameIDSize", IntegralType.INT, "frameID size in bytes"), - ] -) - -IDSizes = Command( - name="IDSizes", - id=7, - out=None, - reply=__IDSizes_reply, - error={ErrorType.VM_DEAD}, -) - -__ClassPaths_reply_ClassPaths = Field( - "classpaths", - ArrayLength(IntegralType.INT), - "Number of paths in classpath", -) - -__ClassPaths_replyArray_element = Struct( - [ - Field("classpaths", OpaqueType.STRING, "List of classpath entries"), - ] -) - -__BootClassPaths_reply_bootClassPaths = Field( - "bootclasspaths", - ArrayLength(IntegralType.INT), - "Number of paths in bootclasspath", -) - -__BootClassPaths_replyArray_element = Struct( - [ - Field("bootclasspaths", OpaqueType.STRING, "List of bootclasspath entries"), - ] -) - -__ClassPaths_reply = Struct( - [ - Field( - "baseDir", - OpaqueType.STRING, - "Base directory used to resolve relative paths in either of the following lists.", - ), - __ClassPaths_reply_ClassPaths, - Field( - "classpaths Array", - Array(__ClassPaths_replyArray_element, __ClassPaths_reply_ClassPaths), - "Array of classpath.", - ), - __BootClassPaths_reply_bootClassPaths, - Field( - "bootclasspaths Array", - Array( - __BootClassPaths_replyArray_element, - __BootClassPaths_reply_bootClassPaths, - ), - "Array of bootclasspath.", - ), - ] -) - -ClassPaths = Command( - name="ClassPaths", - id=13, - out=None, - reply=__ClassPaths_reply, - error={ - ErrorType.VM_DEAD, - }, -) - -VirtualMachine = CommandSet( - name="VirtualMachine", - id=1, - commands=[ - Version, - AllClasses, - Dispose, - IDSizes, - ClassPaths, - ], -) diff --git a/projects/jdwp/defs/constants.py b/projects/jdwp/defs/constants.py deleted file mode 100644 index e9f31e0..0000000 --- a/projects/jdwp/defs/constants.py +++ /dev/null @@ -1,194 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. - -from enum import Enum, Flag - - -class ErrorType(Enum): - """Error constants for JDWP.""" - - NONE = 0 - INVALID_THREAD = 10 - INVALID_THREAD_GROUP = 11 - INVALID_PRIORITY = 12 - THREAD_NOT_SUSPENDED = 13 - THREAD_SUSPENDED = 14 - THREAD_NOT_ALIVE = 15 - INVALID_OBJECT = 20 - INVALID_CLASS = 21 - CLASS_NOT_PREPARED = 22 - INVALID_METHODID = 23 - INVALID_LOCATION = 24 - INVALID_FIELDID = 25 - INVALID_FRAMEID = 30 - NO_MORE_FRAMES = 31 - OPAQUE_FRAME = 32 - NOT_CURRENT_FRAME = 33 - TYPE_MISMATCH = 34 - INVALID_SLOT = 35 - DUPLICATE = 40 - NOT_FOUND = 41 - INVALID_MONITOR = 50 - NOT_MONITOR_OWNER = 51 - INTERRUPT = 52 - INVALID_CLASS_FORMAT = 60 - CIRCULAR_CLASS_DEFINITION = 61 - FAILS_VERIFICATION = 62 - ADD_METHOD_NOT_IMPLEMENTED = 63 - SCHEMA_CHANGE_NOT_IMPLEMENTED = 64 - INVALID_TYPESTATE = 65 - HIERARCHY_CHANGE_NOT_IMPLEMENTED = 66 - DELETE_METHOD_NOT_IMPLEMENTED = 67 - UNSUPPORTED_VERSION = 68 - NAMES_DONT_MATCH = 69 - CLASS_MODIFIERS_CHANGE_NOT_IMPLEMENTED = 70 - METHOD_MODIFIERS_CHANGE_NOT_IMPLEMENTED = 71 - NOT_IMPLEMENTED = 99 - NULL_POINTER = 100 - ABSENT_INFORMATION = 101 - INVALID_EVENT_TYPE = 102 - ILLEGAL_ARGUMENT = 103 - OUT_OF_MEMORY = 110 - ACCESS_DENIED = 111 - VM_DEAD = 112 - INTERNAL = 113 - UNATTACHED_THREAD = 115 - INVALID_TAG = 500 - ALREADY_INVOKING = 502 - INVALID_INDEX = 503 - INVALID_LENGTH = 504 - INVALID_STRING = 506 - INVALID_CLASS_LOADER = 507 - INVALID_ARRAY = 508 - TRANSPORT_LOAD = 509 - TRANSPORT_INIT = 510 - NATIVE_METHOD = 511 - INVALID_COUNT = 512 - - -class ClassStatus(Enum): - """ClassStatus constants for JDWP.""" - - VERIFIED = 1 - PREPARED = 2 - INITIALIZED = 4 - ERROR = 8 - - -class EventKind(Enum): - """EventKind constants for JDWP.""" - - SINGLE_STEP = 1 - BREAKPOINT = 2 - FRAME_POP = 3 - EXCEPTION = 4 - USER_DEFINED = 5 - THREAD_START = 6 - THREAD_DEATH = 7 - THREAD_END = 7 - CLASS_PREPARE = 8 - CLASS_UNLOAD = 9 - CLASS_LOAD = 10 - FIELD_ACCESS = 20 - FIELD_MODIFICATION = 21 - EXCEPTION_CATCH = 30 - METHOD_ENTRY = 40 - METHOD_EXIT = 41 - METHOD_EXIT_WITH_RETURN_VALUE = 42 - MONITOR_CONTENDED_ENTER = 43 - MONITOR_CONTENDED_ENTERED = 44 - MONITOR_WAIT = 45 - MONITOR_WAITED = 46 - VM_START = 90 - VM_INIT = 90 - VM_DEATH = 99 - VM_DISCONNECTED = 100 - - -class InvokeOptions(Flag): - """Invoke options constants for JDWP.""" - - INVOKE_SINGLE_THREADED = 0x01 - INVOKE_NONVIRTUAL = 0x02 - - -class StepDepth(Enum): - """StepDepth constants for JDWP.""" - - INTO = 0 - OVER = 1 - OUT = 2 - - -class StepSize(Enum): - """StepSize constants for JDWP.""" - - MIN = 0 - LINE = 1 - - -class SuspendPolicy(Enum): - """SuspendPolicy constants for JDWP.""" - - NONE = 0 - EVENT_THREAD = 1 - ALL = 2 - - -class SuspendStatus(Enum): - """SuspendStatus constants for JDWP.""" - - SUSPEND_STATUS_SUSPENDED = 0x1 - - -class Tag(Enum): - """Tag constants for JDWP.""" - - ARRAY = 91 - BYTE = 66 - CHAR = 67 - OBJECT = 76 - FLOAT = 70 - DOUBLE = 68 - INT = 73 - LONG = 74 - SHORT = 83 - VOID = 86 - BOOLEAN = 90 - STRING = 115 - THREAD = 116 - THREAD_GROUP = 103 - CLASS_LOADER = 108 - CLASS_OBJECT = 99 - - -class ThreadStatus(Enum): - """ThreadStatus constants for JDWP.""" - - ZOMBIE = 0 - RUNNING = 1 - SLEEPING = 2 - MONITOR = 3 - WAIT = 4 - - -class TypeTag(Enum): - """TypeTag constants for JDWP.""" - - CLASS = 1 - INTERFACE = 2 - ARRAY = 3 - - -class ModifierKind(Enum): - COUNT = 1 - CONDITIONAL = 2 - THREAD_ONLY = 3 - CLASS_ONLY = 4 - CLASS_MATCH = 5 - CLASS_EXCLUDE = 6 - LOCATION_ONLY = 7 - EXCEPTION_ONLY = 8 - FIELD_ONLY = 9 - STEP = 10 - INSTANCE_ONLY = 11 - SOURCE_NAME_MATCH = 12 diff --git a/projects/jdwp/defs/schema.py b/projects/jdwp/defs/schema.py deleted file mode 100644 index 2a3c56a..0000000 --- a/projects/jdwp/defs/schema.py +++ /dev/null @@ -1,147 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. - -"""Basic types for JDWP messages.""" - -from __future__ import annotations -from dataclasses import dataclass -from typing import Optional, Generic, Tuple, TypeVar, Type as TypeAlias, Union -from collections.abc import Mapping -from enum import Enum -from collections.abc import Set, Sequence -from projects.jdwp.defs.constants import ErrorType - - -Type = Union[ - "Array", - "ArrayLength", - "IdType", - "IntegralType", - "OpaqueType", - "Struct", - "TaggedUnion", - "UnionTag", -] - - -class OpaqueType(Enum): - """Opaque types whose implementation is provided by debugger runtime library or language.""" - - BOOLEAN = "boolean" - # TAGGED_OBJECT_ID = "tagged-objectID" - LOCATION = "location" - STRING = "string" - # VALUE = "value" - # UNTAGGED_VALUE = "untagged-value" - # ARRAY_REGION = "arrayregion" - - -class IdType(Enum): - """Types representing numeric IDs of internal VM objects.""" - - OBJECT_ID = "objectID" - THREAD_ID = "threadID" - THREAD_GROUP_ID = "threadGroupID" - STRING_ID = "stringID" - CLASS_LOADER_ID = "classLoaderID" - CLASS_OBJECT_ID = "classObjectID" - ARRAY_ID = "arrayID" - REFERENCE_TYPE_ID = "referenceTypeID" - CLASS_ID = "classID" - INTERFACE_ID = "interfaceID" - ARRAY_TYPE_ID = "arrayTypeID" - METHOD_ID = "methodID" - FIELD_ID = "fieldID" - FRAME_ID = "frameID" - - -class IntegralType(Enum): - """Integer types of different precision.""" - - BYTE = "byte" - INT = "int" - LONG = "long" - - -@dataclass(frozen=True) -class ArrayLength: - """Array length class.""" - - type: IntegralType - - -@dataclass(frozen=True) -class Array: - """Array class type.""" - - element_type: Struct - length: Field[ArrayLength] - - -EnumT = TypeVar("EnumT", bound=Enum) - - -@dataclass(frozen=True) -class TaggedUnion(Generic[EnumT]): - """Tagged Union class type""" - - tag: Field[UnionTag[EnumT]] - cases: Sequence[Tuple[EnumT, Struct]] - - def __post_init__(self): - object.__setattr__(self, "cases", tuple(self.cases)) - - -@dataclass(frozen=True) -class UnionTag(Generic[EnumT]): - """Union tag class type.""" - - tag: IntegralType - value: TypeAlias[EnumT] - - -TypeT = TypeVar("TypeT", bound=Type, covariant=True) - - -@dataclass(frozen=True) -class Field(Generic[TypeT]): - """Field class.""" - - name: str - type: TypeT - description: str - - -@dataclass(frozen=True) -class Struct: - """Struct class.""" - - fields: Sequence[Field[Type]] - - def __post_init__(self): - object.__setattr__(self, "fields", tuple(self.fields)) - - -@dataclass(frozen=True) -class Command: - """Command class.""" - - name: str - id: int - out: Optional[Struct] - reply: Optional[Struct] - error: Set[ErrorType] - - def __post_init__(self): - object.__setattr__(self, "error", frozenset(self.error)) - - -@dataclass(frozen=True) -class CommandSet: - """Command set class.""" - - name: str - id: int - commands: Sequence[Command] - - def __post_init__(self): - object.__setattr__(self, "commands", tuple(self.commands)) diff --git a/projects/jdwp/main.py b/projects/jdwp/main.py deleted file mode 100644 index 6924f3d..0000000 --- a/projects/jdwp/main.py +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. - - -def main(): - return None - - -if __name__ == "__main__": - main() diff --git a/projects/jdwp/runtime/BUCK b/projects/jdwp/runtime/BUCK deleted file mode 100644 index 03d4a2e..0000000 --- a/projects/jdwp/runtime/BUCK +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. - -genrule( - name = "type-aliases", - out = "type_aliases.py", - cmd = "$(exe //projects/jdwp/codegen:generate-new-types) > $OUT", -) - -genrule( - name = "structs", - out = "structs.py", - cmd = "$(exe //projects/jdwp/codegen:generate-dataclasses) > $OUT", -) - -python_library( - name = "runtime", - srcs = [ - ":structs", - ":type-aliases", - "async_streams.py", - "jdwpstruct.py", - ], - visibility = ["PUBLIC", ], - deps = [], -) diff --git a/projects/jdwp/runtime/async_streams.py b/projects/jdwp/runtime/async_streams.py deleted file mode 100644 index f1f9ae8..0000000 --- a/projects/jdwp/runtime/async_streams.py +++ /dev/null @@ -1,181 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. - -import abc -import typing - -from projects.jdwp.runtime.type_aliases import * - - -class JDWPInputStreamBase(abc.ABC): - # Methods for OpaqueType - @abc.abstractmethod - async def read_boolean(self) -> bool: - pass - - @abc.abstractmethod - async def read_location(self) -> typing.Any: - pass - - @abc.abstractmethod - async def read_string(self) -> str: - pass - - # Methods for IdType - @abc.abstractmethod - async def read_object_id(self) -> ObjectIDType: - pass - - @abc.abstractmethod - async def read_thread_id(self) -> ThreadIDType: - pass - - @abc.abstractmethod - async def read_thread_group_id(self) -> ThreadGroupIDType: - pass - - @abc.abstractmethod - async def read_string_id(self) -> StringIDType: - pass - - @abc.abstractmethod - async def read_class_loader_id(self) -> ClassLoaderIDType: - pass - - @abc.abstractmethod - async def read_class_object_id(self) -> ClassObjectIDType: - pass - - @abc.abstractmethod - async def read_array_id(self) -> ArrayIDType: - pass - - @abc.abstractmethod - async def read_reference_type_id(self) -> ReferenceTypeIDType: - pass - - @abc.abstractmethod - async def read_class_id(self) -> ClassIDType: - pass - - @abc.abstractmethod - async def read_interface_id(self) -> InterfaceIDType: - pass - - @abc.abstractmethod - async def read_array_type_id(self) -> ArrayTypeIDType: - pass - - @abc.abstractmethod - async def read_method_id(self) -> MethodIDType: - pass - - @abc.abstractmethod - async def read_field_id(self) -> FieldIDType: - pass - - @abc.abstractmethod - async def read_frame_id(self) -> FrameIDType: - pass - - # Methods for IntegralType - @abc.abstractmethod - async def read_byte(self) -> int: - pass - - @abc.abstractmethod - async def read_int(self) -> int: - pass - - @abc.abstractmethod - async def read_long( - self, - ) -> int: - pass - - -class JDWPOutputStreamBase(abc.ABC): - # Methods for OpaqueType - @abc.abstractmethod - def write_boolean(self, value: bool) -> None: - pass - - @abc.abstractmethod - def write_location(self, value: typing.Any) -> None: - pass - - @abc.abstractmethod - def write_string(self, value: str) -> None: - pass - - # Methods for IdType - @abc.abstractmethod - def write_object_id(self, value: ObjectIDType) -> None: - pass - - @abc.abstractmethod - def write_thread_id(self, value: ThreadIDType) -> None: - pass - - @abc.abstractmethod - def write_thread_group_id(self, value: ThreadGroupIDType) -> None: - pass - - @abc.abstractmethod - def write_string_id(self, value: StringIDType) -> None: - pass - - @abc.abstractmethod - def write_class_loader_id(self, value: ClassLoaderIDType) -> None: - pass - - @abc.abstractmethod - def write_class_object_id(self, value: ClassObjectIDType) -> None: - pass - - @abc.abstractmethod - def write_array_id(self, value: ArrayIDType) -> None: - pass - - @abc.abstractmethod - def write_reference_type_id(self, value: ReferenceTypeIDType) -> None: - pass - - @abc.abstractmethod - def write_class_id(self, value: ClassIDType) -> None: - pass - - @abc.abstractmethod - def write_interface_id(self, value: InterfaceIDType) -> None: - pass - - @abc.abstractmethod - def write_array_type_id(self, value: ArrayTypeIDType) -> None: - pass - - @abc.abstractmethod - def write_method_id(self, value: MethodIDType) -> None: - pass - - @abc.abstractmethod - def write_field_id(self, value: FieldIDType) -> None: - pass - - @abc.abstractmethod - def write_frame_id(self, value: FrameIDType) -> None: - pass - - # Methods for IntegralType - @abc.abstractmethod - def write_byte(self, value: int) -> None: - pass - - @abc.abstractmethod - def write_int(self, value: int) -> None: - pass - - @abc.abstractmethod - def write_long( - self, - value: int, - ) -> None: - pass diff --git a/projects/jdwp/runtime/jdwpstruct.py b/projects/jdwp/runtime/jdwpstruct.py deleted file mode 100644 index 793023a..0000000 --- a/projects/jdwp/runtime/jdwpstruct.py +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. - -from __future__ import annotations - -import abc -from projects.jdwp.runtime.async_streams import ( - JDWPInputStreamBase, - JDWPOutputStreamBase, -) - - -class JDWPStruct(abc.ABC): - @abc.abstractmethod - def serialize(self, output: JDWPOutputStreamBase): - pass - - @staticmethod - @abc.abstractmethod - async def parse(input: JDWPInputStreamBase) -> JDWPStruct: - pass diff --git a/projects/jdwp/tests/BUCK b/projects/jdwp/tests/BUCK deleted file mode 100644 index 1483495..0000000 --- a/projects/jdwp/tests/BUCK +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. - -python_test( - name = "tests", - deps = [ - "//projects/jdwp/defs:defs", - "//projects/jdwp/codegen:codegen", - "//projects/jdwp/runtime:runtime", - ], - srcs = glob(["**/*.py"]), -) diff --git a/projects/jdwp/tests/defs/schema.py b/projects/jdwp/tests/defs/schema.py deleted file mode 100644 index 2701a69..0000000 --- a/projects/jdwp/tests/defs/schema.py +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. - -import unittest - - -class SchemaTests(unittest.TestCase): - def test_schema_can_be_imported(self): - from projects.jdwp.defs.schema import OpaqueType - - def test_command_sets_are_hashable(self): - from projects.jdwp.defs.command_sets import ( - event_request, - reference_type, - virtual_machine, - ) - - hash(event_request.EventRequest) - hash(reference_type.ReferenceType) - hash(event_request.EventRequest) diff --git a/projects/jdwp/tests/runtime/import.py b/projects/jdwp/tests/runtime/import.py deleted file mode 100644 index 8821d94..0000000 --- a/projects/jdwp/tests/runtime/import.py +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. - -import unittest - - -class ImportTest(unittest.TestCase): - def test_structs_can_be_imported(self): - from projects.jdwp.runtime.structs import IDSizesReply - - def test_type_aliases_can_be_imported(self): - from projects.jdwp.runtime.type_aliases import ReferenceTypeIDType - - def test_jdwpstruct_can_be_imported(self): - from projects.jdwp.runtime.jdwpstruct import JDWPStruct - - def test_streams_can_be_imported(self): - from projects.jdwp.runtime.async_streams import JDWPInputStreamBase diff --git a/projects/jdwp/tests/test_dataclass_generator.py b/projects/jdwp/tests/test_dataclass_generator.py deleted file mode 100644 index 4114689..0000000 --- a/projects/jdwp/tests/test_dataclass_generator.py +++ /dev/null @@ -1,104 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. - -import unittest -from projects.jdwp.defs.schema import ArrayLength, IntegralType, Struct, Field, Array -from projects.jdwp.codegen.dataclass_generator import StructGenerator - - -class TestStructGenerator(unittest.TestCase): - def test_simple_struct(self): - simple_struct = Struct( - fields=[ - Field(name="id", type=IntegralType.INT, description="An integer ID") - ] - ) - - generator = StructGenerator(simple_struct, "SimpleStruct") - - result = generator.generate() - - expected = [ - "@dataclasses.dataclass(frozen=True)\n" - "class SimpleStruct:\n" - " id: int" - ] - - self.assertSequenceEqual(list(result), expected) - - def test_nested_struct(self): - inner_struct = Struct( - fields=[ - Field( - name="inner_field", - type=IntegralType.INT, - description="Inner integer field", - ) - ] - ) - outer_struct = Struct( - fields=[ - Field(name="nested", type=inner_struct, description="Nested structure") - ] - ) - - generator = StructGenerator(outer_struct, "OuterStruct") - - result = generator.generate() - - expected = [ - "@dataclasses.dataclass(frozen=True)\n" - "class OuterStructNested:\n" - " inner_field: int", - "@dataclasses.dataclass(frozen=True)\n" - "class OuterStruct:\n" - " nested: OuterStructNested", - ] - - self.assertSequenceEqual(list(result), expected) - - def test_struct_in_array(self): - # Define a structure - element_struct = Struct( - fields=[ - Field( - name="element_field", - type=IntegralType.INT, - description="Element field", - ) - ] - ) - - array_length = Field( - name="length", - type=ArrayLength(type=IntegralType.INT), - description="Array length", - ) - - array_struct = Struct( - fields=[ - array_length, - Field( - name="array of elements", - type=Array( - element_type=element_struct, - length=array_length, - ), - description="Array of structures", - ), - ] - ) - - generator = StructGenerator(array_struct, "ArrayStruct") - - result = generator.generate() - - expected = [ - "@dataclasses.dataclass(frozen=True)\n" - "class ArrayStructArrayOfElementsElement:\n" - " element_field: int", - "@dataclasses.dataclass(frozen=True)\n" - "class ArrayStruct:\n" - " arrayOfElements: typing.List[ArrayStructArrayOfElementsElement]", - ] - - self.assertSequenceEqual(list(result), expected) diff --git a/projects/jdwp/tests/test_new_type_generator.py b/projects/jdwp/tests/test_new_type_generator.py deleted file mode 100644 index 864834a..0000000 --- a/projects/jdwp/tests/test_new_type_generator.py +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. - -import unittest -from projects.jdwp.defs.schema import IdType -from projects.jdwp.codegen.new_type_generator import get_type_alias_definition - - -class TestTypeAliasDefinition(unittest.TestCase): - def test_specific_type_alias_definitions(self): - expected_object_id_type_definition = ( - "ObjectIDType = typing.NewType('ObjectIDType', int)" - ) - self.assertEqual( - get_type_alias_definition(IdType.OBJECT_ID), - expected_object_id_type_definition, - ) diff --git a/projects/jdwp/tests/test_types.py b/projects/jdwp/tests/test_types.py deleted file mode 100644 index f8d7bbf..0000000 --- a/projects/jdwp/tests/test_types.py +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. - -import unittest -from projects.jdwp.codegen.types import python_type_for -from projects.jdwp.defs.schema import ArrayLength, IdType, IntegralType - - -class TestTypesMapping(unittest.TestCase): - def test_id_type_mapping(self): - for id_type in IdType: - with self.subTest(id_type=id_type): - result = python_type_for(id_type) - self.assertIsInstance( - result, str, f"Mapping for {id_type} is missing or not a string" - ) - - def test_array_length(self): - from projects.jdwp.defs.schema import ArrayLength, IntegralType - - self.assertEqual(python_type_for(ArrayLength(IntegralType.LONG)), "int") From ef20298318df1dcbd8378fe57341d62b858df69a Mon Sep 17 00:00:00 2001 From: Michal Gregorczyk Date: Sun, 1 Feb 2026 00:12:49 +0100 Subject: [PATCH 3/7] remove projects/pyre --- .gitignore | 3 --- .pyre_configuration | 10 ---------- projects/pyre/README | 2 -- projects/pyre/build.mk | 3 --- 4 files changed, 18 deletions(-) delete mode 100644 .pyre_configuration delete mode 100644 projects/pyre/README delete mode 100644 projects/pyre/build.mk diff --git a/.gitignore b/.gitignore index 02700c2..c56bff9 100644 --- a/.gitignore +++ b/.gitignore @@ -17,9 +17,6 @@ .vagrant/ ubuntu-bionic-18.04-cloudimg-console.log -# pyre -.pyre/ - bpftools-arm64.tar.gz bpftools-min-arm64.tar.gz bpftools-x86_64.tar.gz diff --git a/.pyre_configuration b/.pyre_configuration deleted file mode 100644 index 27720b2..0000000 --- a/.pyre_configuration +++ /dev/null @@ -1,10 +0,0 @@ -{ - "use_buck2": true, - "bxl_builder": "prelude//python/sourcedb/classic.bxl:build", - "targets": [ - "root//projects/jdwp/..." - ], - "ignore_all_errors": [ - "out" - ] -} diff --git a/projects/pyre/README b/projects/pyre/README deleted file mode 100644 index 3abe58b..0000000 --- a/projects/pyre/README +++ /dev/null @@ -1,2 +0,0 @@ -pyre-check -Home page: https://pyre-check.org/ diff --git a/projects/pyre/build.mk b/projects/pyre/build.mk deleted file mode 100644 index 93d9eab..0000000 --- a/projects/pyre/build.mk +++ /dev/null @@ -1,3 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. - -$(eval $(call pip-project,pyre,pyre-check)) From 9c759d727111728a370ae5e3babfa37041430ddb Mon Sep 17 00:00:00 2001 From: Michal Gregorczyk Date: Sun, 1 Feb 2026 00:15:49 +0100 Subject: [PATCH 4/7] remove projects/black --- projects/black/README | 5 ----- projects/black/build.mk | 3 --- 2 files changed, 8 deletions(-) delete mode 100644 projects/black/README delete mode 100644 projects/black/build.mk diff --git a/projects/black/README b/projects/black/README deleted file mode 100644 index 87a3bc5..0000000 --- a/projects/black/README +++ /dev/null @@ -1,5 +0,0 @@ -Black -Black is the uncompromising Python code formatter. - -github: https://github.com/psf/black -license url: https://github.com/psf/black#license diff --git a/projects/black/build.mk b/projects/black/build.mk deleted file mode 100644 index 02e4bfe..0000000 --- a/projects/black/build.mk +++ /dev/null @@ -1,3 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. - -$(eval $(call pip-project,black)) From 46594e733fea132c2be2cf3619af041e65223434 Mon Sep 17 00:00:00 2001 From: Michal Gregorczyk Date: Sun, 1 Feb 2026 00:19:14 +0100 Subject: [PATCH 5/7] remove remaining python configs --- .gitignore | 2 -- .vscode/settings.json | 6 ------ 2 files changed, 8 deletions(-) delete mode 100644 .vscode/settings.json diff --git a/.gitignore b/.gitignore index c56bff9..3284c00 100644 --- a/.gitignore +++ b/.gitignore @@ -25,5 +25,3 @@ bpftools-armv7.tar.gz bpftools-min-armv7.tar.gz bpftools-86.tar.gz bpftools-min-x86.tar.gz - -.flake8 diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 3445835..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "[python]": { - "editor.defaultFormatter": "ms-python.black-formatter" - }, - "python.formatting.provider": "none" -} From 14ccd948244db15e99735fe69d5baf168f71c1c0 Mon Sep 17 00:00:00 2001 From: Michal Gregorczyk Date: Sun, 1 Feb 2026 00:23:02 +0100 Subject: [PATCH 6/7] remove projects/buck2 --- .buckconfig | 20 -------------------- .buckroot | 0 .gitignore | 1 - .gitmodules | 3 --- prelude | 1 - projects/buck2/README | 6 ------ projects/buck2/REDME | 0 projects/buck2/build.mk | 32 -------------------------------- toolchains/BUCK | 25 ------------------------- 9 files changed, 88 deletions(-) delete mode 100644 .buckconfig delete mode 100644 .buckroot delete mode 160000 prelude delete mode 100644 projects/buck2/README delete mode 100644 projects/buck2/REDME delete mode 100644 projects/buck2/build.mk delete mode 100644 toolchains/BUCK diff --git a/.buckconfig b/.buckconfig deleted file mode 100644 index 107fb8a..0000000 --- a/.buckconfig +++ /dev/null @@ -1,20 +0,0 @@ -[repositories] -root = . -prelude = prelude -toolchains = toolchains -none = none - -[repository_aliases] -config = prelude -fbcode = none -fbsource = none -buck = none - -[parser] -target_platform_detector_spec = target:root//...->prelude//platforms:default - -[project] -ignore = .git - -[build] -execution_platforms = prelude//platforms:default diff --git a/.buckroot b/.buckroot deleted file mode 100644 index e69de29..0000000 diff --git a/.gitignore b/.gitignore index 3284c00..b87bd0d 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,6 @@ # build files /build/ /out/ -/buck-out/ # sources /projects/*/sources diff --git a/.gitmodules b/.gitmodules index faecebb..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "prelude"] - path = prelude - url = https://github.com/facebook/buck2-prelude.git diff --git a/prelude b/prelude deleted file mode 160000 index 81d87a5..0000000 --- a/prelude +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 81d87a53219072f30c30401eb495e411eb5a4c7e diff --git a/projects/buck2/README b/projects/buck2/README deleted file mode 100644 index f84c617..0000000 --- a/projects/buck2/README +++ /dev/null @@ -1,6 +0,0 @@ -buck2 - -github: https://github.com/facebook/buck2 -license url: https://github.com/facebook/buck2/blob/main/LICENSE-MIT - -Default version: v2023-09-01 diff --git a/projects/buck2/REDME b/projects/buck2/REDME deleted file mode 100644 index e69de29..0000000 diff --git a/projects/buck2/build.mk b/projects/buck2/build.mk deleted file mode 100644 index e828664..0000000 --- a/projects/buck2/build.mk +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. - -BUCK2_VERSION := 2023-10-01 - -ifeq ($(HOST_OS),GNU/Linux) -BUCK2_ARCHIVE_SUFFIX := unknown-linux-gnu -else -BUCK2_ARCHIVE_SUFFIX := apple-darwin -endif - -ifeq ($(HOST_MACHINE),arm64) -BUCK2_ARCHIVE_INFIX := aarch64 -else -BUCK2_ARCHIVE_INFIX := $(HOST_MACHINE) -endif - -BUCK2_ARCHIVE := buck2-$(BUCK2_ARCHIVE_INFIX)-$(BUCK2_ARCHIVE_SUFFIX).zst -BUCK2_URL := https://github.com/facebook/buck2/releases/download/$(BUCK2_VERSION)/$(BUCK2_ARCHIVE) - -$(HOST_OUT_DIR)/bin/buck2: $(DOWNLOADS_DIR)/$(BUCK2_ARCHIVE) | $(HOST_OUT_DIR) -# commands to unpack $(BUCK2_ARCHIVE) and set the executable flag - zstd -d $(DOWNLOADS_DIR)/$(BUCK2_ARCHIVE) -o $@ - touch $@ - chmod +x $@ - -$(DOWNLOADS_DIR)/$(BUCK2_ARCHIVE): | $(DOWNLOADS_DIR) -# instructions to download the archive - curl -L -s -o $@ $(BUCK2_URL) - -# Phony target for host -.PHONY: buck2-host -buck2-host: $(HOST_OUT_DIR)/bin/buck2 diff --git a/toolchains/BUCK b/toolchains/BUCK deleted file mode 100644 index 15362e2..0000000 --- a/toolchains/BUCK +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. - -load("@prelude//toolchains:python.bzl", "system_python_bootstrap_toolchain", "system_python_toolchain") -load("@prelude//toolchains:cxx.bzl", "system_cxx_toolchain") -load("@prelude//toolchains:genrule.bzl", "system_genrule_toolchain") - -system_cxx_toolchain( - name = "cxx", - visibility = ["PUBLIC"], -) - -system_python_toolchain( - name = "python", - visibility = ["PUBLIC"], -) - -system_genrule_toolchain( - name = "genrule", - visibility = ["PUBLIC"], - ) - -system_python_bootstrap_toolchain( - name = "python_bootstrap", - visibility = ["PUBLIC"], -) From 10f4cf1d515b0544b19e28a81ece6b700903ec7f Mon Sep 17 00:00:00 2001 From: Michal Gregorczyk Date: Sun, 1 Feb 2026 00:29:35 +0100 Subject: [PATCH 7/7] remove pip-project --- projects/project.mk | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/projects/project.mk b/projects/project.mk index 80c4f11..f5c2abf 100644 --- a/projects/project.mk +++ b/projects/project.mk @@ -198,17 +198,3 @@ define project-define = .PHONY: remove-$(1)-sources remove-$(1)-sources: ; rm -rf projects/$(1)/sources endef - -# Macro defining rules installing a python library/tool via pip -define pip-project = - $(call project-to-var,$(1))_HOST := \ - $(call project-host-target,$(1)) - - $(1)-host: $(call project-host-target,$(1)) - - $(call project-host-target,$(1)): \ - $(call project-host-target,python) \ - | $(HOST_BUILD_DIR) - python3 -m pip install $(if $(2),$(2),$(1)) - touch $$@ -endef