This is an automated email from the ASF dual-hosted git repository.

HyukjinKwon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark-connect-rust.git


The following commit(s) were added to refs/heads/master by this push:
     new 1d37031a [SPARK-61618][FOLLOWUP][CONNECT][BUILD] List only the crates 
that the wheels link, and reproduce the notices of the files that ring, 
zstd-sys, rustls-webpki and libm compile, in LICENSE-binary
1d37031a is described below

commit 1d37031ac5e0fefe260adf313511492a234f000b
Author: Hyukjin Kwon <[email protected]>
AuthorDate: Fri Nov 13 18:23:58 2026 +0900

    [SPARK-61618][FOLLOWUP][CONNECT][BUILD] List only the crates that the 
wheels link, and reproduce the notices of the files that ring, zstd-sys, 
rustls-webpki and libm compile, in LICENSE-binary
    
    ### What changes were proposed in this pull request?
    
    A follow-up of #619 (SPARK-61618), from its post-merge review.
    
    - `scripts/gen_binary_licenses.py` now lists only the crates that the 
wheels link, not every crate in the workspace. The set is the union, over the 
five wheel targets of `release.yml` (x86_64 and aarch64 Linux and macOS, plus 
x86_64 Windows), of `cargo tree --locked -e normal,no-proc-macro -p pyspark-rs` 
with the pyo3 features that maturin builds with. That gives 141 components 
instead of 171. `cargo metadata` still supplies each crate's license and source 
directory.
    - The generator now reproduces the notices that some linked crates' source 
files carry under their own holders, which those crates' LICENSE files don't 
reproduce. They are listed in a `SUPPLEMENTARY_NOTICES` table, keyed by crate 
and version, that names the files and a marker for each notice. The generator 
copies each notice from its file at generation time, so `--check` fails when a 
crate changes it, and an entry for a crate that is no longer linked is an 
error. The entries:
      - `ring`: Google's ISC notice (`poly1305.c`, `aes_nohw.c`, `ecp_nistz.h`, 
and the chacha, gcm and poly1305 fallbacks), Intel's ISC notice, three other 
ISC holders, and its bundled once_cell MIT license.
      - `zstd-sys`: Yuta Mori's `divsufsort.c` (MIT) and Tino Reichardt's 
`threading.c` (BSD).
      - `rustls-webpki`: two ISC files.
      - `libm`: the SunPro and FreeBSD notices, and the `cbrt` MIT notice.
      - From a scan of the other linked crates: `lexical-parse-float` and 
`lexical-util` (SunPro), `futures-channel` (BSD-2), `pyo3` (MIT, `buffer.rs`) 
and `sha2-asm` (MIT assembly).
    
      Files compiled for no wheel target, such as the 32-bit ARM and x86 
sources, are left out.
    
    ### Why are the changes needed?
    
    `LICENSE-binary` listed 30 crates that no wheel links: the workspace's wasm 
examples enable features that the wheels don't. It also missed notices that 
ISC, MIT and BSD require to travel with copies. Comparing the file on master 
with this branch:
    
    - `grep -c "Google Inc" LICENSE-binary`: 0 before, 6 after.
    - `grep -c "Yuta Mori" LICENSE-binary`: 0 before, 1 after.
    - The components listed: 171 before, 141 after.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No code change. The wheels and the sdist carry a corrected `LICENSE-binary`.
    
    ### How was this patch tested?
    
    - `python3 -m unittest discover -s scripts/tests`: 77 tests pass. The new 
ones cover the target union, notice extraction and deduplication, the glob and 
plain-path rules, the stale-table error, and `--check` failing after a noticed 
file changes.
    - `python3 scripts/gen_binary_licenses.py --check` passes.
    - A maturin sdist and a host wheel (macOS arm64) carry the four license 
files byte-identical to the repository, with matching `License-File` entries. 
The other targets were checked at the `cargo tree` level.
    - `cargo fmt`, the stub audit, the Rust lib tests and ruff pass.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    Generated-by: Claude Opus 5.5
    
    This pull request and its description were written by Isaac.
    
    Closes #633 from HyukjinKwon/SPARK-61618-followup-notices.
    
    Authored-by: Hyukjin Kwon <[email protected]>
    Signed-off-by: Hyukjin Kwon <[email protected]>
---
 LICENSE-binary                            | 648 ++++++++++++++++++++++++------
 scripts/gen_binary_licenses.py            | 268 ++++++++++--
 scripts/tests/test_gen_binary_licenses.py | 234 +++++++++--
 3 files changed, 962 insertions(+), 188 deletions(-)

diff --git a/LICENSE-binary b/LICENSE-binary
index 97ea8295..fbda8603 100644
--- a/LICENSE-binary
+++ b/LICENSE-binary
@@ -206,7 +206,6 @@ License Version 2.0. Each is listed with its license 
expression. The components
 whose expression offers Apache-2.0 as an option are used under Apache-2.0.
 
 ahash 0.8.12 (MIT OR Apache-2.0)
-android_system_properties 0.1.5 (MIT/Apache-2.0)
 arrow 59.3.2 (Apache-2.0)
 arrow-arith 59.3.2 (Apache-2.0)
 arrow-buffer 59.3.2 (Apache-2.0)
@@ -220,14 +219,12 @@ arrow-schema 59.3.2 (Apache-2.0)
 arrow-select 59.3.2 (Apache-2.0)
 arrow-string 59.3.2 (Apache-2.0)
 atomic-waker 1.1.2 (Apache-2.0 OR MIT)
-base64 0.21.7 (MIT OR Apache-2.0)
 base64 0.22.1 (MIT OR Apache-2.0)
 base64 0.23.1 (MIT OR Apache-2.0)
 bitflags 2.13.0 (MIT OR Apache-2.0)
 block-buffer 0.10.4 (MIT OR Apache-2.0)
 cfg-if 1.0.4 (MIT OR Apache-2.0)
 chrono 0.4.45 (MIT OR Apache-2.0)
-const-random 0.1.18 (MIT OR Apache-2.0)
 core-foundation 0.10.1 (MIT OR Apache-2.0)
 core-foundation-sys 0.8.7 (MIT OR Apache-2.0)
 cpufeatures 0.2.17 (MIT OR Apache-2.0)
@@ -255,10 +252,8 @@ httparse 1.10.1 (MIT OR Apache-2.0)
 httpdate 1.0.3 (MIT OR Apache-2.0)
 hyper-timeout 0.5.2 (MIT OR Apache-2.0)
 iana-time-zone 0.1.65 (MIT OR Apache-2.0)
-iana-time-zone-haiku 0.1.2 (MIT OR Apache-2.0)
 indexmap 2.14.0 (Apache-2.0 OR MIT)
 itoa 1.0.18 (MIT OR Apache-2.0)
-js-sys 0.3.100 (MIT OR Apache-2.0)
 lexical-core 1.0.6 (MIT/Apache-2.0)
 lexical-parse-float 1.0.6 (MIT/Apache-2.0)
 lexical-parse-integer 1.0.6 (MIT/Apache-2.0)
@@ -277,14 +272,11 @@ openssl-probe 0.2.1 (MIT OR Apache-2.0)
 percent-encoding 2.3.2 (MIT OR Apache-2.0)
 pin-project 1.1.13 (Apache-2.0 OR MIT)
 pin-project-lite 0.2.17 (Apache-2.0 OR MIT)
