Skip to content

Commit

Permalink
Vendor Rust scraper library
Browse files Browse the repository at this point in the history
  • Loading branch information
DJAndries committed Feb 19, 2025
1 parent 653227a commit 116c4ad
Show file tree
Hide file tree
Showing 155 changed files with 28,436 additions and 80 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ license = "MPL-2.0"

[dependencies]
cxx = "1"
kuchikiki = "0.8.6-speedreader"
html5ever = "0.29.1"
scraper = "0.22"

[lib]
name = "document_extractor_cxx"
Expand Down
91 changes: 84 additions & 7 deletions third_party/rust/chromium_crates_io/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 16 additions & 2 deletions third_party/rust/chromium_crates_io/gnrt_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,13 @@ if (is_apple && target_cpu == "arm64") {
build_script_outputs = [ "lib.rs" ]

[crate.cssparser]
build_script_outputs = [ "tokenizer.rs" ]
extra_build_script_src_roots = [ "../build" ]
license_files = ['LICENSE']
extra_kv = { raw_gn = '''
if (epoch == "0.28" || epoch == "0.27") {
build_script_inputs = [ "//brave/third_party/rust/chromium_crates_io/vendor/cssparser-" + cargo_pkg_version + "/build/match_byte.rs" ]
build_script_outputs = [ "tokenizer.rs" ]
}
''' }

[crate.cssparser-macros]
license_files = ['LICENSE']
Expand Down Expand Up @@ -300,6 +304,13 @@ license_files = ['LICENSE-Apache']
[crate.num-traits]
extra_kv = { rustflags = [ "--cfg", "has_i128", "--cfg", "has_to_int_unchecked", "--cfg", "has_reverse_bits", "--cfg", "has_leading_trailing_ones", "--cfg", "has_int_assignop_ref", "--cfg", "has_div_euclid", "--cfg", "has_copysign" ] }

[crate.phf_macros]
extra_kv = { raw_gn = '''
if (epoch == "0.11") {
output_name = "phf_macros_v0_11"
}
''' }

[crate.powerfmt]
license_files = ['LICENSE-Apache']

Expand Down Expand Up @@ -391,6 +402,9 @@ extra_kv = { rustenv = [ "TYPENUM_BUILD_CONSTS=\" + rebase_path(target_gen_dir)
[crate.uint]
license_files = ['../../../../../common/licenses/Apache-2.0']

[crate.unicode-width]
license_files = ['../../../../../common/licenses/Apache-2.0']

[crate.wasi]
license_files = ['../../../../../common/licenses/Apache-2.0']

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"git": {
"sha1": "5dc6d916a73159745e1fc1dd1f745e05d3130b0f"
},
"path_in_vcs": ""
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: CI

on:
push:
branches: [main]
pull_request:
workflow_dispatch:
merge_group:
types: [checks_requested]

jobs:
linux-ci:
name: Linux
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- nightly
- beta
- stable
- 1.63.0
features:
-
- --features dummy_match_byte
include:
- toolchain: nightly
features: --features bench
- toolchain: nightly
features: --features bench,dummy_match_byte
steps:
- uses: actions/checkout@v2

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
override: true
components: rustfmt, clippy, ${{ matrix.toolchain == 'nightly' && 'miri,rust-src' || '' }}

- name: Cargo format & lint
run: cargo fmt --check && cargo clippy -- -Dwarnings

- name: Cargo build
run: cargo build ${{ matrix.features }}

- name: Cargo doc
run: cargo doc ${{ matrix.features }}

- name: Cargo test
run: cargo test ${{ matrix.features }}

- name: macros build
run: cargo build
working-directory: macros

- name: Color build
run: cargo build
working-directory: color

- name: Color test
run: cargo test
working-directory: color

- name: Cargo miri test
if: "matrix.toolchain == 'nightly'"
run: cargo miri test --features skip_long_tests ${{ matrix.features }}

build_result:
name: Result
runs-on: ubuntu-latest
needs:
- "linux-ci"

steps:
- name: Mark the job as successful
run: exit 0
if: success()
- name: Mark the job as unsuccessful
run: exit 1
if: "!success()"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
target
/Cargo.lock
/.cargo/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.

[package]
edition = "2018"
rust-version = "1.63"
name = "cssparser"
version = "0.34.0"
authors = ["Simon Sapin <simon.sapin@exyr.org>"]
exclude = [
"src/css-parsing-tests/**",
"src/big-data-url.css",
]
description = "Rust implementation of CSS Syntax Level 3"
documentation = "https://docs.rs/cssparser/"
readme = "README.md"
keywords = [
"css",
"syntax",
"parser",
]
license = "MPL-2.0"
repository = "https://github.com/servo/rust-cssparser"

[profile.profiling]
debug = 2
inherits = "release"

[dependencies.cssparser-macros]
version = "0.6.1"

[dependencies.dtoa-short]
version = "0.3"

[dependencies.itoa]
version = "1.0"

[dependencies.phf]
version = "0.11.2"
features = ["macros"]

[dependencies.serde]
version = "1.0"
features = ["derive"]
optional = true

[dependencies.smallvec]
version = "1.0"

[dev-dependencies.difference]
version = "2.0"

[dev-dependencies.encoding_rs]
version = "0.8"

[dev-dependencies.serde_json]
version = "1.0.25"

[features]
bench = []
dummy_match_byte = []
skip_long_tests = []
Loading

0 comments on commit 116c4ad

Please sign in to comment.