]> git.lizzy.rs Git - rust.git/blob - src/tools/tidy/src/deps.rs
Rollup merge of #106499 - lyming2007:issue-105946-fix, r=estebank
[rust.git] / src / tools / tidy / src / deps.rs
1 //! Checks the licenses of third-party dependencies.
2
3 use cargo_metadata::{Metadata, Package, PackageId, Resolve};
4 use std::collections::{BTreeSet, HashSet};
5 use std::path::Path;
6
7 /// These are licenses that are allowed for all crates, including the runtime,
8 /// rustc, tools, etc.
9 const LICENSES: &[&str] = &[
10     "MIT/Apache-2.0",
11     "MIT / Apache-2.0",
12     "Apache-2.0/MIT",
13     "Apache-2.0 / MIT",
14     "MIT OR Apache-2.0",
15     "Apache-2.0 OR MIT",
16     "Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT", // wasi license
17     "MIT",
18     "ISC",
19     "Unlicense/MIT",
20     "Unlicense OR MIT",
21     "0BSD OR MIT OR Apache-2.0",                // adler license
22     "Zlib OR Apache-2.0 OR MIT",                // tinyvec
23     "MIT OR Apache-2.0 OR Zlib",                // tinyvec_macros
24     "MIT OR Zlib OR Apache-2.0",                // miniz_oxide
25     "(MIT OR Apache-2.0) AND Unicode-DFS-2016", // unicode_ident
26     "Unicode-DFS-2016",                         // tinystr and icu4x
27 ];
28
29 /// These are exceptions to Rust's permissive licensing policy, and
30 /// should be considered bugs. Exceptions are only allowed in Rust
31 /// tooling. It is _crucial_ that no exception crates be dependencies
32 /// of the Rust runtime (std/test).
33 const EXCEPTIONS: &[(&str, &str)] = &[
34     ("ar_archive_writer", "Apache-2.0 WITH LLVM-exception"), // rustc
35     ("mdbook", "MPL-2.0"),                                   // mdbook
36     ("openssl", "Apache-2.0"),                               // cargo, mdbook
37     ("colored", "MPL-2.0"),                                  // rustfmt
38     ("ryu", "Apache-2.0 OR BSL-1.0"),                        // cargo/... (because of serde)
39     ("bytesize", "Apache-2.0"),                              // cargo
40     ("im-rc", "MPL-2.0+"),                                   // cargo
41     ("sized-chunks", "MPL-2.0+"),                            // cargo via im-rc
42     ("bitmaps", "MPL-2.0+"),                                 // cargo via im-rc
43     ("fiat-crypto", "MIT OR Apache-2.0 OR BSD-1-Clause"),    // cargo via pasetors
44     ("subtle", "BSD-3-Clause"),                              // cargo via pasetors
45     ("instant", "BSD-3-Clause"), // rustc_driver/tracing-subscriber/parking_lot
46     ("snap", "BSD-3-Clause"),    // rustc
47     ("fluent-langneg", "Apache-2.0"), // rustc (fluent translations)
48     ("self_cell", "Apache-2.0"), // rustc (fluent translations)
49     // FIXME: this dependency violates the documentation comment above:
50     ("fortanix-sgx-abi", "MPL-2.0"), // libstd but only for `sgx` target
51     ("dunce", "CC0-1.0"),            // cargo (dev dependency)
52     ("similar", "Apache-2.0"),       // cargo (dev dependency)
53     ("normalize-line-endings", "Apache-2.0"), // cargo (dev dependency)
54     ("dissimilar", "Apache-2.0"),    // rustdoc, rustc_lexer (few tests) via expect-test, (dev deps)
55 ];
56
57 const EXCEPTIONS_CRANELIFT: &[(&str, &str)] = &[
58     ("cranelift-bforest", "Apache-2.0 WITH LLVM-exception"),
59     ("cranelift-codegen", "Apache-2.0 WITH LLVM-exception"),
60     ("cranelift-codegen-meta", "Apache-2.0 WITH LLVM-exception"),
61     ("cranelift-codegen-shared", "Apache-2.0 WITH LLVM-exception"),
62     ("cranelift-egraph", "Apache-2.0 WITH LLVM-exception"),
63     ("cranelift-entity", "Apache-2.0 WITH LLVM-exception"),
64     ("cranelift-frontend", "Apache-2.0 WITH LLVM-exception"),
65     ("cranelift-isle", "Apache-2.0 WITH LLVM-exception"),
66     ("cranelift-jit", "Apache-2.0 WITH LLVM-exception"),
67     ("cranelift-module", "Apache-2.0 WITH LLVM-exception"),
68     ("cranelift-native", "Apache-2.0 WITH LLVM-exception"),
69     ("cranelift-object", "Apache-2.0 WITH LLVM-exception"),
70     ("mach", "BSD-2-Clause"),
71     ("regalloc2", "Apache-2.0 WITH LLVM-exception"),
72     ("target-lexicon", "Apache-2.0 WITH LLVM-exception"),
73     ("wasmtime-jit-icache-coherence", "Apache-2.0 WITH LLVM-exception"),
74 ];
75
76 const EXCEPTIONS_BOOTSTRAP: &[(&str, &str)] = &[
77     ("ryu", "Apache-2.0 OR BSL-1.0"), // through serde
78 ];
79
80 /// These are the root crates that are part of the runtime. The licenses for
81 /// these and all their dependencies *must not* be in the exception list.
82 const RUNTIME_CRATES: &[&str] = &["std", "core", "alloc", "test", "panic_abort", "panic_unwind"];
83
84 /// Crates rustc is allowed to depend on. Avoid adding to the list if possible.
85 ///
86 /// This list is here to provide a speed-bump to adding a new dependency to
87 /// rustc. Please check with the compiler team before adding an entry.
88 const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[
89     "addr2line",
90     "adler",
91     "ahash",
92     "aho-corasick",
93     "annotate-snippets",
94     "ansi_term",
95     "ar_archive_writer",
96     "arrayvec",
97     "atty",
98     "autocfg",
99     "bitflags",
100     "block-buffer",
101     "bumpalo", // Included in Cargo's dep graph but only activated on wasm32-*-unknown.
102     "cc",
103     "cfg-if",
104     "chalk-derive",
105     "chalk-engine",
106     "chalk-ir",
107     "chalk-solve",
108     "chrono",
109     "convert_case", // dependency of derive_more
110     "compiler_builtins",
111     "cpufeatures",
112     "crc32fast",
113     "crossbeam-channel",
114     "crossbeam-deque",
115     "crossbeam-epoch",
116     "crossbeam-utils",
117     "crypto-common",
118     "cstr",
119     "datafrog",
120     "derive_more",
121     "digest",
122     "displaydoc",
123     "dissimilar",
124     "dlmalloc",
125     "either",
126     "ena",
127     "env_logger",
128     "expect-test",
129     "fallible-iterator", // dependency of `thorin`
130     "fastrand",
131     "filetime",
132     "fixedbitset",
133     "flate2",
134     "fluent-bundle",
135     "fluent-langneg",
136     "fluent-syntax",
137     "fortanix-sgx-abi",
138     "generic-array",
139     "getopts",
140     "getrandom",
141     "gimli",
142     "gsgdt",
143     "hashbrown",
144     "hermit-abi",
145     "humantime",
146     "icu_list",
147     "icu_locid",
148     "icu_provider",
149     "icu_provider_adapters",
150     "icu_provider_macros",
151     "if_chain",
152     "indexmap",
153     "instant",
154     "intl-memoizer",
155     "intl_pluralrules",
156     "itertools",
157     "itoa",
158     "jobserver",
159     "js-sys", // Included in Cargo's dep graph but only activated on wasm32-*-unknown.
160     "lazy_static",
161     "libc",
162     "libloading",
163     "libz-sys",
164     "litemap",
165     "lock_api",
166     "log",
167     "matchers",
168     "md-5",
169     "measureme",
170     "memchr",
171     "memmap2",
172     "memoffset",
173     "miniz_oxide",
174     "num-integer",
175     "num-traits",
176     "num_cpus",
177     "object",
178     "odht",
179     "once_cell",
180     "parking_lot",
181     "parking_lot_core",
182     "pathdiff",
183     "perf-event-open-sys",
184     "petgraph",
185     "pin-project-lite",
186     "pkg-config",
187     "polonius-engine",
188     "ppv-lite86",
189     "proc-macro-hack",
190     "proc-macro2",
191     "psm",
192     "punycode",
193     "quick-error",
194     "quote",
195     "rand",
196     "rand_chacha",
197     "rand_core",
198     "rand_hc",
199     "rand_xorshift",
200     "rand_xoshiro",
201     "redox_syscall",
202     "regex",
203     "regex-automata",
204     "regex-syntax",
205     "remove_dir_all",
206     "rls-data",
207     "rls-span",
208     "rustc-demangle",
209     "rustc-hash",
210     "rustc-rayon",
211     "rustc-rayon-core",
212     "rustc_version",
213     "ryu",
214     "scoped-tls",
215     "scopeguard",
216     "self_cell",
217     "semver",
218     "serde",
219     "serde_derive",
220     "serde_json",
221     "sha-1",
222     "sha2",
223     "sharded-slab",
224     "smallvec",
225     "snap",
226     "stable_deref_trait",
227     "stacker",
228     "static_assertions",
229     "subtle", // dependency of cargo (via pasetors)
230     "syn",
231     "synstructure",
232     "tempfile",
233     "termcolor",
234     "termize",
235     "thiserror",
236     "thiserror-impl",
237     "thorin-dwp",
238     "thread_local",
239     "time",
240     "tinystr",
241     "tinyvec",
242     "tinyvec_macros",
243     "thin-vec",
244     "tracing",
245     "tracing-attributes",
246     "tracing-core",
247     "tracing-log",
248     "tracing-subscriber",
249     "tracing-tree",
250     "twox-hash",
251     "type-map",
252     "typenum",
253     "unic-char-property",
254     "unic-char-range",
255     "unic-common",
256     "unic-emoji-char",
257     "unic-langid",
258     "unic-langid-impl",
259     "unic-langid-macros",
260     "unic-langid-macros-impl",
261     "unic-ucd-version",
262     "unicode-ident",
263     "unicode-normalization",
264     "unicode-script",
265     "unicode-security",
266     "unicode-width",
267     "unicode-xid",
268     "vcpkg",
269     "valuable",
270     "version_check",
271     "wasi",
272     // vvv Included in Cargo's dep graph but only activated on wasm32-*-unknown.
273     "wasm-bindgen",
274     "wasm-bindgen-backend",
275     "wasm-bindgen-macro",
276     "wasm-bindgen-macro-support",
277     "wasm-bindgen-shared",
278     // ^^^ Included in Cargo's dep graph but only activated on wasm32-*-unknown.
279     "winapi",
280     "winapi-i686-pc-windows-gnu",
281     "winapi-util",
282     "winapi-x86_64-pc-windows-gnu",
283     "writeable",
284     // this is a false-positive: it's only used by rustfmt, but because it's enabled through a
285     // feature, tidy thinks it's used by rustc as well.
286     "yansi-term",
287     "yoke",
288     "yoke-derive",
289     "zerofrom",
290     "zerofrom-derive",
291     "zerovec",
292     "zerovec-derive",
293 ];
294
295 const PERMITTED_CRANELIFT_DEPENDENCIES: &[&str] = &[
296     "ahash",
297     "anyhow",
298     "arrayvec",
299     "autocfg",
300     "bumpalo",
301     "bitflags",
302     "byteorder",
303     "cfg-if",
304     "cranelift-bforest",
305     "cranelift-codegen",
306     "cranelift-codegen-meta",
307     "cranelift-codegen-shared",
308     "cranelift-egraph",
309     "cranelift-entity",
310     "cranelift-frontend",
311     "cranelift-isle",
312     "cranelift-jit",
313     "cranelift-module",
314     "cranelift-native",
315     "cranelift-object",
316     "crc32fast",
317     "fallible-iterator",
318     "fxhash",
319     "getrandom",
320     "gimli",
321     "hashbrown",
322     "indexmap",
323     "libc",
324     "libloading",
325     "log",
326     "mach",
327     "memchr",
328     "object",
329     "once_cell",
330     "regalloc2",
331     "region",
332     "slice-group-by",
333     "smallvec",
334     "stable_deref_trait",
335     "target-lexicon",
336     "version_check",
337     "wasi",
338     "wasmtime-jit-icache-coherence",
339     "winapi",
340     "winapi-i686-pc-windows-gnu",
341     "winapi-x86_64-pc-windows-gnu",
342     "windows-sys",
343     "windows_aarch64_msvc",
344     "windows_i686_gnu",
345     "windows_i686_msvc",
346     "windows_x86_64_gnu",
347     "windows_x86_64_msvc",
348 ];
349
350 const FORBIDDEN_TO_HAVE_DUPLICATES: &[&str] = &[
351     // This crate takes quite a long time to build, so don't allow two versions of them
352     // to accidentally sneak into our dependency graph, in order to ensure we keep our CI times
353     // under control.
354     "cargo",
355 ];
356
357 /// Dependency checks.
358 ///
359 /// `root` is path to the directory with the root `Cargo.toml` (for the workspace). `cargo` is path
360 /// to the cargo executable.
361 pub fn check(root: &Path, cargo: &Path, bad: &mut bool) {
362     let mut cmd = cargo_metadata::MetadataCommand::new();
363     cmd.cargo_path(cargo)
364         .manifest_path(root.join("Cargo.toml"))
365         .features(cargo_metadata::CargoOpt::AllFeatures);
366     let metadata = t!(cmd.exec());
367     let runtime_ids = compute_runtime_crates(&metadata);
368     check_license_exceptions(&metadata, EXCEPTIONS, runtime_ids, bad);
369     check_permitted_dependencies(
370         &metadata,
371         "rustc",
372         PERMITTED_RUSTC_DEPENDENCIES,
373         &["rustc_driver", "rustc_codegen_llvm"],
374         bad,
375     );
376     check_crate_duplicate(&metadata, FORBIDDEN_TO_HAVE_DUPLICATES, bad);
377     check_rustfix(&metadata, bad);
378
379     // Check rustc_codegen_cranelift independently as it has it's own workspace.
380     let mut cmd = cargo_metadata::MetadataCommand::new();
381     cmd.cargo_path(cargo)
382         .manifest_path(root.join("compiler/rustc_codegen_cranelift/Cargo.toml"))
383         .features(cargo_metadata::CargoOpt::AllFeatures);
384     let metadata = t!(cmd.exec());
385     let runtime_ids = HashSet::new();
386     check_license_exceptions(&metadata, EXCEPTIONS_CRANELIFT, runtime_ids, bad);
387     check_permitted_dependencies(
388         &metadata,
389         "cranelift",
390         PERMITTED_CRANELIFT_DEPENDENCIES,
391         &["rustc_codegen_cranelift"],
392         bad,
393     );
394     check_crate_duplicate(&metadata, &[], bad);
395
396     let mut cmd = cargo_metadata::MetadataCommand::new();
397     cmd.cargo_path(cargo)
398         .manifest_path(root.join("src/bootstrap/Cargo.toml"))
399         .features(cargo_metadata::CargoOpt::AllFeatures);
400     let metadata = t!(cmd.exec());
401     let runtime_ids = HashSet::new();
402     check_license_exceptions(&metadata, EXCEPTIONS_BOOTSTRAP, runtime_ids, bad);
403 }
404
405 /// Check that all licenses are in the valid list in `LICENSES`.
406 ///
407 /// Packages listed in `exceptions` are allowed for tools.
408 fn check_license_exceptions(
409     metadata: &Metadata,
410     exceptions: &[(&str, &str)],
411     runtime_ids: HashSet<&PackageId>,
412     bad: &mut bool,
413 ) {
414     // Validate the EXCEPTIONS list hasn't changed.
415     for (name, license) in exceptions {
416         // Check that the package actually exists.
417         if !metadata.packages.iter().any(|p| p.name == *name) {
418             tidy_error!(
419                 bad,
420                 "could not find exception package `{}`\n\
421                 Remove from EXCEPTIONS list if it is no longer used.",
422                 name
423             );
424         }
425         // Check that the license hasn't changed.
426         for pkg in metadata.packages.iter().filter(|p| p.name == *name) {
427             match &pkg.license {
428                 None => {
429                     tidy_error!(
430                         bad,
431                         "dependency exception `{}` does not declare a license expression",
432                         pkg.id
433                     );
434                 }
435                 Some(pkg_license) => {
436                     if pkg_license.as_str() != *license {
437                         println!("dependency exception `{name}` license has changed");
438                         println!("    previously `{license}` now `{pkg_license}`");
439                         println!("    update EXCEPTIONS for the new license");
440                         *bad = true;
441                     }
442                 }
443             }
444         }
445     }
446
447     let exception_names: Vec<_> = exceptions.iter().map(|(name, _license)| *name).collect();
448
449     // Check if any package does not have a valid license.
450     for pkg in &metadata.packages {
451         if pkg.source.is_none() {
452             // No need to check local packages.
453             continue;
454         }
455         if !runtime_ids.contains(&pkg.id) && exception_names.contains(&pkg.name.as_str()) {
456             continue;
457         }
458         let license = match &pkg.license {
459             Some(license) => license,
460             None => {
461                 tidy_error!(bad, "dependency `{}` does not define a license expression", pkg.id);
462                 continue;
463             }
464         };
465         if !LICENSES.contains(&license.as_str()) {
466             if pkg.name == "fortanix-sgx-abi" {
467                 // This is a specific exception because SGX is considered
468                 // "third party". See
469                 // https://github.com/rust-lang/rust/issues/62620 for more. In
470                 // general, these should never be added.
471                 continue;
472             }
473             tidy_error!(bad, "invalid license `{}` in `{}`", license, pkg.id);
474         }
475     }
476 }
477
478 /// Checks the dependency of `restricted_dependency_crates` at the given path. Changes `bad` to
479 /// `true` if a check failed.
480 ///
481 /// Specifically, this checks that the dependencies are on the `permitted_dependencies`.
482 fn check_permitted_dependencies(
483     metadata: &Metadata,
484     descr: &str,
485     permitted_dependencies: &[&'static str],
486     restricted_dependency_crates: &[&'static str],
487     bad: &mut bool,
488 ) {
489     // Check that the PERMITTED_DEPENDENCIES does not have unused entries.
490     for name in permitted_dependencies {
491         if !metadata.packages.iter().any(|p| p.name == *name) {
492             tidy_error!(
493                 bad,
494                 "could not find allowed package `{}`\n\
495                 Remove from PERMITTED_DEPENDENCIES list if it is no longer used.",
496                 name
497             );
498         }
499     }
500     // Get the list in a convenient form.
501     let permitted_dependencies: HashSet<_> = permitted_dependencies.iter().cloned().collect();
502
503     // Check dependencies.
504     let mut visited = BTreeSet::new();
505     let mut unapproved = BTreeSet::new();
506     for &krate in restricted_dependency_crates.iter() {
507         let pkg = pkg_from_name(metadata, krate);
508         let mut bad =
509             check_crate_dependencies(&permitted_dependencies, metadata, &mut visited, pkg);
510         unapproved.append(&mut bad);
511     }
512
513     if !unapproved.is_empty() {
514         tidy_error!(bad, "Dependencies for {} not explicitly permitted:", descr);
515         for dep in unapproved {
516             println!("* {dep}");
517         }
518     }
519 }
520
521 /// Checks the dependencies of the given crate from the given cargo metadata to see if they are on
522 /// the list of permitted dependencies. Returns a list of disallowed dependencies.
523 fn check_crate_dependencies<'a>(
524     permitted_dependencies: &'a HashSet<&'static str>,
525     metadata: &'a Metadata,
526     visited: &mut BTreeSet<&'a PackageId>,
527     krate: &'a Package,
528 ) -> BTreeSet<&'a PackageId> {
529     // This will contain bad deps.
530     let mut unapproved = BTreeSet::new();
531
532     // Check if we have already visited this crate.
533     if visited.contains(&krate.id) {
534         return unapproved;
535     }
536
537     visited.insert(&krate.id);
538
539     // If this path is in-tree, we don't require it to be explicitly permitted.
540     if krate.source.is_some() {
541         // If this dependency is not on `PERMITTED_DEPENDENCIES`, add to bad set.
542         if !permitted_dependencies.contains(krate.name.as_str()) {
543             unapproved.insert(&krate.id);
544         }
545     }
546
547     // Do a DFS in the crate graph.
548     let to_check = deps_of(metadata, &krate.id);
549
550     for dep in to_check {
551         let mut bad = check_crate_dependencies(permitted_dependencies, metadata, visited, dep);
552         unapproved.append(&mut bad);
553     }
554
555     unapproved
556 }
557
558 /// Prevents multiple versions of some expensive crates.
559 fn check_crate_duplicate(
560     metadata: &Metadata,
561     forbidden_to_have_duplicates: &[&str],
562     bad: &mut bool,
563 ) {
564     for &name in forbidden_to_have_duplicates {
565         let matches: Vec<_> = metadata.packages.iter().filter(|pkg| pkg.name == name).collect();
566         match matches.len() {
567             0 => {
568                 tidy_error!(
569                     bad,
570                     "crate `{}` is missing, update `check_crate_duplicate` \
571                     if it is no longer used",
572                     name
573                 );
574             }
575             1 => {}
576             _ => {
577                 tidy_error!(
578                     bad,
579                     "crate `{}` is duplicated in `Cargo.lock`, \
580                     it is too expensive to build multiple times, \
581                     so make sure only one version appears across all dependencies",
582                     name
583                 );
584                 for pkg in matches {
585                     println!("  * {}", pkg.id);
586                 }
587             }
588         }
589     }
590 }
591
592 /// Returns a list of dependencies for the given package.
593 fn deps_of<'a>(metadata: &'a Metadata, pkg_id: &'a PackageId) -> Vec<&'a Package> {
594     let resolve = metadata.resolve.as_ref().unwrap();
595     let node = resolve
596         .nodes
597         .iter()
598         .find(|n| &n.id == pkg_id)
599         .unwrap_or_else(|| panic!("could not find `{pkg_id}` in resolve"));
600     node.deps
601         .iter()
602         .map(|dep| {
603             metadata.packages.iter().find(|pkg| pkg.id == dep.pkg).unwrap_or_else(|| {
604                 panic!("could not find dep `{}` for pkg `{}` in resolve", dep.pkg, pkg_id)
605             })
606         })
607         .collect()
608 }
609
610 /// Finds a package with the given name.
611 fn pkg_from_name<'a>(metadata: &'a Metadata, name: &'static str) -> &'a Package {
612     let mut i = metadata.packages.iter().filter(|p| p.name == name);
613     let result =
614         i.next().unwrap_or_else(|| panic!("could not find package `{name}` in package list"));
615     assert!(i.next().is_none(), "more than one package found for `{name}`");
616     result
617 }
618
619 /// Finds all the packages that are in the rust runtime.
620 fn compute_runtime_crates<'a>(metadata: &'a Metadata) -> HashSet<&'a PackageId> {
621     let resolve = metadata.resolve.as_ref().unwrap();
622     let mut result = HashSet::new();
623     for name in RUNTIME_CRATES {
624         let id = &pkg_from_name(metadata, name).id;
625         normal_deps_of_r(resolve, id, &mut result);
626     }
627     result
628 }
629
630 /// Recursively find all normal dependencies.
631 fn normal_deps_of_r<'a>(
632     resolve: &'a Resolve,
633     pkg_id: &'a PackageId,
634     result: &mut HashSet<&'a PackageId>,
635 ) {
636     if !result.insert(pkg_id) {
637         return;
638     }
639     let node = resolve
640         .nodes
641         .iter()
642         .find(|n| &n.id == pkg_id)
643         .unwrap_or_else(|| panic!("could not find `{pkg_id}` in resolve"));
644     for dep in &node.deps {
645         normal_deps_of_r(resolve, &dep.pkg, result);
646     }
647 }
648
649 fn check_rustfix(metadata: &Metadata, bad: &mut bool) {
650     let cargo = pkg_from_name(metadata, "cargo");
651     let compiletest = pkg_from_name(metadata, "compiletest");
652     let cargo_deps = deps_of(metadata, &cargo.id);
653     let compiletest_deps = deps_of(metadata, &compiletest.id);
654     let cargo_rustfix = cargo_deps.iter().find(|p| p.name == "rustfix").unwrap();
655     let compiletest_rustfix = compiletest_deps.iter().find(|p| p.name == "rustfix").unwrap();
656     if cargo_rustfix.version != compiletest_rustfix.version {
657         tidy_error!(
658             bad,
659             "cargo's rustfix version {} does not match compiletest's rustfix version {}\n\
660              rustfix should be kept in sync, update the cargo side first, and then update \
661              compiletest along with cargo.",
662             cargo_rustfix.version,
663             compiletest_rustfix.version
664         );
665     }
666 }