-portable-atomic 1.13.1 (Apache-2.0 OR MIT)
 prost 0.14.4 (Apache-2.0)
 prost-types 0.14.4 (Apache-2.0)
 psm 0.1.31 (MIT OR Apache-2.0)
 pyo3 0.29.3 (MIT OR Apache-2.0)
 pyo3-ffi 0.29.3 (MIT OR Apache-2.0)
-r-efi 5.3.0 (MIT OR Apache-2.0 OR LGPL-2.1-or-later)
-r-efi 6.0.0 (MIT OR Apache-2.0 OR LGPL-2.1-or-later)
 regex 1.12.4 (MIT OR Apache-2.0)
 regex-automata 0.4.14 (MIT OR Apache-2.0)
 regex-syntax 0.8.11 (MIT OR Apache-2.0)
@@ -308,28 +300,8 @@ typenum 1.20.1 (MIT OR Apache-2.0)
 unicode-segmentation 1.13.3 (MIT OR Apache-2.0)
 unicode-width 0.2.2 (MIT OR Apache-2.0)
 uuid 1.23.3 (Apache-2.0 OR MIT)
-wasi 0.11.1+wasi-snapshot-preview1 (Apache-2.0 WITH LLVM-exception OR 
Apache-2.0 OR MIT)
-wasip2 1.0.3+wasi-0.2.9 (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT)
-wasip3 0.4.0+wasi-0.3.0-rc-2026-01-06 (Apache-2.0 WITH LLVM-exception OR 
Apache-2.0 OR MIT)
-wasm-bindgen 0.2.123 (MIT OR Apache-2.0)
-wasm-bindgen-shared 0.2.123 (MIT OR Apache-2.0)
-windows-core 0.62.2 (MIT OR Apache-2.0)
 windows-link 0.2.1 (MIT OR Apache-2.0)
-windows-result 0.4.1 (MIT OR Apache-2.0)
-windows-strings 0.5.1 (MIT OR Apache-2.0)
-windows-sys 0.52.0 (MIT OR Apache-2.0)
 windows-sys 0.61.2 (MIT OR Apache-2.0)
-windows-targets 0.52.6 (MIT OR Apache-2.0)
-windows_aarch64_gnullvm 0.52.6 (MIT OR Apache-2.0)
-windows_aarch64_msvc 0.52.6 (MIT OR Apache-2.0)
-windows_i686_gnu 0.52.6 (MIT OR Apache-2.0)
-windows_i686_gnullvm 0.52.6 (MIT OR Apache-2.0)
-windows_i686_msvc 0.52.6 (MIT OR Apache-2.0)
-windows_x86_64_gnu 0.52.6 (MIT OR Apache-2.0)
-windows_x86_64_gnullvm 0.52.6 (MIT OR Apache-2.0)
-windows_x86_64_msvc 0.52.6 (MIT OR Apache-2.0)
-wit-bindgen 0.51.0 (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT)
-wit-bindgen 0.57.1 (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT)
 zerocopy 0.8.52 (BSD-2-Clause OR Apache-2.0 OR MIT)
 zeroize 1.8.2 (Apache-2.0 OR MIT)
 zstd-safe 7.2.4 (MIT OR Apache-2.0)
@@ -339,10 +311,6 @@ This product bundles various third-party components under 
other open source
 licenses. This section summarizes those components and their licenses. Their
 license texts follow the summary.
 
-(MIT OR Apache-2.0) AND Unicode-3.0
------------------------------------
-unicode-ident 1.0.24
-
 Apache-2.0 AND ISC
 ------------------
 ring 0.17.14
@@ -371,7 +339,6 @@ axum 0.8.9
 axum-core 0.5.6
 bytes 1.11.1
 comfy-table 7.2.2
-crunchy 0.2.4
 generic-array 0.14.7
 h2 0.4.14
 http-body 1.0.1
@@ -640,31 +607,6 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 
OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 SOFTWARE.
 
-------------------------------------------------------------------------------------
-The license of crunchy 0.2.4 (MIT), from LICENSE:
-
-The MIT License (MIT)
-
-Copyright 2017-2023 Eira Fransham.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-
 
------------------------------------------------------------------------------------
 The license of generic-array 0.14.7 (MIT), from LICENSE:
 
@@ -1721,76 +1663,6 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 
OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 SOFTWARE.
 
-------------------------------------------------------------------------------------
-The license of unicode-ident 1.0.24 ((MIT OR Apache-2.0) AND Unicode-3.0), 
from LICENSE-MIT:
-
-Permission is hereby granted, free of charge, to any
-person obtaining a copy of this software and associated
-documentation files (the "Software"), to deal in the
-Software without restriction, including without
-limitation the rights to use, copy, modify, merge,
-publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software
-is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice
-shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
-ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
-TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
-SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
-
-------------------------------------------------------------------------------------
-The license of unicode-ident 1.0.24 ((MIT OR Apache-2.0) AND Unicode-3.0), 
from LICENSE-UNICODE:
-
-UNICODE LICENSE V3
-
-COPYRIGHT AND PERMISSION NOTICE
-
-Copyright © 1991-2023 Unicode, Inc.
-
-NOTICE TO USER: Carefully read the following legal agreement. BY
-DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR
-SOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
-TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT
-DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of data files and any associated documentation (the "Data Files") or
-software and any associated documentation (the "Software") to deal in the
-Data Files or Software without restriction, including without limitation
-the rights to use, copy, modify, merge, publish, distribute, and/or sell
-copies of the Data Files or Software, and to permit persons to whom the
-Data Files or Software are furnished to do so, provided that either (a)
-this copyright and permission notice appear with all copies of the Data
-Files or Software, or (b) this copyright and permission notice appear in
-associated Documentation.
-
-THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
-KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
-THIRD PARTY RIGHTS.
-
-IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE
-BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES,
-OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA
-FILES OR SOFTWARE.
-
-Except as contained in this notice, the name of a copyright holder shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in these Data Files or Software without prior written
-authorization of the copyright holder.
-
 
------------------------------------------------------------------------------------
 The license of untrusted 0.9.0 (ISC), from LICENSE.txt:
 
@@ -1970,3 +1842,523 @@ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
INTERRUPTION) HOWEVER CAUSED AND ON
 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+------------------------------------------------------------------------------------
