Remove the libsimpleservo C API (#31172)

This is unused and unmaintained. It also added a bit of complication
to the build.
This commit is contained in:
Martin Robinson 2024-01-27 10:19:25 +01:00 committed by GitHub
parent b10875956a
commit bbba839278
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 159 additions and 1758 deletions

View file

@ -57,7 +57,7 @@ class MachCommands(CommandBase):
help="Command-line arguments to be passed through to Cargo")
@CommandBase.common_command_arguments(build_configuration=True, build_type=True)
def build(self, build_type: BuildType, jobs=None, params=None, no_package=False,
verbose=False, very_verbose=False, libsimpleservo=False, **kwargs):
verbose=False, very_verbose=False, **kwargs):
opts = params or []
if build_type.is_release():
@ -99,19 +99,15 @@ class MachCommands(CommandBase):
print((key, env[key]))
status = self.run_cargo_build_like_command(
"build", opts, env=env, verbose=verbose,
libsimpleservo=libsimpleservo, **kwargs
)
# Do some additional things if the build succeeded
built_binary = self.get_binary_path(
build_type,
target=self.cross_compile_target,
android=self.is_android_build,
simpleservo=libsimpleservo
)
"build", opts, env=env, verbose=verbose, **kwargs)
if status == 0:
built_binary = self.get_binary_path(
build_type,
target=self.cross_compile_target,
android=self.is_android_build,
)
if self.is_android_build and not no_package:
flavor = None
if "googlevr" in self.features:
@ -128,14 +124,12 @@ class MachCommands(CommandBase):
status = 1
elif sys.platform == "darwin":
servo_path = self.get_binary_path(
build_type, target=self.cross_compile_target, simpleservo=libsimpleservo)
servo_bin_dir = os.path.dirname(servo_path)
servo_bin_dir = os.path.dirname(built_binary)
assert os.path.exists(servo_bin_dir)
if self.enable_media:
print("Packaging gstreamer dylibs")
if not package_gstreamer_dylibs(self.cross_compile_target, servo_path):
if not package_gstreamer_dylibs(self.cross_compile_target, built_binary):
return 1
# On the Mac, set a lovely icon. This makes it easier to pick out the Servo binary in tools
@ -146,7 +140,7 @@ class MachCommands(CommandBase):
icon = Cocoa.NSImage.alloc().initWithContentsOfFile_(icon_path)
if icon is not None:
Cocoa.NSWorkspace.sharedWorkspace().setIcon_forFile_options_(icon,
servo_path,
built_binary,
0)
except ImportError:
pass

View file

@ -331,23 +331,15 @@ class CommandBase(object):
apk_name = "servoapp.apk"
return path.join(base_path, build_type.directory_name(), apk_name)
def get_binary_path(self, build_type: BuildType, target=None, android=False, simpleservo=False):
def get_binary_path(self, build_type: BuildType, target=None, android=False):
base_path = util.get_target_dir()
if android:
base_path = path.join(base_path, self.config["android"]["target"])
simpleservo = True
return path.join(base_path, build_type.directory_name(), "libsimpleservo.so")
elif target:
base_path = path.join(base_path, target)
binary_name = f"servo{servo.platform.get().executable_suffix()}"
if simpleservo:
if sys.platform == "win32":
binary_name = "simpleservo.dll"
elif sys.platform == "darwin":
binary_name = "libsimpleservo.dylib"
else:
binary_name = "libsimpleservo.so"
binary_path = path.join(base_path, build_type.directory_name(), binary_name)
if not path.exists(binary_path):
@ -688,13 +680,6 @@ class CommandBase(object):
'--media-stack', default=None, group="Feature Selection",
choices=["gstreamer", "dummy"], help='Which media stack to use',
),
CommandArgument(
'--libsimpleservo',
default=None,
group="Feature Selection",
action='store_true',
help='Build the libsimpleservo library instead of the servo executable',
),
CommandArgument(
'--debug-mozjs',
default=False,
@ -828,7 +813,6 @@ class CommandBase(object):
def run_cargo_build_like_command(
self, command: str, cargo_args: List[str],
env=None, verbose=False,
libsimpleservo=False,
debug_mozjs=False, with_debug_assertions=False,
with_frame_pointer=False, without_wgl=False,
**_kwargs
@ -848,12 +832,8 @@ class CommandBase(object):
args = []
if "--manifest-path" not in cargo_args:
if libsimpleservo or self.is_android_build:
if self.is_android_build:
api = "jniapi"
else:
api = "capi"
port = path.join("libsimpleservo", api)
if self.is_android_build:
port = "jniapi"
else:
port = "servoshell"
args += [