mirror of
https://github.com/servo/servo
synced 2026-04-25 17:15:48 +02:00
Move ply and WebIDL into script_bindings (#43180)
This is required to publish script_bindings, since all files used during codegen need to be there. It might also be possible to generate the bindings ahead of time and vendor them in-tree, but this seems painful to setup from a CI perspective. Since there don't seem to be any other users in-tree we can just vendor into the script-bindings directory. `ply` is licensed under the BSD 3 clause, and WebIDL under MPL-2.0, with the licenses available in our cargo package. Both tools won't end up in `servo` since they are build-time dependencies, so I believe we don't need to adjust the crate license, or configure `about.toml`. Testing: Should be covered by existing tests. We don't test if this allows vendored builds or published builds. Fixes: Partial fix for #43145 --------- Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
This commit is contained in:
committed by
GitHub
parent
74c16ffd8a
commit
9069043477
@@ -3,10 +3,12 @@ name = "servo-script-bindings"
|
||||
build = "build.rs"
|
||||
version.workspace = true
|
||||
authors.workspace = true
|
||||
license.workspace = true
|
||||
edition.workspace = true
|
||||
publish.workspace = true
|
||||
rust-version.workspace = true
|
||||
# BSD-3-Clause comes from third_party/ply, which doesn't end up in any produced build-artifact,
|
||||
# but is used during the build via build.rs.
|
||||
license = "MPL-2.0 AND BSD-3-Clause"
|
||||
|
||||
# https://github.com/rust-lang/cargo/issues/3544
|
||||
links = "script_bindings_crate"
|
||||
|
||||
@@ -24,8 +24,8 @@ fn main() {
|
||||
println!("cargo::rerun-if-changed=webidls");
|
||||
println!("cargo::rerun-if-changed=codegen");
|
||||
println!("cargo::rerun-if-changed={}", css_properties_json.display());
|
||||
println!("cargo::rerun-if-changed=../../third_party/WebIDL/WebIDL.py");
|
||||
// NB: We aren't handling changes in `third_party/ply` here.
|
||||
println!("cargo::rerun-if-changed=third_party/WebIDL/WebIDL.py");
|
||||
println!("cargo::rerun-if-changed=third_party/ply");
|
||||
|
||||
let status = find_python()
|
||||
.arg("codegen/run.py")
|
||||
|
||||
@@ -14,7 +14,7 @@ from typing import TYPE_CHECKING
|
||||
from collections.abc import Iterator
|
||||
|
||||
SCRIPT_PATH = os.path.abspath(os.path.dirname(__file__))
|
||||
SERVO_ROOT = os.path.abspath(os.path.join(SCRIPT_PATH, "..", "..", ".."))
|
||||
SCRIPT_BINDINGS_ROOT = os.path.abspath(os.path.join(SCRIPT_PATH, ".."))
|
||||
|
||||
FILTER_PATTERN = re.compile("// skip-unless ([A-Z_]+)\n")
|
||||
|
||||
@@ -24,15 +24,15 @@ if TYPE_CHECKING:
|
||||
|
||||
def main() -> None:
|
||||
os.chdir(os.path.join(os.path.dirname(__file__)))
|
||||
sys.path.insert(0, os.path.join(SERVO_ROOT, "third_party", "WebIDL"))
|
||||
sys.path.insert(0, os.path.join(SERVO_ROOT, "third_party", "ply"))
|
||||
sys.path.insert(0, os.path.join(SCRIPT_BINDINGS_ROOT, "third_party", "WebIDL"))
|
||||
sys.path.insert(0, os.path.join(SCRIPT_BINDINGS_ROOT, "third_party", "ply"))
|
||||
|
||||
css_properties_json, out_dir = sys.argv[1:]
|
||||
# Four dotdots: /path/to/target(4)/debug(3)/build(2)/style-*(1)/out
|
||||
# Do not ascend above the target dir, because it may not be called target
|
||||
# or even have a parent (see CARGO_TARGET_DIR).
|
||||
doc_servo = os.path.join(out_dir, "..", "..", "..", "..", "doc")
|
||||
webidls_dir = os.path.join(SCRIPT_PATH, "..", "webidls")
|
||||
webidls_dir = os.path.join(SCRIPT_BINDINGS_ROOT, "webidls")
|
||||
config_file = "Bindings.conf"
|
||||
|
||||
import WebIDL
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user