+The notice in the source of futures-channel 0.3.32 (MIT OR Apache-2.0), in 
src/mpsc/queue.rs:
+
+/* Copyright (c) 2010-2011 Dmitry Vyukov. All rights reserved.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice,
+ *       this list of conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY DMITRY VYUKOV "AS IS" AND ANY EXPRESS OR 
IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 
EVENT
+ * SHALL DMITRY VYUKOV OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 
OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of Dmitry Vyukov.
+ */
+
+------------------------------------------------------------------------------------
+The notice in the source of lexical-parse-float 1.0.6 (MIT/Apache-2.0), in 
src/libm.rs:
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+------------------------------------------------------------------------------------
+The notice in the source of lexical-util 1.0.7 (MIT/Apache-2.0), in 
src/libm.rs:
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunSoft, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+------------------------------------------------------------------------------------
+The notice in the source of libm 0.2.16 (MIT), in src/math/acos.rs, 
src/math/asin.rs, src/math/atan2.rs, src/math/j0.rs,
+  src/math/j1.rs, src/math/jn.rs, src/math/k_cos.rs, src/math/k_sin.rs,
+  src/math/lgamma_r.rs, src/math/log.rs, src/math/log10.rs,
+  src/math/log2.rs, src/math/rem_pio2_large.rs:
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunSoft, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+------------------------------------------------------------------------------------
+The notice in the source of libm 0.2.16 (MIT), in src/math/acosf.rs, 
src/math/asinf.rs, src/math/atan.rs, src/math/atan2f.rs,
+  src/math/atanf.rs, src/math/cbrtf.rs, src/math/cos.rs, src/math/cosf.rs,
+  src/math/erf.rs, src/math/erff.rs, src/math/expf.rs, src/math/expm1.rs,
+  src/math/expm1f.rs, src/math/j0f.rs, src/math/j1f.rs, src/math/jnf.rs,
+  src/math/k_cosf.rs, src/math/k_sinf.rs, src/math/lgammaf_r.rs,
+  src/math/log10f.rs, src/math/log1p.rs, src/math/log1pf.rs,
+  src/math/log2f.rs, src/math/logf.rs, src/math/powf.rs,
+  src/math/rem_pio2f.rs, src/math/sin.rs, src/math/sincos.rs,
+  src/math/sincosf.rs, src/math/sinf.rs, src/math/tan.rs, src/math/tanf.rs:
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+------------------------------------------------------------------------------------
+The notice in the source of libm 0.2.16 (MIT), in src/math/cbrt.rs:
+
+/* origin: core-math/src/binary64/cbrt/cbrt.c
+ * Copyright (c) 2021-2022 Alexei Sibidanov.
+ * Ported to Rust in 2025 by Trevor Gross.
+ */
+
+------------------------------------------------------------------------------------
+The notice in the source of libm 0.2.16 (MIT), in src/math/exp.rs, 
src/math/pow.rs:
+
+/*
+ * ====================================================
+ * Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+------------------------------------------------------------------------------------
+The notice in the source of libm 0.2.16 (MIT), in src/math/exp2.rs, 
src/math/exp2f.rs:
+
+// origin: FreeBSD /usr/src/lib/msun/src/s_exp2.c */
+//-
+// Copyright (c) 2005 David Schultz <[email protected]>
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in the
+//    documentation and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE.
+
+------------------------------------------------------------------------------------
+The notice in the source of libm 0.2.16 (MIT), in src/math/k_tan.rs, 
src/math/k_tanf.rs:
+
+// origin: FreeBSD /usr/src/lib/msun/src/k_tan.c */
+//
+// ====================================================
+// Copyright 2004 Sun Microsystems, Inc.  All Rights Reserved.
+//
+// Permission to use, copy, modify, and distribute this
+// software is freely granted, provided that this notice
+// is preserved.
+// ====================================================
+
+------------------------------------------------------------------------------------
+The notice in the source of libm 0.2.16 (MIT), in src/math/rem_pio2.rs:
+
+// origin: FreeBSD /usr/src/lib/msun/src/e_rem_pio2.c
+//
+// ====================================================
+// Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+//
+// Developed at SunPro, a Sun Microsystems, Inc. business.
+// Permission to use, copy, modify, and distribute this
+// software is freely granted, provided that this notice
+// is preserved.
+// ====================================================
+//
+// Optimized by Bruce D. Evans. */
+
+------------------------------------------------------------------------------------
+The notice in the source of pyo3 0.29.3 (MIT OR Apache-2.0), in src/buffer.rs:
+
+// Copyright (c) 2017 Daniel Grunwald
+//
+// Permission is hereby granted, free of charge, to any person obtaining a 
copy of this
+// software and associated documentation files (the "Software"), to deal in 
the Software
+// without restriction, including without limitation the rights to use, copy, 
modify, merge,
+// publish, distribute, sublicense, and/or sell copies of the Software, and to 
permit persons
+// to whom the Software is furnished to do so, subject to the following 
conditions:
+//
+// The above copyright notice and this permission notice shall be included in 
all copies or
+// substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
IMPLIED,
+// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR 
A PARTICULAR
+// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
HOLDERS BE LIABLE
+// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 
CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 
USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+------------------------------------------------------------------------------------
+The notice in the source of ring 0.17.14 (Apache-2.0 AND ISC), in 
crypto/fipsmodule/aes/aes_nohw.c:
+
+/* Copyright (c) 2019, Google Inc.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
+
+------------------------------------------------------------------------------------
+The notice in the source of ring 0.17.14 (Apache-2.0 AND ISC), in 
crypto/fipsmodule/ec/ecp_nistz.c, crypto/fipsmodule/ec/ecp_nistz384.h,
+  crypto/fipsmodule/ec/ecp_nistz384.inl:
+
+/* Copyright (c) 2014, Intel Corporation.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
+
+------------------------------------------------------------------------------------
+The notice in the source of ring 0.17.14 (Apache-2.0 AND ISC), in 
crypto/fipsmodule/ec/ecp_nistz.h:
+
+/* Copyright (c) 2015, Google Inc.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
+
+------------------------------------------------------------------------------------
+The notice in the source of ring 0.17.14 (Apache-2.0 AND ISC), in 
crypto/poly1305/poly1305.c:
+
+/* Copyright (c) 2014, Google Inc.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
+
+------------------------------------------------------------------------------------
+The notice in the source of ring 0.17.14 (Apache-2.0 AND ISC), in 
src/aead/chacha.rs:
+
+// Copyright 2016 Brian Smith.
+// Portions Copyright (c) 2016, Google Inc.
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+// SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+// OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+// CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+------------------------------------------------------------------------------------
+The notice in the source of ring 0.17.14 (Apache-2.0 AND ISC), in 
src/aead/gcm/fallback.rs:
+
+// Copyright (c) 2019, Google Inc.
+// Portions Copyright 2020-2024 Brian Smith.
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+// SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+// OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+// CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+------------------------------------------------------------------------------------
+The notice in the source of ring 0.17.14 (Apache-2.0 AND ISC), in 
src/aead/poly1305/ffi_fallback.rs:
+
+// Copyright 2015-2025 Brian Smith.
+// Portions Copyright (c) 2014, 2015, Google Inc.
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+// SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+// OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+// CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+------------------------------------------------------------------------------------
+The notice in the source of ring 0.17.14 (Apache-2.0 AND ISC), in src/debug.rs:
+
+// Copyright 2018 Trent Clarke.
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+// SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+// OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+// CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+------------------------------------------------------------------------------------
+The notice in the source of ring 0.17.14 (Apache-2.0 AND ISC), in 
src/digest/sha1.rs:
+
+// Copyright 2015-2025 Brian Smith.
+// Copyright 2016 Simon Sapin.
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+// SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+// OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+// CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+------------------------------------------------------------------------------------
+The notice in the source of ring 0.17.14 (Apache-2.0 AND ISC), in src/limb.rs:
+
+// Copyright 2016 David Judd.
+// Copyright 2016 Brian Smith.
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+// SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+// OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+// CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+------------------------------------------------------------------------------------
+The notice in the source of ring 0.17.14 (Apache-2.0 AND ISC), in 
src/polyfill/once_cell/LICENSE-MIT:
+
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHOR OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
+------------------------------------------------------------------------------------
+The notice in the source of rustls-webpki 0.103.13 (ISC), in src/crl/mod.rs:
+
+// Copyright 2023 Daniel McCarney.
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES
+// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
+// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+------------------------------------------------------------------------------------
+The notice in the source of rustls-webpki 0.103.13 (ISC), in 
src/subject_name/mod.rs:
+
+// Copyright 2022 Rafael Fernández López.
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES
+// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
+// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+------------------------------------------------------------------------------------
+The notice in the source of sha2-asm 0.6.4 (MIT), in src/sha256_aarch64.S:
+
+/*
+ * SHA-256 hash in AArch64 assembly
+ *
+ * Copyright (c) 2020 Emmanuel Gil Peyrot <[email protected]>. (MIT 
License)
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a 
copy of
+ * this software and associated documentation files (the "Software"), to deal 
in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell 
copies of
+ * the Software, and to permit persons to whom the Software is furnished to do 
so,
+ * subject to the following conditions:
+ * - The above copyright notice and this permission notice shall be included in
+ *   all copies or substantial portions of the Software.
+ * - The Software is provided "as is", without warranty of any kind, express or
+ *   implied, including but not limited to the warranties of merchantability,
+ *   fitness for a particular purpose and noninfringement. In no event shall 
the
+ *   authors or copyright holders be liable for any claim, damages or other
+ *   liability, whether in an action of contract, tort or otherwise, arising 
from,
+ *   out of or in connection with the Software or the use or other dealings in 
the
+ *   Software.
+ */
+
+------------------------------------------------------------------------------------
+The notice in the source of zstd-sys 2.1.3+zstd.1.5.7 (BSD-3-Clause AND 
BSD-2-Clause), in zstd/lib/common/threading.c:
+
+/**
+ * Copyright (c) 2016 Tino Reichardt
+ * All rights reserved.
+ *
+ * You can contact the author at:
+ * - zstdmt source repository: https://github.com/mcmilk/zstdmt
+ *
+ * This source code is licensed under both the BSD-style license (found in the
+ * LICENSE file in the root directory of this source tree) and the GPLv2 (found
+ * in the COPYING file in the root directory of this source tree).
+ * You may select, at your option, one of the above-listed licenses.
+ */
+
+------------------------------------------------------------------------------------
+The notice in the source of zstd-sys 2.1.3+zstd.1.5.7 (BSD-3-Clause AND 
BSD-2-Clause), in zstd/lib/dictBuilder/divsufsort.c:
+
+/*
+ * divsufsort.c for libdivsufsort-lite
+ * Copyright (c) 2003-2008 Yuta Mori All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+------------------------------------------------------------------------------------
+The notice in the source of zstd-sys 2.1.3+zstd.1.5.7 (BSD-3-Clause AND 
BSD-2-Clause), in zstd/lib/legacy/zstd_v01.c, zstd/lib/legacy/zstd_v02.c,
+  zstd/lib/legacy/zstd_v03.c, zstd/lib/legacy/zstd_v04.c,
+  zstd/lib/legacy/zstd_v05.c, zstd/lib/legacy/zstd_v06.c,
+  zstd/lib/legacy/zstd_v07.c:
+
+/*
+ * Copyright (c) Yann Collet, Meta Platforms, Inc. and affiliates.
+ * All rights reserved.
+ *
+ * This source code is licensed under both the BSD-style license (found in the
+ * LICENSE file in the root directory of this source tree) and the GPLv2 (found
+ * in the COPYING file in the root directory of this source tree).
+ * You may select, at your option, one of the above-listed licenses.
+ */
diff --git a/scripts/gen_binary_licenses.py b/scripts/gen_binary_licenses.py
index e664853a..c93c3cf7 100644
--- a/scripts/gen_binary_licenses.py
+++ b/scripts/gen_binary_licenses.py
@@ -22,11 +22,17 @@ the normal dependencies of pyspark-rs. ASF policy asks a 
binary artifact to carr
 that lists every bundled third-party component with its license, the texts of 
the licenses
 that are not Apache's, and a NOTICE with the notices that Apache-2.0 
components require.
 
-The set is taken from `cargo metadata --locked`, so it follows Cargo.lock:
-
-- the normal (not dev, not build) edges from pyspark-rs, for every target 
platform;
-- not the workspace's own crates (they are Apache-2.0 and ASF's);
-- not the proc-macro crates, which run at compile time and are not linked into 
the wheel.
+The set is the union, over the targets of the wheel jobs, of `cargo tree` for 
pyspark-rs with
+the features that maturin builds it with. cargo tree resolves the features of 
pyspark-rs alone,
+so the crates that only the examples enable (wasm-udf) are not listed. It 
follows Cargo.lock
+(--locked), and it takes the normal (not dev, not build) edges, which excludes 
the proc-macro
+crates, whose dependencies are not linked either. The workspace's own crates 
are not listed:
+they are Apache-2.0 and ASF's. `cargo metadata` gives the license and the 
source directory of
+each crate.
+
+Some crates compile source files with their own notices (for example ring's 
ISC-licensed C and
+Rust files, or the SunPro notices of libm). Those notices are reproduced from 
the files, as
+listed in SUPPLEMENTARY_NOTICES.
 
 A component whose license expression offers Apache-2.0 as one option (`MIT OR 
Apache-2.0`,
 `Apache-2.0 OR BSL-1.0`, ...) is used under Apache-2.0 and is listed with the 
Apache-2.0
@@ -47,11 +53,13 @@ regenerating the files.
 """
 
 import argparse
+import glob
 import json
 import os
 import re
 import subprocess
 import sys
+import textwrap
 
 ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
 ROOT_PACKAGE = "pyspark-rs"
@@ -64,6 +72,84 @@ SEPARATOR = "-" * 84
 # is part of the tonic repository, which ships MIT's LICENSE with tonic 0.14.6.
 LICENSE_FALLBACK = {("tonic-prost", "0.14.6"): ("tonic", "0.14.6")}
 
+# The targets of the wheel jobs in .github/workflows/release.yml. 
universal2-apple-darwin is
+# built from its two architectures. The features are the ones that 
[tool.maturin] in
+# pyproject.toml builds pyspark-rs with.
+WHEEL_TARGETS = (
+    "x86_64-unknown-linux-gnu",
+    "aarch64-unknown-linux-gnu",
+    "x86_64-apple-darwin",
+    "aarch64-apple-darwin",
+    "x86_64-pc-windows-msvc",
+)
+WHEEL_FEATURES = ("pyo3/abi3-py39", "pyo3/extension-module")
+
+# Notices that the source files of a linked crate carry, which its LICENSE 
files do not
+# reproduce: (crate, version) -> [(path, marker)]. The path is relative to the 
crate's source
+# directory and may be a glob. The notice of a file is the comment block that 
holds a line
+# matching the marker regex, or the whole file when the marker is None (a 
license file). The
+# text is copied from the file at generation time, so --check fails when the 
crate changes.
+# A glob skips the files without a matching notice; a plain path must have 
one. A crate that
+# is not linked by the wheels is an error, so the table cannot go stale 
silently.
+#
+# Each entry is listed only if the wheels compile the file for one of their 
targets, checked
+# from build.rs and the cfg attributes of the crate; the other files are not 
listed. A notice
+# under a holder of the crate's own (its LICENSE already has it) is not listed 
either.
+SUPPLEMENTARY_NOTICES = {
+    # ring: the Google and Intel ISC files of BoringSSL, and the ISC files of 
ring's authors
+    # and contributors. crypto/poly1305/poly1305_arm.c and 
src/aead/poly1305/ffi_arm_neon.rs
+    # are for 32-bit ARM only, and src/aead/chacha/fallback.rs is for 32-bit 
x86 and tests only.
+    ("ring", "0.17.14"): [
+        ("crypto/poly1305/poly1305.c", "Google Inc"),
+        ("crypto/fipsmodule/aes/aes_nohw.c", "Google Inc"),
+        ("crypto/fipsmodule/ec/ecp_nistz.h", "Google Inc"),
+        ("crypto/fipsmodule/ec/ecp_nistz.c", "Intel Corporation"),
+        ("crypto/fipsmodule/ec/ecp_nistz384.h", "Intel Corporation"),
+        ("crypto/fipsmodule/ec/ecp_nistz384.inl", "Intel Corporation"),
+        ("src/aead/chacha.rs", "Google Inc"),
+        ("src/aead/gcm/fallback.rs", "Google Inc"),
+        ("src/aead/poly1305/ffi_fallback.rs", "Google Inc"),
+        ("src/debug.rs", "Trent Clarke"),
+        ("src/digest/sha1.rs", "Simon Sapin"),
+        ("src/limb.rs", "David Judd"),
+        ("src/polyfill/once_cell/LICENSE-MIT", None),
+    ],
+    # zstd-sys: divsufsort.c (Yuta Mori, MIT) is compiled by the zdict_builder 
feature, and the
+    # legacy decoders (zstd/lib/legacy, all of its .c files) by the legacy 
feature, both defaults.
+    # threading.c (Tino Reichardt) is compiled, but its code needs 
ZSTD_MULTITHREAD (the zstdmt
+    # feature), which the wheels do not enable.
+    ("zstd-sys", "2.1.3+zstd.1.5.7"): [
+        ("zstd/lib/dictBuilder/divsufsort.c", "Yuta Mori"),
+        ("zstd/lib/common/threading.c", "Tino Reichardt"),
+        ("zstd/lib/legacy/*.c", "Yann Collet"),
+    ],
+    # rustls-webpki: ISC files of the two authors. The crate's LICENSE is 
Brian Smith's.
+    ("rustls-webpki", "0.103.13"): [
+        ("src/subject_name/mod.rs", "Rafael Fern"),
+        ("src/crl/mod.rs", "Daniel McCarney"),
+    ],
+    # libm: the SunPro files (fdlibm), a FreeBSD BSD-2-Clause file, and a file 
of Alexei
+    # Sibidanov's (MIT). The crate's LICENSE.txt lists the holders but not the 
notices.
+    ("libm", "0.2.16"): [
+        ("src/**/*.rs", "Sun Microsystems"),
+        ("src/**/*.rs", "David Schultz"),
+        ("src/**/*.rs", "Alexei Sibidanov"),
+    ],
+    # lexical-parse-float and lexical-util: fdlibm code under the SunPro 
notice.
+    ("lexical-parse-float", "1.0.6"): [("src/libm.rs", "Sun Microsystems")],
+    ("lexical-util", "1.0.7"): [("src/libm.rs", "Sun Microsystems")],
+    # futures-channel: the BSD-2-Clause notice of Dmitry Vyukov's queue.
+    ("futures-channel", "0.3.32"): [("src/mpsc/queue.rs", "Dmitry Vyukov")],
+    # pyo3: the MIT notice of Daniel Grunwald's buffer protocol code 
(rust-cpython).
+    ("pyo3", "0.29.3"): [("src/buffer.rs", "Daniel Grunwald")],
+    # sha2-asm: the MIT notices of the assembly (Project Nayuki, Emmanuel Gil 
Peyrot). Only the
+    # aarch64 targets link sha2-asm, so only sha256_aarch64.S is compiled for 
the wheels. The
+    # x86 files are not, and sha256_aarch64_apple.S is in the public domain 
(no notice).
+    ("sha2-asm", "0.6.4"): [
+        ("src/sha256_aarch64.S", "Copyright"),
+    ],
+}
+
 LICENSE_FILE = re.compile(r"^(LICENSE|LICENCE|COPYING|UNLICENSE)", 
re.IGNORECASE)
 NOTICE_FILE = re.compile(r"^NOTICE", re.IGNORECASE)
 
@@ -80,6 +166,7 @@ class Component:
         self.mentions_apache = False
         self.license_files = []  # (file name, text) of the non-Apache license 
texts
         self.notice = None  # text of the NOTICE file, if it mentions 
Apache-2.0
+        self.source_notices = []  # (files, text) of SUPPLEMENTARY_NOTICES, 
copied from the files
 
     @property
     def coordinates(self):
@@ -171,30 +258,30 @@ def _is_proc_macro(package):
     return "proc-macro" in kinds and not kinds & {"lib", "rlib", "dylib", 
"cdylib", "staticlib"}
 
 
-def linked_packages(meta):
-    """The registry packages that pyspark-rs links, by normal edges, for all 
platforms."""
-    packages = {p["id"]: p for p in meta["packages"]}
-    nodes = {n["id"]: n for n in meta["resolve"]["nodes"]}
-    roots = [p["id"] for p in meta["packages"] if p["name"] == ROOT_PACKAGE 
and p["source"] is None]
-    if len(roots) != 1:
-        raise SystemExit(f"expected one {ROOT_PACKAGE} package in cargo 
metadata")
-    seen = set()
-    stack = [roots[0]]
-    while stack:
-        pkg_id = stack.pop()
-        if pkg_id in seen:
-            continue
-        seen.add(pkg_id)
-        if _is_proc_macro(packages[pkg_id]):
-            continue  # compile-time only: its dependencies are not linked 
either
-        for dep in nodes[pkg_id]["deps"]:
-            if any(kind["kind"] in (None, "normal") for kind in 
dep["dep_kinds"]):
-                stack.append(dep["pkg"])
-    return [
-        packages[i]
-        for i in seen
-        if packages[i]["source"] is not None and not 
_is_proc_macro(packages[i])
-    ]
+def wheel_packages(meta, tree_outputs):
+    """The registry packages that the wheels link, from the `cargo tree` 
output of each target.
+
+    Each output lists the normal, non-proc-macro dependencies of pyspark-rs 
for one target. A
+    crate is linked when any target lists it. Proc-macro crates are dropped 
even when a normal
+    edge reaches them.
+    """
+    registry = {(p["name"], p["version"]): p for p in meta["packages"] if 
p["source"] is not None}
+    linked = {}
+    for output in tree_outputs:
+        for raw in output.splitlines():
+            line = raw.strip()
+            if line.endswith(" (*)"):
+                line = line[: -len(" (*)")]
+            if not line or " (" in line:
+                continue  # blank, or a workspace path package such as 
"pyspark-rs v4.3.0 (/...)"
+            parts = line.split()
+            if len(parts) != 2 or not parts[1].startswith("v"):
+                raise SystemExit(f"unexpected cargo tree line: {raw!r}")
+            key = (parts[0], parts[1][1:])
+            if key not in registry:
+                raise SystemExit(f"{key[0]} {key[1]} is not a registry package 
in cargo metadata")
+            linked[key] = registry[key]
+    return [p for key, p in linked.items() if not _is_proc_macro(p)]
 
 
 def _read(path):
@@ -206,6 +293,82 @@ def _is_apache_text(text):
     return APACHE_TEXT_MARKER in text[:400]
 
 
+def _comment_blocks(lines):
+    """Yield (first, last) line indices of the comment blocks: each /* */ 
block, and each run of
+    // or perl-style # comment lines."""
+    i = 0
+    while i < len(lines):
+        s = lines[i].lstrip()
+        if s.startswith("/*"):
+            last, rest = i, lines[i].split("/*", 1)[1]
+            while "*/" not in rest and last + 1 < len(lines):
+                last += 1
+                rest = lines[last]
+            yield i, last
+            i = last + 1
+        elif _is_line_comment(s):
+            last = i
+            while last + 1 < len(lines) and _is_line_comment(lines[last + 
1].lstrip()):
+                last += 1
+            yield i, last
+            i = last + 1
+        else:
+            i += 1
+
+
+def _is_line_comment(stripped):
+    return stripped.startswith("//") or stripped == "#" or 
stripped.startswith("# ")
+
+
+def _notice_block(text, marker):
+    """The first comment block of the file that has a line matching `marker`, 
or None."""
+    lines = text.split("\n")
+    pattern = re.compile(marker)
+    for first, last in _comment_blocks(lines):
+        if any(pattern.search(line) for line in lines[first : last + 1]):
+            return "\n".join(lines[first : last + 1]).rstrip() + "\n"
+    return None
+
+
+def _notice_key(notice):
+    """The words of a notice without its comment markers and its `origin:` 
lines, so that one
+    notice in two comment styles, or in files of different origin, is one 
notice."""
+    words = []
+    for line in notice.split("\n"):
+        if "origin:" in line:
+            continue
+        line = re.sub(r"\*/\s*$", "", line)
+        line = re.sub(r"^\s*(/\*+|\*+|//+!?|#)", "", line)
+        words.extend(line.split())
+    return " ".join(words)
+
+
+def _source_notices(source_dir, coords, entries):
+    """Copy the notices of a crate's files for SUPPLEMENTARY_NOTICES.
+
+    Returns [(files, text)], one item per distinct notice, with the relative 
paths of its files
+    and the text of the first of them.
+    """
+    groups = {}  # _notice_key -> [text, [files]]
+    for path, marker in entries:
+        matches = sorted(glob.glob(os.path.join(source_dir, path), 
recursive=True))
+        if not matches:
+            raise SystemExit(f"{coords}: no file matches {path}")
+        for full in matches:
+            rel = os.path.relpath(full, source_dir).replace(os.sep, "/")
+            text = _read(full)
+            if marker is None:
+                notice = text.rstrip() + "\n"
+            else:
+                notice = _notice_block(text, marker)
+            if notice is None:
+                if any(c in path for c in "*?["):
+                    continue
+                raise SystemExit(f"{coords}: {rel} has no notice that matches 
{marker!r}")
+            groups.setdefault(_notice_key(notice), [notice, []])[1].append(rel)
+    return [(files, text) for text, files in sorted(groups.values(), 
key=lambda g: g[1][0])]
+
+
 def _find_package(meta, key):
     for p in meta["packages"]:
         if (p["name"], p["version"]) == key:
@@ -213,10 +376,17 @@ def _find_package(meta, key):
     raise SystemExit(f"fallback package {key} is not in cargo metadata")
 
 
-def collect_components(meta):
+def collect_components(meta, tree_outputs):
     """Build a Component for each linked registry package, sorted by name and 
version."""
+    packages = wheel_packages(meta, tree_outputs)
+    keys = {(p["name"], p["version"]) for p in packages}
+    unlinked = sorted(f"{n} {v}" for n, v in SUPPLEMENTARY_NOTICES if (n, v) 
not in keys)
+    if unlinked:
+        raise SystemExit(
+            "SUPPLEMENTARY_NOTICES names crates that the wheels do not link: " 
+ ", ".join(unlinked)
+        )
     components = []
-    for package in sorted(linked_packages(meta), key=lambda p: (p["name"], 
p["version"])):
+    for package in sorted(packages, key=lambda p: (p["name"], p["version"])):
         coords = f"{package['name']} {package['version']}"
         expr = package["license"]
         if not expr:
@@ -227,9 +397,13 @@ def collect_components(meta):
             package["name"], package["version"], expr, source_dir, 
permits_apache(node)
         )
         component.mentions_apache = mentions_apache(node)
+        key = (package["name"], package["version"])
+        if key in SUPPLEMENTARY_NOTICES:
+            component.source_notices = _source_notices(
+                source_dir, coords, SUPPLEMENTARY_NOTICES[key]
+            )
         if not component.elected:
             lic_dir = source_dir
-            key = (package["name"], package["version"])
             if key in LICENSE_FALLBACK:
                 other = _find_package(meta, LICENSE_FALLBACK[key])
                 lic_dir = os.path.dirname(other["manifest_path"])
@@ -306,6 +480,13 @@ def render_license(components, apache_text):
                 f"\n{SEPARATOR}\nThe license of {c.coordinates} ({c.license}), 
"
                 f"from {name}:\n\n{text.rstrip()}\n"
             )
+    for c in components:
+        for files, text in c.source_notices:
+            names = textwrap.fill(", ".join(files), width=76, 
subsequent_indent="  ")
+            out.append(
+                f"\n{SEPARATOR}\nThe notice in the source of {c.coordinates} 
({c.license}), "
+                f"in {names}:\n\n{text}"
+            )
     return "".join(out)
 
 
@@ -326,9 +507,9 @@ def render_notice(root_notice, components):
     return "".join(out)
 
 
-def build_outputs(meta, license_text, notice_text):
+def build_outputs(meta, license_text, notice_text, tree_outputs):
     """Return {relative path: text} of the two generated files."""
-    components = collect_components(meta)
+    components = collect_components(meta, tree_outputs)
     return {
         "LICENSE-binary": render_license(components, 
_apache_text(license_text)),
         "NOTICE-binary": render_notice(notice_text, components),
@@ -348,11 +529,30 @@ def cargo_metadata(root):
     return json.loads(result.stdout)
 
 
+def cargo_tree(root, target):
+    """The normal, non-proc-macro dependencies of pyspark-rs for one target, 
as `cargo tree`
+    prints them."""
+    args = ["cargo", "tree", "--locked", "-e", "normal,no-proc-macro", "-p", 
ROOT_PACKAGE]
+    args += ["--features", ",".join(WHEEL_FEATURES), "--target", target]
+    args += ["--prefix", "none", "--format", "{p}"]
+    result = subprocess.run(
+        args,
+        cwd=root,
+        capture_output=True,
+        check=False,
+    )
+    if result.returncode != 0:
+        sys.stderr.write(result.stderr.decode(errors="replace"))
+        raise SystemExit(f"cargo tree failed for {target}")
+    return result.stdout.decode(errors="replace")
+
+
 def generate(root):
     return build_outputs(
         cargo_metadata(root),
         _read(os.path.join(root, "LICENSE")),
         _read(os.path.join(root, "NOTICE")),
+        [cargo_tree(root, target) for target in WHEEL_TARGETS],
     )
 
 
diff --git a/scripts/tests/test_gen_binary_licenses.py 
b/scripts/tests/test_gen_binary_licenses.py
index c2cae64d..0531e92a 100644
--- a/scripts/tests/test_gen_binary_licenses.py
+++ b/scripts/tests/test_gen_binary_licenses.py
@@ -1,4 +1,5 @@
-"""Tests for scripts/gen_binary_licenses.py, on a synthetic `cargo metadata` 
document."""
+"""Tests for scripts/gen_binary_licenses.py, on a synthetic `cargo metadata` 
document and on
+synthetic `cargo tree` outputs, one per wheel target."""
 
 import importlib.util
 import os
@@ -6,6 +7,7 @@ import shutil
 import tempfile
 import unittest
 from pathlib import Path
+from unittest import mock
 
 SCRIPT = Path(__file__).resolve().parents[1] / "gen_binary_licenses.py"
 SPEC = importlib.util.spec_from_file_location("gen_binary_licenses", SCRIPT)
@@ -27,12 +29,25 @@ ROOT_LICENSE = (
 )
 ROOT_NOTICE = "Apache Spark Connect Rust Client\nCopyright 2023 and onwards\n"
 
+REGISTRY = "registry+https://github.com/rust-lang/crates.io-index";
+ROOT_TREE = "pyspark-rs v4.3.0 (/repo/crates/pyspark-rs)\n"
+# mymacro is a proc-macro that a normal edge reaches. devlib is a dev 
dependency, so no tree
+# lists it. extra is in cargo metadata only.
+TREE_LINUX = ROOT_TREE + "mitlib v1.0.0\nduallib v2.0.0 (*)\nmymacro v0.1.0\n"
+# winlib is linked for Windows only, and mitlib appears again under another 
edge.
+TREE_WINDOWS = ROOT_TREE + "mitlib v1.0.0 (*)\nwinlib v0.3.0\n"
+
 
 def _read(path):
     with open(path, encoding="utf-8") as f:
         return f.read()
 
 
+def _write(path, text):
+    with open(path, "w", encoding="utf-8") as f:
+        f.write(text)
+
+
 class ExpressionTests(unittest.TestCase):
     def test_apache_option_permits_apache(self):
         for expr, expected in [
@@ -59,6 +74,48 @@ class ExpressionTests(unittest.TestCase):
                 gen._parse_expr(expr)
 
 
+class NoticeBlockTests(unittest.TestCase):
+    def test_block_holding_the_marker_is_taken_not_the_origin_block(self):
+        text = (
+            "/* origin: example/s_sin.c */\n"
+            "/*\n"
+            " * ====================\n"
+            " * Copyright (C) 1993 by Sun Microsystems, Inc.\n"
+            " * ====================\n"
+            " */\n"
+            "\n"
+            "fn f() {}\n"
+        )
+        self.assertEqual(
+            gen._notice_block(text, "Sun Microsystems"),
+            "/*\n * ====================\n"
+            " * Copyright (C) 1993 by Sun Microsystems, Inc.\n"
+            " * ====================\n */\n",
+        )
+
+    def test_line_comment_run_ends_at_a_blank_line(self):
+        text = "// Copyright 2024 Example.\n// Permission is granted.\n\n// 
Not a notice.\n"
+        self.assertEqual(
+            gen._notice_block(text, "Example"),
+            "// Copyright 2024 Example.\n// Permission is granted.\n",
+        )
+
+    def test_perl_comments_and_missing_marker(self):
+        text = "#!/usr/bin/env perl\n# Copyright 2015 Example.\n# Permission 
is granted.\n"
+        self.assertEqual(
+            gen._notice_block(text, "Example"),
+            "# Copyright 2015 Example.\n# Permission is granted.\n",
+        )
+        self.assertIsNone(gen._notice_block(text, "Nobody"))
+
+    def test_comment_styles_of_one_notice_have_one_key(self):
+        c_style = "/*\n * Copyright (c) 2014 Example.\n * Permission is 
granted.\n */\n"
+        line_style = "// Copyright (c) 2014 Example.\n// Permission is 
granted.\n"
+        self.assertEqual(gen._notice_key(c_style), gen._notice_key(line_style))
+        other_year = c_style.replace("2014", "2015")
+        self.assertNotEqual(gen._notice_key(c_style), 
gen._notice_key(other_year))
+
+
 class OutputTests(unittest.TestCase):
     def setUp(self):
         self.tmp = tempfile.mkdtemp()
@@ -66,17 +123,21 @@ class OutputTests(unittest.TestCase):
         self.src = os.path.join(self.tmp, "registry")
         self.root = os.path.join(self.tmp, "repo")
         os.makedirs(self.root)
+        # The synthetic crates have no notices of their own; the tests that 
need some add them.
+        patcher = mock.patch.dict(gen.SUPPLEMENTARY_NOTICES, {}, clear=True)
+        patcher.start()
+        self.addCleanup(patcher.stop)
 
     def _crate(self, name, version, files):
         d = os.path.join(self.src, f"{name}-{version}")
-        os.makedirs(d)
+        os.makedirs(d, exist_ok=True)
         for fname, text in files.items():
-            with open(os.path.join(d, fname), "w", encoding="utf-8") as f:
-                f.write(text)
+            path = os.path.join(d, fname)
+            os.makedirs(os.path.dirname(path), exist_ok=True)
+            _write(path, text)
         return os.path.join(d, "Cargo.toml")
 
     def _metadata(self):
-        registry = "registry+https://github.com/rust-lang/crates.io-index";
         packages = [
             {
                 "id": "pyspark-rs",
@@ -91,7 +152,7 @@ class OutputTests(unittest.TestCase):
                 "id": "mitlib",
                 "name": "mitlib",
                 "version": "1.0.0",
-                "source": registry,
+                "source": REGISTRY,
                 "license": "MIT",
                 "targets": [{"kind": ["lib"]}],
                 "manifest_path": self._crate("mitlib", "1.0.0", {"LICENSE": 
MIT_TEXT}),
@@ -100,7 +161,7 @@ class OutputTests(unittest.TestCase):
                 "id": "duallib",
                 "name": "duallib",
                 "version": "2.0.0",
-                "source": registry,
+                "source": REGISTRY,
                 "license": "MIT OR Apache-2.0",
                 "targets": [{"kind": ["lib"]}],
                 "manifest_path": self._crate(
@@ -113,7 +174,7 @@ class OutputTests(unittest.TestCase):
                 "id": "mymacro",
                 "name": "mymacro",
                 "version": "0.1.0",
-                "source": registry,
+                "source": REGISTRY,
                 "license": "MIT",
                 "targets": [{"kind": ["proc-macro"]}],
                 "manifest_path": self._crate("mymacro", "0.1.0", {"LICENSE": 
MIT_TEXT}),
@@ -122,38 +183,48 @@ class OutputTests(unittest.TestCase):
                 "id": "devlib",
                 "name": "devlib",
                 "version": "0.1.0",
-                "source": registry,
+                "source": REGISTRY,
                 "license": "BSD-3-Clause",
                 "targets": [{"kind": ["lib"]}],
                 "manifest_path": self._crate("devlib", "0.1.0", {"LICENSE": 
"BSD"}),
             },
-        ]
-
-        def dep(pkg_id, kind=None):
-            return {"pkg": pkg_id, "dep_kinds": [{"kind": kind, "target": 
None}]}
-
-        nodes = [
             {
-                "id": "pyspark-rs",
-                "deps": [dep("mitlib"), dep("duallib"), dep("mymacro"), 
dep("devlib", "dev")],
+                "id": "extra",
+                "name": "extra",
+                "version": "0.2.0",
+                "source": REGISTRY,
+                "license": "MIT",
+                "targets": [{"kind": ["lib"]}],
+                "manifest_path": self._crate("extra", "0.2.0", {"LICENSE": 
MIT_TEXT}),
+            },
+            {
+                "id": "winlib",
+                "name": "winlib",
+                "version": "0.3.0",
+                "source": REGISTRY,
+                "license": "MIT",
+                "targets": [{"kind": ["lib"]}],
+                "manifest_path": self._crate("winlib", "0.3.0", {"LICENSE": 
MIT_TEXT}),
             },
-            {"id": "mitlib", "deps": []},
-            {"id": "duallib", "deps": []},
-            {"id": "mymacro", "deps": []},
-            {"id": "devlib", "deps": []},
         ]
-        return {"packages": packages, "resolve": {"nodes": nodes}}
+        return {"packages": packages}
+
+    def _trees(self):
+        return [TREE_LINUX, TREE_WINDOWS]
 
     def _outputs(self):
-        return gen.build_outputs(self._metadata(), ROOT_LICENSE, ROOT_NOTICE)
+        return gen.build_outputs(self._metadata(), ROOT_LICENSE, ROOT_NOTICE, 
self._trees())
 
-    def test_only_linked_non_proc_macro_crates_are_listed(self):
-        out = self._outputs()
-        license_text = out["LICENSE-binary"]
+    def test_union_of_the_wheel_targets_lists_linked_crates_only(self):
+        license_text = self._outputs()["LICENSE-binary"]
         self.assertIn("mitlib 1.0.0\n", license_text)
         self.assertIn("duallib 2.0.0 (MIT OR Apache-2.0)\n", license_text)
+        # Linked for Windows only, so it is listed once it is in any target's 
tree.
+        self.assertIn("winlib 0.3.0\n", license_text)
+        # A proc-macro, a dev dependency, and a crate that no target lists.
         self.assertNotIn("mymacro", license_text)
         self.assertNotIn("devlib", license_text)
+        self.assertNotIn("extra", license_text)
 
     def test_non_apache_components_carry_their_license_texts(self):
         license_text = self._outputs()["LICENSE-binary"]
@@ -171,6 +242,14 @@ class OutputTests(unittest.TestCase):
         self.assertIn(DUAL_NOTICE, notice)
         self.assertNotIn("mitlib", notice)
 
+    def test_tree_line_that_is_not_a_package_is_rejected(self):
+        with self.assertRaises(SystemExit):
+            gen.wheel_packages(self._metadata(), ["this is not a tree line\n"])
+
+    def test_tree_line_for_an_unknown_package_is_rejected(self):
+        with self.assertRaises(SystemExit):
+            gen.wheel_packages(self._metadata(), [ROOT_TREE + "nosuch 
v1.0.0\n"])
+
     def test_check_passes_on_written_files_and_fails_after_an_edit(self):
         outputs = self._outputs()
         gen.write(self.root, outputs)
@@ -195,5 +274,108 @@ class OutputTests(unittest.TestCase):
         self.assertEqual(gen.check(self.root, outputs), ["NOTICE-binary"])
 
 
+class SupplementaryNoticeTests(OutputTests):
+    """SUPPLEMENTARY_NOTICES copies the notices of a crate's files into 
LICENSE-binary."""
+
+    C_NOTICE = (
+        "/* origin: example/notice.c\n"
+        " * Copyright (c) 2020 Example Corp.\n"
+        " * Permission is hereby granted, free of charge.\n"
+        " */\n"
+        "\n"
+        "int notice(void);\n"
+    )
+    C_NOTICE_BLOCK = (
+        "/* origin: example/notice.c\n"
+        " * Copyright (c) 2020 Example Corp.\n"
+        " * Permission is hereby granted, free of charge.\n"
+        " */\n"
+    )
+    RS_NOTICE = (
+        "// origin: example/other.c\n"
+        "// Copyright (c) 2020 Example Corp.\n"
+        "// Permission is hereby granted, free of charge.\n"
+        "\n"
+        "fn other() {}\n"
+    )
+
+    def _with_files(self):
+        self._crate(
+            "mitlib",
+            "1.0.0",
+            {
+                "LICENSE": MIT_TEXT,
+                "src/notice.c": self.C_NOTICE,
+                "src/other.rs": self.RS_NOTICE,
+                "src/plain.rs": "fn plain() {}\n",
+            },
+        )
+
+    def _outputs_with(self, entries):
+        table = {("mitlib", "1.0.0"): entries}
+        with mock.patch.dict(gen.SUPPLEMENTARY_NOTICES, table, clear=True):
+            return self._outputs()
+
+    def test_notice_is_copied_verbatim_under_its_crate(self):
+        self._with_files()
+        text = self._outputs_with([("src/notice.c", "Example 
Corp")])["LICENSE-binary"]
+        self.assertIn(
+            "The notice in the source of mitlib 1.0.0 (MIT), in 
src/notice.c:\n\n"
+            + self.C_NOTICE_BLOCK,
+            text,
+        )
+
+    def test_one_notice_in_two_comment_styles_is_listed_once(self):
+        self._with_files()
+        text = self._outputs_with([("src/notice.c", "Example Corp"), 
("src/other.rs", "Example")])[
+            "LICENSE-binary"
+        ]
+        self.assertEqual(text.count("The notice in the source of mitlib"), 1)
+        self.assertIn("in src/notice.c, src/other.rs:", text)
+
+    def test_glob_skips_files_without_the_marker(self):
+        self._with_files()
+        text = self._outputs_with([("src/*.rs", "Example 
Corp")])["LICENSE-binary"]
+        self.assertIn("in src/other.rs:", text)
+        self.assertNotIn("plain", text)
+
+    def test_plain_path_without_the_marker_is_an_error(self):
+        self._with_files()
+        with self.assertRaises(SystemExit):
+            self._outputs_with([("src/plain.rs", "Example Corp")])
+
+    def test_glob_without_a_match_is_an_error(self):
+        self._with_files()
+        with self.assertRaises(SystemExit):
+            self._outputs_with([("src/*.zig", "Example Corp")])
+
+    def test_whole_file_is_the_notice_without_a_marker(self):
+        self._with_files()
+        text = self._outputs_with([("src/plain.rs", None)])["LICENSE-binary"]
+        self.assertIn("in src/plain.rs:\n\nfn plain() {}\n", text)
+
+    def test_entry_for_a_crate_that_is_not_linked_is_an_error(self):
+        self._with_files()
+        table = {("nosuch", "9.9.9"): [("src/notice.c", None)]}
+        with mock.patch.dict(gen.SUPPLEMENTARY_NOTICES, table, clear=True):
+            with self.assertRaises(SystemExit):
+                self._outputs()
+
+    def test_check_fails_when_a_noticed_file_changes(self):
+        self._with_files()
+        entries = [("src/notice.c", "Example Corp")]
+        outputs = self._outputs_with(entries)
+        gen.write(self.root, outputs)
+        self.assertEqual(gen.check(self.root, outputs), [])
+
+        # A crate update that changes its notice makes the committed files 
stale.
+        _write(
+            os.path.join(self.src, "mitlib-1.0.0", "src", "notice.c"),
+            self.C_NOTICE.replace("Example Corp.", "Example Corp Ltd."),
+        )
+        outputs = self._outputs_with(entries)
+        self.assertEqual(gen.check(self.root, outputs), ["LICENSE-binary"])
+
+
 if __name__ == "__main__":
     unittest.main()


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to