Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-maturin for openSUSE:Factory checked in at 2022-12-13 18:55:15 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-maturin (Old) and /work/SRC/openSUSE:Factory/.python-maturin.new.1835 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-maturin" Tue Dec 13 18:55:15 2022 rev:21 rq:1042453 version:0.14.5 Changes: -------- --- /work/SRC/openSUSE:Factory/python-maturin/python-maturin.changes 2022-12-02 13:13:25.001944069 +0100 +++ /work/SRC/openSUSE:Factory/.python-maturin.new.1835/python-maturin.changes 2022-12-13 18:55:29.855212958 +0100 @@ -1,0 +2,24 @@ +Mon Dec 12 18:49:38 UTC 2022 - Mia Herkt <[email protected]> + +- Manually override outdated ahash dependency of chumsky crate + in vendor tarball to hopefully facilitate reproducible builds + Adds vendor-update-ahash-dependency.patch + boo#1206342 +- Update to v0.14.5: + * Support SOURCE_DATE_EPOCH environment variable in wheel building + gh#PyO3/maturin#1334 + * Fix sdist when all Cargo workspace members are excluded + gh#PyO3/maturin#1343 +- Changes in v0.14.4: + * Bump sigstore/gh-action-sigstore-python from 0.0.11 to 0.1.0 + gh#PyO3/maturin#1317 + * Refactor Target::get_platform_tag to use standard osname-release-machine fallback representation + gh#PyO3/maturin#1318 + * Better error message when upload failed with status code 403 + gh#PyO3/maturin#1323 + * Warn about patchelf version requirement + gh#PyO3/maturin#1327 + * Refactor compile to take cargo targets with bridge model + gh#PyO3/maturin#1328 + +------------------------------------------------------------------- Old: ---- maturin-0.14.3.tar.gz New: ---- maturin-0.14.5.tar.gz vendor-update-ahash-dependency.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-maturin.spec ++++++ --- /var/tmp/diff_new_pack.ksKFe5/_old 2022-12-13 18:55:32.959229524 +0100 +++ /var/tmp/diff_new_pack.ksKFe5/_new 2022-12-13 18:55:32.963229545 +0100 @@ -17,7 +17,7 @@ Name: python-maturin -Version: 0.14.3 +Version: 0.14.5 Release: 0 Summary: Rust/Python Interoperability License: Apache-2.0 OR MIT @@ -25,6 +25,7 @@ Source: https://files.pythonhosted.org/packages/source/m/maturin/maturin-%{version}.tar.gz Source1: vendor.tar.xz Source2: cargo_config +Patch: vendor-update-ahash-dependency.patch BuildRequires: %{python_module base >= 3.7} BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools-rust >= 1.4.0} @@ -50,10 +51,11 @@ 3.6+, can upload them to PyPI and has basic PyPy support. %prep -%autosetup -a1 -n maturin-%{version} +%autosetup -a1 -p1 -n maturin-%{version} mkdir .cargo cp %{SOURCE2} .cargo/config sed -i '1{/env python/d}' maturin/__init__.py +sed -i 's/--locked/--offline/' setup.py %build %pyproject_wheel ++++++ maturin-0.14.3.tar.gz -> maturin-0.14.5.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maturin-0.14.3/Cargo.lock new/maturin-0.14.5/Cargo.lock --- old/maturin-0.14.3/Cargo.lock 2022-12-01 07:51:10.000000000 +0100 +++ new/maturin-0.14.5/Cargo.lock 2022-12-08 05:18:36.000000000 +0100 @@ -741,9 +741,9 @@ [[package]] name = "data-encoding" -version = "2.3.2" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" +checksum = "23d8666cb01533c39dde32bcbab8e227b4ed6679b2c925eba05feabea39508fb" [[package]] name = "derivative" @@ -969,9 +969,9 @@ [[package]] name = "filetime" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b9663d381d07ae25dc88dbdf27df458faa83a9b25336bcac83d5e452b5fc9d3" +checksum = "4e884668cd0c7480504233e951174ddc3b382f7c2666e3b7310b5c4e7b0c37f9" dependencies = [ "cfg-if", "libc", @@ -1402,9 +1402,9 @@ [[package]] name = "libc" -version = "0.2.137" +version = "0.2.138" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" +checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8" [[package]] name = "linux-raw-sys" @@ -1459,7 +1459,7 @@ [[package]] name = "maturin" -version = "0.14.3" +version = "0.14.5" dependencies = [ "anyhow", "base64", @@ -1510,6 +1510,7 @@ "tempfile", "textwrap", "thiserror", + "time", "toml_edit", "tracing", "tracing-subscriber", @@ -1790,9 +1791,9 @@ [[package]] name = "openssl" -version = "0.10.43" +version = "0.10.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "020433887e44c27ff16365eaa2d380547a94544ad509aff6eb5b6e3e0b27b376" +checksum = "29d971fd5722fec23977260f6e81aa67d2f22cadbdc2aa049f1022d9a3be1566" dependencies = [ "bitflags", "cfg-if", @@ -1831,9 +1832,9 @@ [[package]] name = "openssl-sys" -version = "0.9.78" +version = "0.9.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07d5c8cb6e57b3a3612064d7b18b117912b4ce70955c2504d4b741c9e244b132" +checksum = "5454462c0eced1e97f2ec09036abc8da362e66802f66fd20f86854d9d8cbcbc4" dependencies = [ "autocfg", "cc", @@ -2098,9 +2099,9 @@ [[package]] name = "quoted_printable" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fee2dce59f7a43418e3382c766554c614e06a552d53a8f07ef499ea4b332c0f" +checksum = "20f14e071918cbeefc5edc986a7aa92c425dae244e003a35e1cdddb5ca39b5cb" [[package]] name = "rand" @@ -2271,9 +2272,9 @@ [[package]] name = "rustix" -version = "0.36.4" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb93e85278e08bb5788653183213d3a60fc242b10cb9be96586f5a73dcb67c23" +checksum = "a3807b5d10909833d3e9acd1eb5fb988f79376ff10fce42937de71a449c4c588" dependencies = [ "bitflags", "errno", @@ -2422,18 +2423,18 @@ [[package]] name = "serde" -version = "1.0.148" +version = "1.0.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e53f64bb4ba0191d6d0676e1b141ca55047d83b74f5607e6d8eb88126c52c2dc" +checksum = "256b9932320c590e707b94576e3cc1f7c9024d0ee6612dfbcf1cb106cbe8e055" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.148" +version = "1.0.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a55492425aa53521babf6137309e7d34c20bbfbbfcfe2c7f3a047fd1f6b92c0c" +checksum = "b4eae9b04cbffdfd550eb462ed33bc6a1b68c935127d008b27444d08380f94e4" dependencies = [ "proc-macro2", "quote", @@ -2603,9 +2604,9 @@ [[package]] name = "syn" -version = "1.0.104" +version = "1.0.105" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae548ec36cf198c0ef7710d3c230987c2d6d7bd98ad6edc0274462724c585ce" +checksum = "60b9b43d45702de4c839cb9b51d9f529c5dd26a4aff255b42b1ebc03e88ee908" dependencies = [ "proc-macro2", "quote", @@ -2898,9 +2899,9 @@ [[package]] name = "typenum" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] name = "unicase" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maturin-0.14.3/Cargo.toml new/maturin-0.14.5/Cargo.toml --- old/maturin-0.14.3/Cargo.toml 1970-01-01 01:00:00.000000000 +0100 +++ new/maturin-0.14.5/Cargo.toml 1970-01-01 01:00:00.000000000 +0100 @@ -1,7 +1,7 @@ [package] authors = ["konstin <[email protected]>", "messense <[email protected]>"] name = "maturin" -version = "0.14.3" +version = "0.14.5" description = "Build and publish crates with pyo3, rust-cpython and cffi bindings as well as rust binaries as python packages" exclude = ["test-crates/**/*", "sysconfig/*", "test-data/*", "ci/*", "tests/*", "guide/*", ".github/*"] homepage = "https://github.com/pyo3/maturin" @@ -80,6 +80,7 @@ ureq = { version = "2.3.1", features = ["gzip", "socks-proxy"], default-features = false, optional = true } native-tls-crate = { package = "native-tls", version = "0.2.8", optional = true } keyring = { version = "1.1.1", optional = true } +time = "0.3.17" [dev-dependencies] indoc = "1.0.3" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maturin-0.14.3/Changelog.md new/maturin-0.14.5/Changelog.md --- old/maturin-0.14.3/Changelog.md 2022-12-01 07:51:10.000000000 +0100 +++ new/maturin-0.14.5/Changelog.md 2022-12-08 05:18:36.000000000 +0100 @@ -7,6 +7,16 @@ ## [Unreleased] +## [0.14.5] - 2022-12-08 + +* Support `SOURCE_DATE_EPOCH` when building wheels in [#1334](https://github.com/PyO3/maturin/pull/1334) +* Fix sdist when all Cargo workspace members are excluded in [#1343](https://github.com/PyO3/maturin/pull/1343) + +## [0.14.4] - 2022-12-05 + +* Expanded architecture support for FreeBSD, NetBSD and OpenBSD in [#1318](https://github.com/PyO3/maturin/pull/1318) +* Better error message when upload failed with status code 403 in [#1323](https://github.com/PyO3/maturin/pull/1323) + ## [0.14.3] - 2022-12-01 * Bump MSRV to 1.62.0 in [#1297](https://github.com/PyO3/maturin/pull/1297) @@ -766,8 +776,10 @@ * Initial Release -[Unreleased]: https://github.com/pyo3/maturin/compare/v0.14.3...HEAD -[0.14.3]: https://github.com/pyo3/maturin/compare/v0.14.3...v0.14.3 +[Unreleased]: https://github.com/pyo3/maturin/compare/v0.14.5...HEAD +[0.14.5]: https://github.com/pyo3/maturin/compare/v0.14.4...v0.14.5 +[0.14.4]: https://github.com/pyo3/maturin/compare/v0.14.3...v0.14.4 +[0.14.3]: https://github.com/pyo3/maturin/compare/v0.14.2...v0.14.3 [0.14.2]: https://github.com/pyo3/maturin/compare/v0.14.1...v0.14.2 [0.14.1]: https://github.com/pyo3/maturin/compare/v0.14.0...v0.14.1 [0.14.0]: https://github.com/pyo3/maturin/compare/v0.13.7...v0.14.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maturin-0.14.3/Dockerfile new/maturin-0.14.5/Dockerfile --- old/maturin-0.14.3/Dockerfile 2022-12-01 07:51:10.000000000 +0100 +++ new/maturin-0.14.5/Dockerfile 2022-12-08 05:18:36.000000000 +0100 @@ -49,6 +49,7 @@ && python3.8 -m pip install --no-cache-dir cffi \ && python3.9 -m pip install --no-cache-dir cffi \ && python3.10 -m pip install --no-cache-dir cffi \ + && python3.11 -m pip install --no-cache-dir cffi \ && mkdir /io COPY --from=builder /usr/bin/maturin /usr/bin/maturin diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maturin-0.14.3/PKG-INFO new/maturin-0.14.5/PKG-INFO --- old/maturin-0.14.3/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 +++ new/maturin-0.14.5/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 @@ -1,15 +1,15 @@ Metadata-Version: 2.1 Name: maturin -Version: 0.14.3 +Version: 0.14.5 Classifier: Topic :: Software Development :: Build Tools Classifier: Programming Language :: Rust Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy Requires-Dist: tomli>=1.1.0 ; python_version<'3.11' -Requires-Dist: ziglang~=0.10.0; extra == 'zig' Requires-Dist: patchelf; extra == 'patchelf' -Provides-Extra: zig +Requires-Dist: ziglang~=0.10.0; extra == 'zig' Provides-Extra: patchelf +Provides-Extra: zig Summary: Build and publish crates with pyo3, rust-cpython and cffi bindings as well as rust binaries as python packages Keywords: python,cffi,packaging,pypi,pyo3 Home-Page: https://github.com/pyo3/maturin @@ -20,8 +20,8 @@ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM Project-URL: Issues, https://github.com/PyO3/maturin/issues Project-URL: Documentation, https://maturin.rs -Project-URL: Source Code, https://github.com/PyO3/maturin Project-URL: Changelog, https://maturin.rs/changelog.html +Project-URL: Source Code, https://github.com/PyO3/maturin # Maturin diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maturin-0.14.3/src/auditwheel/patchelf.rs new/maturin-0.14.5/src/auditwheel/patchelf.rs --- old/maturin-0.14.3/src/auditwheel/patchelf.rs 2022-12-01 07:51:10.000000000 +0100 +++ new/maturin-0.14.5/src/auditwheel/patchelf.rs 2022-12-08 05:18:36.000000000 +0100 @@ -3,6 +3,33 @@ use std::path::Path; use std::process::Command; +static MISSING_PATCHELF_ERROR: &str = "Failed to execute 'patchelf', did you install it? Hint: Try `pip install maturin[patchelf]` (or just `pip install patchelf`)"; + +/// Verify patchelf version +pub fn verify_patchelf() -> Result<()> { + let output = Command::new("patchelf") + .arg("--version") + .output() + .context(MISSING_PATCHELF_ERROR)?; + let version = String::from_utf8(output.stdout) + .context("Failed to parse patchelf version")? + .trim() + .to_string(); + let version = version.strip_prefix("patchelf").unwrap_or(&version).trim(); + let semver = version + .parse::<semver::Version>() + .context("Failed to parse patchelf version")?; + println!("{:?}", semver); + if semver < semver::Version::new(0, 14, 0) { + // TODO: turn it into an error in 1.0 + eprintln!( + "â ï¸ Warning: patchelf {} found. auditwheel repair requires patchelf >= 0.14.", + version + ); + } + Ok(()) +} + /// Replace a declared dependency on a dynamic library with another one (`DT_NEEDED`) pub fn replace_needed<O: AsRef<OsStr>, N: AsRef<OsStr>>( file: impl AsRef<Path>, @@ -13,9 +40,7 @@ cmd.arg("--replace-needed").arg(old).arg(new); } cmd.arg(file.as_ref()); - let output = cmd - .output() - .context("Failed to execute 'patchelf', did you install it? Hint: Try `pip install maturin[patchelf]` (or just `pip install patchelf`)")?; + let output = cmd.output().context(MISSING_PATCHELF_ERROR)?; if !output.status.success() { bail!( "patchelf --replace-needed failed: {}", @@ -29,9 +54,7 @@ pub fn set_soname<S: AsRef<OsStr>>(file: impl AsRef<Path>, soname: &S) -> Result<()> { let mut cmd = Command::new("patchelf"); cmd.arg("--set-soname").arg(soname).arg(file.as_ref()); - let output = cmd - .output() - .context("Failed to execute 'patchelf', did you install it?")?; + let output = cmd.output().context(MISSING_PATCHELF_ERROR)?; if !output.status.success() { bail!( "patchelf --set-soname failed: {}", @@ -45,9 +68,7 @@ pub fn remove_rpath(file: impl AsRef<Path>) -> Result<()> { let mut cmd = Command::new("patchelf"); cmd.arg("--remove-rpath").arg(file.as_ref()); - let output = cmd - .output() - .context("Failed to execute 'patchelf', did you install it?")?; + let output = cmd.output().context(MISSING_PATCHELF_ERROR)?; if !output.status.success() { bail!( "patchelf --remove-rpath failed: {}", @@ -65,9 +86,7 @@ .arg("--set-rpath") .arg(rpath) .arg(file.as_ref()); - let output = cmd - .output() - .context("Failed to execute 'patchelf', did you install it?")?; + let output = cmd.output().context(MISSING_PATCHELF_ERROR)?; if !output.status.success() { bail!( "patchelf --set-rpath failed: {}", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maturin-0.14.3/src/build_context.rs new/maturin-0.14.5/src/build_context.rs --- old/maturin-0.14.3/src/build_context.rs 2022-12-01 07:51:10.000000000 +0100 +++ new/maturin-0.14.5/src/build_context.rs 2022-12-08 05:18:36.000000000 +0100 @@ -1,7 +1,7 @@ use crate::auditwheel::{get_policy_and_libs, patchelf, relpath}; use crate::auditwheel::{PlatformTag, Policy}; use crate::build_options::CargoOptions; -use crate::compile::warn_missing_py_init; +use crate::compile::{warn_missing_py_init, CompileTarget, LIB_CRATE_TYPES}; use crate::module_writer::{ add_data, write_bin, write_bindings_module, write_cffi_module, write_python_part, write_uniffi_module, write_wasm_launcher, WheelWriter, @@ -318,7 +318,7 @@ /// Add library search paths in Cargo target directory rpath when building in editable mode fn add_rpath(&self, artifacts: &[&BuildArtifact]) -> Result<()> { - if self.editable && self.target.is_linux() { + if self.editable && self.target.is_linux() && !artifacts.is_empty() { for artifact in artifacts { if artifact.linked_paths.is_empty() { continue; @@ -355,6 +355,9 @@ if ext_libs.iter().all(|libs| libs.is_empty()) { return Ok(()); } + + patchelf::verify_patchelf()?; + // Put external libs to ${module_name}.libs directory // See https://github.com/pypa/auditwheel/issues/89 let mut libs_dir = self @@ -654,6 +657,52 @@ Ok(wheels) } + fn cargo_compile_targets(&self) -> Vec<CompileTarget> { + let root_pkg = self.cargo_metadata.root_package().unwrap(); + let resolved_features = self + .cargo_metadata + .resolve + .as_ref() + .and_then(|resolve| resolve.nodes.iter().find(|node| node.id == root_pkg.id)) + .map(|node| node.features.clone()) + .unwrap_or_default(); + let mut targets: Vec<_> = root_pkg + .targets + .iter() + .filter(|target| match self.bridge { + BridgeModel::Bin(_) => { + let is_bin = target.kind.contains(&"bin".to_string()); + if target.required_features.is_empty() { + is_bin + } else { + // Check all required features are enabled for this bin target + is_bin + && target + .required_features + .iter() + .all(|f| resolved_features.contains(f)) + } + } + _ => target.kind.contains(&"cdylib".to_string()), + }) + .map(|target| (target, &self.bridge)) + .collect(); + if targets.is_empty() && !self.bridge.is_bin() { + // No `crate-type = ["cdylib"]` in `Cargo.toml` + // Let's try compile one of the target with `--crate-type cdylib` + let lib_target = root_pkg.targets.iter().find(|target| { + target + .kind + .iter() + .any(|k| LIB_CRATE_TYPES.contains(&k.as_str())) + }); + if let Some(target) = lib_target { + targets.push((target, &self.bridge)); + } + } + targets + } + /// Runs cargo build, extracts the cdylib from the output and returns the path to it /// /// The module name is used to warn about missing a `PyInit_<module name>` function for @@ -663,7 +712,7 @@ python_interpreter: Option<&PythonInterpreter>, extension_name: Option<&str>, ) -> Result<BuildArtifact> { - let artifacts = compile(self, python_interpreter, &self.bridge) + let artifacts = compile(self, python_interpreter, &self.cargo_compile_targets()) .context("Failed to build a native library through cargo")?; let error_msg = "Cargo didn't build a cdylib. Did you miss crate-type = [\"cdylib\"] \ in the lib section of your Cargo.toml?"; @@ -912,7 +961,7 @@ python_interpreter: Option<&PythonInterpreter>, ) -> Result<Vec<BuiltWheelMetadata>> { let mut wheels = Vec::new(); - let artifacts = compile(self, python_interpreter, &self.bridge) + let artifacts = compile(self, python_interpreter, &self.cargo_compile_targets()) .context("Failed to build a native library through cargo")?; if artifacts.is_empty() { bail!("Cargo didn't build a binary") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maturin-0.14.3/src/build_options.rs new/maturin-0.14.5/src/build_options.rs --- old/maturin-0.14.3/src/build_options.rs 2022-12-01 07:51:10.000000000 +0100 +++ new/maturin-0.14.5/src/build_options.rs 2022-12-08 05:18:36.000000000 +0100 @@ -640,45 +640,7 @@ } } - match bridge { - BridgeModel::Bin(None) => { - // Only support two different kind of platform tags when compiling to musl target without any binding crates - if platform_tags.iter().any(|tag| tag.is_musllinux()) && !target.is_musl_target() { - bail!( - "Cannot mix musllinux and manylinux platform tags when compiling to {}", - target.target_triple() - ); - } - - #[allow(clippy::comparison_chain)] - if platform_tags.len() > 2 { - bail!( - "Expected only one or two platform tags but found {}", - platform_tags.len() - ); - } else if platform_tags.len() == 2 { - // The two platform tags can't be the same kind - let tag_types = platform_tags - .iter() - .map(|tag| tag.is_musllinux()) - .collect::<HashSet<_>>(); - if tag_types.len() == 1 { - bail!( - "Expected only one platform tag but found {}", - platform_tags.len() - ); - } - } - } - _ => { - if platform_tags.len() > 1 { - bail!( - "Expected only one platform tag but found {}", - platform_tags.len() - ); - } - } - } + validate_bridge_type(&bridge, &target, &platform_tags)?; // linux tag can not be mixed with manylinux and musllinux tags if platform_tags.len() > 1 && platform_tags.iter().any(|tag| !tag.is_portable()) { @@ -725,6 +687,54 @@ } } +/// Checks for bridge/platform type edge cases +fn validate_bridge_type( + bridge: &BridgeModel, + target: &Target, + platform_tags: &[PlatformTag], +) -> Result<()> { + match bridge { + BridgeModel::Bin(None) => { + // Only support two different kind of platform tags when compiling to musl target without any binding crates + if platform_tags.iter().any(|tag| tag.is_musllinux()) && !target.is_musl_target() { + bail!( + "Cannot mix musllinux and manylinux platform tags when compiling to {}", + target.target_triple() + ); + } + + #[allow(clippy::comparison_chain)] + if platform_tags.len() > 2 { + bail!( + "Expected only one or two platform tags but found {}", + platform_tags.len() + ); + } else if platform_tags.len() == 2 { + // The two platform tags can't be the same kind + let tag_types = platform_tags + .iter() + .map(|tag| tag.is_musllinux()) + .collect::<HashSet<_>>(); + if tag_types.len() == 1 { + bail!( + "Expected only one platform tag but found {}", + platform_tags.len() + ); + } + } + } + _ => { + if platform_tags.len() > 1 { + bail!( + "Expected only one platform tag but found {}", + platform_tags.len() + ); + } + } + } + Ok(()) +} + /// Uses very simple PEP 440 subset parsing to determine the /// minimum supported python minor version for interpreter search fn get_min_python_minor(metadata21: &Metadata21) -> Option<usize> { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maturin-0.14.3/src/compile.rs new/maturin-0.14.5/src/compile.rs --- old/maturin-0.14.3/src/compile.rs 2022-12-01 07:51:10.000000000 +0100 +++ new/maturin-0.14.5/src/compile.rs 2022-12-08 05:18:36.000000000 +0100 @@ -17,7 +17,9 @@ const PYO3_ABI3_NO_PYTHON_VERSION: (u64, u64, u64) = (0, 16, 4); /// crate types excluding `bin`, `cdylib` and `proc-macro` -const LIB_CRATE_TYPES: [&str; 4] = ["lib", "dylib", "rlib", "staticlib"]; +pub(crate) const LIB_CRATE_TYPES: [&str; 4] = ["lib", "dylib", "rlib", "staticlib"]; + +pub(crate) type CompileTarget<'a> = (&'a cargo_metadata::Target, &'a BridgeModel); /// A cargo build artifact #[derive(Debug, Clone)] @@ -32,92 +34,46 @@ /// Builds the rust crate into a native module (i.e. an .so or .dll) for a /// specific python version. Returns a mapping from crate type (e.g. cdylib) /// to artifact location. -pub fn compile( - context: &BuildContext, +pub fn compile<'a>( + context: &'a BuildContext, python_interpreter: Option<&PythonInterpreter>, - bindings_crate: &BridgeModel, + targets: &[CompileTarget<'a>], ) -> Result<Vec<HashMap<String, BuildArtifact>>> { - let root_pkg = context.cargo_metadata.root_package().unwrap(); - let resolved_features = context - .cargo_metadata - .resolve - .as_ref() - .and_then(|resolve| resolve.nodes.iter().find(|node| node.id == root_pkg.id)) - .map(|node| node.features.clone()) - .unwrap_or_default(); - let mut targets: Vec<_> = root_pkg - .targets - .iter() - .filter(|target| match bindings_crate { - BridgeModel::Bin(_) => { - let is_bin = target.kind.contains(&"bin".to_string()); - if target.required_features.is_empty() { - is_bin - } else { - // Check all required features are enabled for this bin target - is_bin - && target - .required_features - .iter() - .all(|f| resolved_features.contains(f)) - } - } - _ => target.kind.contains(&"cdylib".to_string()), - }) - .collect(); - if targets.is_empty() && !bindings_crate.is_bin() { - // No `crate-type = ["cdylib"]` in `Cargo.toml` - // Let's try compile one of the target with `--crate-type cdylib` - let lib_target = root_pkg.targets.iter().find(|target| { - target - .kind - .iter() - .any(|k| LIB_CRATE_TYPES.contains(&k.as_str())) - }); - if let Some(target) = lib_target { - targets.push(target); - } - } if context.target.is_macos() && context.universal2 { - compile_universal2(context, python_interpreter, bindings_crate, &targets) + compile_universal2(context, python_interpreter, targets) } else { - compile_targets(context, python_interpreter, bindings_crate, &targets) + compile_targets(context, python_interpreter, targets) } } /// Build an universal2 wheel for macos which contains both an x86 and an aarch64 binary -fn compile_universal2( - context: &BuildContext, +fn compile_universal2<'a>( + context: &'a BuildContext, python_interpreter: Option<&PythonInterpreter>, - bindings_crate: &BridgeModel, - targets: &[&cargo_metadata::Target], + targets: &[CompileTarget<'a>], ) -> Result<Vec<HashMap<String, BuildArtifact>>> { - let build_type = if bindings_crate.is_bin() { - "bin" - } else { - "cdylib" - }; - debug!("Building an universal2 {}", build_type); - let mut aarch64_context = context.clone(); aarch64_context.target = Target::from_target_triple(Some("aarch64-apple-darwin".to_string()))?; - let aarch64_artifacts = compile_targets( - &aarch64_context, - python_interpreter, - bindings_crate, - targets, - ) - .context("Failed to build a aarch64 library through cargo")?; + let aarch64_artifacts = compile_targets(&aarch64_context, python_interpreter, targets) + .context("Failed to build a aarch64 library through cargo")?; let mut x86_64_context = context.clone(); x86_64_context.target = Target::from_target_triple(Some("x86_64-apple-darwin".to_string()))?; - let x86_64_artifacts = - compile_targets(&x86_64_context, python_interpreter, bindings_crate, targets) - .context("Failed to build a x86_64 library through cargo")?; + let x86_64_artifacts = compile_targets(&x86_64_context, python_interpreter, targets) + .context("Failed to build a x86_64 library through cargo")?; let mut universal_artifacts = Vec::with_capacity(targets.len()); - for (aarch64_artifact, x86_64_artifact) in aarch64_artifacts.iter().zip(x86_64_artifacts) { + for (bridge_model, (aarch64_artifact, x86_64_artifact)) in targets + .iter() + .map(|(_, bridge_model)| bridge_model) + .zip(aarch64_artifacts.iter().zip(&x86_64_artifacts)) + { + let build_type = if bridge_model.is_bin() { + "bin" + } else { + "cdylib" + }; let aarch64_artifact = aarch64_artifact.get(build_type).cloned().ok_or_else(|| { if build_type == "cdylib" { anyhow!( @@ -168,18 +124,17 @@ Ok(universal_artifacts) } -fn compile_targets( - context: &BuildContext, +fn compile_targets<'a>( + context: &'a BuildContext, python_interpreter: Option<&PythonInterpreter>, - bindings_crate: &BridgeModel, - targets: &[&cargo_metadata::Target], + targets: &[CompileTarget<'a>], ) -> Result<Vec<HashMap<String, BuildArtifact>>> { let mut artifacts = Vec::with_capacity(targets.len()); - for target in targets { + for (target, bridge_model) in targets { artifacts.push(compile_target( context, python_interpreter, - bindings_crate, + bridge_model, target, )?); } @@ -189,7 +144,7 @@ fn compile_target( context: &BuildContext, python_interpreter: Option<&PythonInterpreter>, - bindings_crate: &BridgeModel, + bridge_model: &BridgeModel, binding_target: &cargo_metadata::Target, ) -> Result<HashMap<String, BuildArtifact>> { let target = &context.target; @@ -219,7 +174,7 @@ let mut rust_flags = env::var_os("RUSTFLAGS"); // We need to pass --bin / --lib - match bindings_crate { + match bridge_model { BridgeModel::Bin(..) => { cargo_rustc.bin.push(binding_target.name.clone()); } @@ -242,12 +197,12 @@ // https://github.com/PyO3/pyo3/issues/88#issuecomment-337744403 if target.is_macos() { - if let BridgeModel::Bindings(..) | BridgeModel::BindingsAbi3(..) = bindings_crate { + if let BridgeModel::Bindings(..) | BridgeModel::BindingsAbi3(..) = bridge_model { // Change LC_ID_DYLIB to the final .so name for macOS targets to avoid linking with // non-existent library. // See https://github.com/PyO3/setuptools-rust/issues/106 for detail let module_name = &context.module_name; - let so_filename = match bindings_crate { + let so_filename = match bridge_model { BridgeModel::BindingsAbi3(..) => format!("{base}.abi3.so", base = module_name), _ => python_interpreter .expect("missing python interpreter for non-abi3 wheel build") @@ -358,7 +313,7 @@ build_command.env("RUSTFLAGS", flags); } - if let BridgeModel::BindingsAbi3(_, _) = bindings_crate { + if let BridgeModel::BindingsAbi3(_, _) = bridge_model { let is_pypy = python_interpreter .map(|p| p.interpreter_kind.is_pypy()) .unwrap_or(false); @@ -377,9 +332,9 @@ if let Some(interpreter) = python_interpreter { // Target python interpreter isn't runnable when cross compiling if interpreter.runnable { - if bindings_crate.is_bindings("pyo3") - || bindings_crate.is_bindings("pyo3-ffi") - || (matches!(bindings_crate, BridgeModel::BindingsAbi3(_, _)) + if bridge_model.is_bindings("pyo3") + || bridge_model.is_bindings("pyo3-ffi") + || (matches!(bridge_model, BridgeModel::BindingsAbi3(_, _)) && interpreter.interpreter_kind.is_pypy()) { build_command @@ -392,9 +347,9 @@ // rust-cpython, and legacy pyo3 versions build_command.env("PYTHON_SYS_EXECUTABLE", &interpreter.executable); - } else if (bindings_crate.is_bindings("pyo3") - || bindings_crate.is_bindings("pyo3-ffi") - || (matches!(bindings_crate, BridgeModel::BindingsAbi3(_, _)) + } else if (bridge_model.is_bindings("pyo3") + || bridge_model.is_bindings("pyo3-ffi") + || (matches!(bridge_model, BridgeModel::BindingsAbi3(_, _)) && interpreter.interpreter_kind.is_pypy())) && env::var_os("PYO3_CONFIG_FILE").is_none() { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maturin-0.14.3/src/module_writer.rs new/maturin-0.14.5/src/module_writer.rs --- old/maturin-0.14.3/src/module_writer.rs 2022-12-01 07:51:10.000000000 +0100 +++ new/maturin-0.14.5/src/module_writer.rs 2022-12-08 05:18:36.000000000 +0100 @@ -14,6 +14,7 @@ use normpath::PathExt as _; use sha2::{Digest, Sha256}; use std::collections::{HashMap, HashSet}; +use std::env; use std::ffi::OsStr; use std::fmt::Write as _; #[cfg(target_family = "unix")] @@ -26,8 +27,10 @@ use std::process::{Command, Output}; use std::str; use tempfile::{tempdir, TempDir}; +use time::macros::datetime; +use time::OffsetDateTime; use tracing::debug; -use zip::{self, ZipWriter}; +use zip::{self, DateTime, ZipWriter}; /// Allows writing the module to a wheel or add it directly to the virtualenv pub trait ModuleWriter { @@ -234,9 +237,15 @@ } else { zip::CompressionMethod::Deflated }; - let options = zip::write::FileOptions::default() + + let mut options = zip::write::FileOptions::default() .unix_permissions(permissions) .compression_method(compression_method); + let mtime = self.mtime().ok(); + if let Some(mtime) = mtime { + options = options.last_modified_time(mtime); + } + self.zip.start_file(target.clone(), options)?; self.zip.write_all(bytes)?; @@ -309,6 +318,18 @@ } } + /// Returns a DateTime representing the value SOURCE_DATE_EPOCH environment variable + /// Note that the earliest timestamp a zip file can represent is 1980-01-01 + fn mtime(&self) -> Result<DateTime> { + let epoch: i64 = env::var("SOURCE_DATE_EPOCH")?.parse()?; + let dt = OffsetDateTime::from_unix_timestamp(epoch)?; + let min_dt = datetime!(1980-01-01 0:00 UTC); + let dt = dt.max(min_dt); + + let dt = DateTime::from_time(dt).map_err(|_| anyhow!("Failed to build zip DateTime"))?; + Ok(dt) + } + /// Creates the record file and finishes the zip pub fn finish(mut self) -> Result<PathBuf, io::Error> { let compression_method = if cfg!(feature = "faster-tests") { @@ -316,7 +337,13 @@ } else { zip::CompressionMethod::Deflated }; - let options = zip::write::FileOptions::default().compression_method(compression_method); + + let mut options = zip::write::FileOptions::default().compression_method(compression_method); + let mtime = self.mtime().ok(); + if let Some(mtime) = mtime { + options = options.last_modified_time(mtime); + } + let record_filename = self.record_file.to_str().unwrap().replace('\\', "/"); debug!("Adding {}", record_filename); self.zip.start_file(&record_filename, options)?; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maturin-0.14.3/src/source_distribution.rs new/maturin-0.14.5/src/source_distribution.rs --- old/maturin-0.14.3/src/source_distribution.rs 2022-12-01 07:51:10.000000000 +0100 +++ new/maturin-0.14.5/src/source_distribution.rs 2022-12-08 05:18:36.000000000 +0100 @@ -213,8 +213,10 @@ } if !new_members.is_empty() { workspace["members"] = toml_edit::value(new_members); - rewritten = true; + } else { + workspace.remove("members"); } + rewritten = true; } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maturin-0.14.3/src/target.rs new/maturin-0.14.5/src/target.rs --- old/maturin-0.14.3/src/target.rs 2022-12-01 07:51:10.000000000 +0100 +++ new/maturin-0.14.5/src/target.rs 2022-12-08 05:18:36.000000000 +0100 @@ -97,6 +97,29 @@ } } +impl Arch { + /// Represents the hardware platform. + /// + /// This is the same as the native platform's `uname -m` output. + pub fn machine(&self) -> &'static str { + // See https://www.freebsd.org/cgi/man.cgi?query=arch&sektion=7&format=html + // MACHINE_ARCH vs MACHINE_CPUARCH vs MACHINE section + match self { + Arch::Aarch64 => "arm64", + Arch::Armv6L | Arch::Armv7L => "arm", + Arch::Powerpc | Arch::Powerpc64Le | Arch::Powerpc64 => "powerpc", + Arch::X86 => "i386", + Arch::X86_64 => "amd64", + Arch::Riscv64 => "riscv", + Arch::Mips64el | Arch::Mipsel => "mips", + // sparc64 is unsupported since FreeBSD 13.0 + Arch::Sparc64 => "sparc64", + Arch::Wasm32 => "wasm32", + Arch::S390X => "s390x", + } + } +} + // Returns the set of supported architectures for each operating system fn get_supported_architectures(os: &Os) -> Vec<Arch> { match os { @@ -117,18 +140,31 @@ ], Os::Windows => vec![Arch::X86, Arch::X86_64, Arch::Aarch64], Os::Macos => vec![Arch::Aarch64, Arch::X86_64], - Os::NetBsd => vec![Arch::Aarch64, Arch::X86, Arch::X86_64], - Os::FreeBsd => vec![ + Os::FreeBsd | Os::NetBsd => vec![ Arch::Aarch64, Arch::Armv6L, Arch::Armv7L, + Arch::Powerpc, Arch::Powerpc64, Arch::Powerpc64Le, Arch::X86, Arch::X86_64, Arch::Riscv64, + Arch::Mips64el, + Arch::Mipsel, + Arch::Sparc64, + ], + Os::OpenBsd => vec![ + Arch::X86, + Arch::X86_64, + Arch::Aarch64, + Arch::Armv7L, + Arch::Powerpc, + Arch::Powerpc64, + Arch::Powerpc64Le, + Arch::Riscv64, + Arch::Sparc64, ], - Os::OpenBsd => vec![Arch::X86, Arch::X86_64, Arch::Aarch64], Os::Dragonfly => vec![Arch::X86_64], Os::Illumos => vec![Arch::X86_64], Os::Haiku => vec![Arch::X86_64], @@ -235,41 +271,53 @@ universal2: bool, ) -> Result<String> { let tag = match (&self.os, &self.arch) { + // Windows + (Os::Windows, Arch::X86) => "win32".to_string(), + (Os::Windows, Arch::X86_64) => "win_amd64".to_string(), + (Os::Windows, Arch::Aarch64) => "win_arm64".to_string(), + // Linux + (Os::Linux, _) => { + let arch = self.get_platform_arch()?; + let mut platform_tags = platform_tags.to_vec(); + platform_tags.sort(); + let mut tags = vec![]; + for platform_tag in platform_tags { + tags.push(format!("{}_{}", platform_tag, arch)); + for alias in platform_tag.aliases() { + tags.push(format!("{}_{}", alias, arch)); + } + } + tags.join(".") + } + // macOS + (Os::Macos, Arch::X86_64) | (Os::Macos, Arch::Aarch64) => { + let ((x86_64_major, x86_64_minor), (arm64_major, arm64_minor)) = macosx_deployment_target(env::var("MACOSX_DEPLOYMENT_TARGET").ok().as_deref(), universal2)?; + if universal2 { + format!( + "macosx_{x86_64_major}_{x86_64_minor}_x86_64.macosx_{arm64_major}_{arm64_minor}_arm64.macosx_{x86_64_major}_{x86_64_minor}_universal2", + x86_64_major = x86_64_major, + x86_64_minor = x86_64_minor, + arm64_major = arm64_major, + arm64_minor = arm64_minor + ) + } else if self.arch == Arch::Aarch64 { + format!("macosx_{}_{}_arm64", arm64_major, arm64_minor) + } else { + format!("macosx_{}_{}_x86_64", x86_64_major, x86_64_minor) + } + } // FreeBSD - (Os::FreeBsd, Arch::X86) - | (Os::FreeBsd, Arch::X86_64) - | (Os::FreeBsd, Arch::Aarch64) - | (Os::FreeBsd, Arch::Armv6L) - | (Os::FreeBsd, Arch::Armv7L) - | (Os::FreeBsd, Arch::Powerpc) - | (Os::FreeBsd, Arch::Powerpc64) - | (Os::FreeBsd, Arch::Powerpc64Le) - | (Os::FreeBsd, Arch::Riscv64) + (Os::FreeBsd, _) // NetBSD - | (Os::NetBsd, Arch::X86) - | (Os::NetBsd, Arch::X86_64) - | (Os::NetBsd, Arch::Aarch64) + | (Os::NetBsd, _) // OpenBSD - | (Os::OpenBsd, Arch::X86) - | (Os::OpenBsd, Arch::X86_64) - | (Os::OpenBsd, Arch::Aarch64) => { + | (Os::OpenBsd, _) => { let release = self.get_platform_release()?; - let arch = match self.arch { - Arch::X86_64 => "amd64", - Arch::X86 => "i386", - Arch::Aarch64 => "arm64", - Arch::Armv6L | Arch::Armv7L => "arm", - Arch::Powerpc | Arch::Powerpc64 | Arch::Powerpc64Le => "powerpc", - Arch::Riscv64 => "riscv", - _ => panic!( - "unsupported architecture should not have reached get_platform_tag()" - ), - }; format!( "{}_{}_{}", self.os.to_string().to_ascii_lowercase(), release, - arch + self.arch.machine(), ) } // DragonFly @@ -284,24 +332,36 @@ "x86_64" ) } - // Solaris and Illumos - (Os::Solaris, Arch::X86_64) | - (Os::Solaris, Arch::Sparc64) | - (Os::Illumos, Arch::X86_64) => { + // Emscripten + (Os::Emscripten, Arch::Wasm32) => { + let os_version = env::var("MATURIN_EMSCRIPTEN_VERSION"); + let release = match os_version { + Ok(os_ver) => os_ver, + Err(_) => emcc_version()?, + }; + let release = release.replace(['.', '-'], "_"); + format!("emscripten_{}_wasm32", release) + } + (Os::Wasi, Arch::Wasm32) => { + "any".to_string() + } + // osname_release_machine fallback for any POSIX system + (_, _) => { let info = PlatformInfo::new()?; let mut release = info.release().replace(['.', '-'], "_"); - let mut arch = info.machine().replace([' ', '/'], "_"); + let mut machine = info.machine().replace([' ', '/'], "_"); let mut os = self.os.to_string().to_ascii_lowercase(); // See https://github.com/python/cpython/blob/46c8d915715aa2bd4d697482aa051fe974d440e1/Lib/sysconfig.py#L722-L730 if os.starts_with("sunos") { + // Solaris / Illumos if let Some((major, other)) = release.split_once('_') { let major_ver: u64 = major.parse().context("illumos major version is not a number")?; if major_ver >= 5 { // SunOS 5 == Solaris 2 os = "solaris".to_string(); release = format!("{}_{}", major_ver - 3, other); - arch = format!("{}_64bit", arch); + machine = format!("{}_64bit", machine); } } } @@ -309,70 +369,9 @@ "{}_{}_{}", os, release, - arch + machine ) } - // Linux - (Os::Linux, _) => { - let arch = self.get_platform_arch()?; - let mut platform_tags = platform_tags.to_vec(); - platform_tags.sort(); - let mut tags = vec![]; - for platform_tag in platform_tags { - tags.push(format!("{}_{}", platform_tag, arch)); - for alias in platform_tag.aliases() { - tags.push(format!("{}_{}", alias, arch)); - } - } - tags.join(".") - } - // macOS - (Os::Macos, Arch::X86_64) => { - let ((x86_64_major, x86_64_minor), (arm64_major, arm64_minor)) = macosx_deployment_target(env::var("MACOSX_DEPLOYMENT_TARGET").ok().as_deref(), universal2)?; - if universal2 { - format!( - "macosx_{x86_64_major}_{x86_64_minor}_x86_64.macosx_{arm64_major}_{arm64_minor}_arm64.macosx_{x86_64_major}_{x86_64_minor}_universal2", - x86_64_major = x86_64_major, - x86_64_minor = x86_64_minor, - arm64_major = arm64_major, - arm64_minor = arm64_minor - ) - } else { - format!("macosx_{}_{}_x86_64", x86_64_major, x86_64_minor) - } - } - (Os::Macos, Arch::Aarch64) => { - let ((x86_64_major, x86_64_minor), (arm64_major, arm64_minor)) = macosx_deployment_target(env::var("MACOSX_DEPLOYMENT_TARGET").ok().as_deref(), universal2)?; - if universal2 { - format!( - "macosx_{x86_64_major}_{x86_64_minor}_x86_64.macosx_{arm64_major}_{arm64_minor}_arm64.macosx_{x86_64_major}_{x86_64_minor}_universal2", - x86_64_major = x86_64_major, - x86_64_minor = x86_64_minor, - arm64_major = arm64_major, - arm64_minor = arm64_minor - ) - } else { - format!("macosx_{}_{}_arm64", arm64_major, arm64_minor) - } - } - // Windows - (Os::Windows, Arch::X86) => "win32".to_string(), - (Os::Windows, Arch::X86_64) => "win_amd64".to_string(), - (Os::Windows, Arch::Aarch64) => "win_arm64".to_string(), - // Emscripten - (Os::Emscripten, Arch::Wasm32) => { - let os_version = env::var("MATURIN_EMSCRIPTEN_VERSION"); - let release = match os_version { - Ok(os_ver) => os_ver, - Err(_) => emcc_version()?, - }; - let release = release.replace(['.', '-'], "_"); - format!("emscripten_{}_wasm32", release) - } - (Os::Wasi, Arch::Wasm32) => { - "any".to_string() - } - (_, _) => panic!("unsupported target should not have reached get_platform_tag()"), }; Ok(tag) } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maturin-0.14.3/src/upload.rs new/maturin-0.14.5/src/upload.rs --- old/maturin-0.14.3/src/upload.rs 2022-12-01 07:51:10.000000000 +0100 +++ new/maturin-0.14.5/src/upload.rs 2022-12-08 05:18:36.000000000 +0100 @@ -13,6 +13,7 @@ use std::io; use std::path::{Path, PathBuf}; use thiserror::Error; +use tracing::debug; /// An account with a registry, possibly incomplete #[derive(Debug, clap::Parser)] @@ -67,7 +68,7 @@ UreqError(#[source] ureq::Error), /// The registry returned a "403 Forbidden" #[error("Username or password are incorrect")] - AuthenticationError, + AuthenticationError(String), /// Reading the wheel failed #[error("IO Error")] IoError(#[source] io::Error), @@ -391,6 +392,7 @@ e ) }); + debug!("Upload error response: {}", err_text); // Detect FileExistsError the way twine does // https://github.com/pypa/twine/blob/87846e5777b380d4704704a69e1f9a7a1231451c/twine/commands/upload.py#L30 if status == 403 { @@ -398,7 +400,7 @@ // Artifactory (https://jfrog.com/artifactory/) Err(UploadError::FileExistsError(err_text)) } else { - Err(UploadError::AuthenticationError) + Err(UploadError::AuthenticationError(err_text)) } } else { let status_string = status.to_string(); @@ -431,8 +433,18 @@ match upload_result { Ok(()) => (), - Err(UploadError::AuthenticationError) => { - println!("â Username and/or password are wrong"); + Err(UploadError::AuthenticationError(msg)) => { + let title_re = regex::Regex::new(r"<title>(.+?)</title>").unwrap(); + let title = title_re + .captures(&msg) + .and_then(|c| c.get(1)) + .map(|m| m.as_str()); + match title { + Some(title) => { + println!("â {}", title); + } + None => println!("â Username and/or password are wrong"), + } #[cfg(feature = "keyring")] { @@ -452,7 +464,7 @@ } } - bail!("Username and/or password are wrong"); + bail!("Username and/or password are possibly wrong"); } Err(err) => { let filename = i.file_name().unwrap_or(i.as_os_str()); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maturin-0.14.3/test-dockerfile.sh new/maturin-0.14.5/test-dockerfile.sh --- old/maturin-0.14.3/test-dockerfile.sh 2022-12-01 07:51:10.000000000 +0100 +++ new/maturin-0.14.5/test-dockerfile.sh 2022-12-08 05:18:36.000000000 +0100 @@ -5,7 +5,7 @@ set -e rm -rf venv-docker -python3.8 -m venv venv-docker +python3.11 -m venv venv-docker venv-docker/bin/pip install -U pip cffi # FIXME: Can we run the tests without activate? Currently hello-world fails because then the binary is not in PATH @@ -14,7 +14,7 @@ for test_crate in hello-world cffi-pure cffi-mixed pyo3-pure pyo3-mixed pyo3-mixed-submodule do echo "Testing $test_crate" - docker run -e RUST_BACKTRACE=1 --rm -v "$(pwd):/io" -w /io/test-crates/$test_crate maturin build -i python3.8 + docker run -e RUST_BACKTRACE=1 --rm -v "$(pwd):/io" -w /io/test-crates/$test_crate maturin build -i python3.11 # --only-binary=:all: stops pip from picking a local already compiled sdist venv-docker/bin/pip install $test_crate --only-binary=:all: --find-links test-crates/$test_crate/target/wheels/ if [[ $(venv-docker/bin/python test-crates/$test_crate/check_installed/check_installed.py) != 'SUCCESS' ]]; then ++++++ vendor-update-ahash-dependency.patch ++++++ diff -ru vendor/vendor/chumsky/.cargo-checksum.json vendor.new/vendor/chumsky/.cargo-checksum.json --- vendor/vendor/chumsky/.cargo-checksum.json 2022-12-12 20:24:01.634338100 +0100 +++ vendor.new/vendor/chumsky/.cargo-checksum.json 2022-12-12 20:12:59.648304580 +0100 @@ -1 +1 @@ -{"files":{"CHANGELOG.md":"9c0c8b828885d376d9bfb96cd076edb1f6cdc544ff8bb1c4eabce98f9c065e2e","Cargo.lock":"aa2a848b8f1f6c5610eeaec07cfef673dc184e1847c9e24ca58f280cdff851c0","Cargo.toml":"090c96d9a0d43f335356ec49a25e44568148d167cce30d541abd7f0fd26aa0e0","LICENSE":"88f7ddf73afcffee97e0a19211ddeecd7d178ecb5c09bbfe472ce4cfcceb6269","README.md":"25e8d58974b0d92e0111a1e2f5ea9eb1fdbe5538ab6d9d000a5f0288ae3b2b54","examples/brainfuck.rs":"c10b4c29190211fb3c3e5739a5a0c2380cd0430bf27a660c8e5cf8d24782370b","examples/foo.rs":"8a81b1dbd7ce9e0101e30bad0fcdfd3c681ed4387684c0149a867e73abcd304e","examples/json.rs":"d473c938c5c735ce20b882dd010de87bff6dfd26d32ee96bd02f6ddb08d0bb7f","examples/nano_rust.rs":"2fbaa3afb72e2f4d42efe3b3c5c5b5592e1f381fa948376c28121e1109d64a92","examples/sample.bf":"824a423496b3847b635d8da95d183867115318e671f731149c3603c732dbed77","examples/sample.foo":"f0c3345067c4716498e0c37d142254c6eb8edbb600b3fedd16a90c1031a6fbdf","examples/sample.json":"caa8622c94afa7402e166d1db53a262af17 f74f72573a06a8e47cf655e863032","examples/sample.nrs":"d05c03a0da9e1bb46ecb8da880e087a1580324d443139ff3aa59c7f6b5358c61","src/chain.rs":"434d82a2f281ebef044f4e5a95c894955ae06b047828f05f8836f71ead335ca8","src/combinator.rs":"07dd0935d606935c86073b16c3705c5635cb816b6c925ff46b86285a8e5582ea","src/debug.rs":"0d15d99af4a9dfb796685aae239d0fd683a84d2e902a5e64bf784ebd9db65f5a","src/error.rs":"23a1beaa1d31c9f3a8d134e731a782c9f32a0d1b85c6264a66a50478380e4657","src/lib.rs":"3e3db6bd4aa0f3ffbaf231a3a537fefb865d0179a753f0ed398ad313c9d5465e","src/primitive.rs":"ecd3230a402d3763f3f0fc759eb6a24a9c6063b4cdbc17acdd5f3e43f517b170","src/recovery.rs":"29a95d08fe91981cbd94fc70705fdb1eb4751b560a3a8373906ab6b30eaf5627","src/recursive.rs":"361373ae0a4c788004113c5387626f6091f88b63d084ec143941bf23d53b6c99","src/span.rs":"cee0f45fa29b7753d2c328d156ecd795bb282df233bb8c531e0415d7aae55670","src/stream.rs":"bd4637a893ecf6e94b7b3408a1f6f7e35dbe5065ce22673c51a3f8d5ed2240cc","src/text.rs":"45cf8726dcb52db00d0b1c9d5760 90149755f06e226f83c35ceb4a7413f7b218","tutorial.md":"5ba58fd5a5223e89a3320ecf5a67b5519de49237d3b7537e6a51decd025b7408"},"package":"8d02796e4586c6c41aeb68eae9bfb4558a522c35f1430c14b40136c3706e09e4"} \ No newline at end of file +{"files":{"CHANGELOG.md":"9c0c8b828885d376d9bfb96cd076edb1f6cdc544ff8bb1c4eabce98f9c065e2e","Cargo.lock":"4f641d59af6fac16c28ddadd0e40f4501f22a392c36879ec36c3aad8050551cf","Cargo.toml":"005f06855e892df71995a4e7edcb0703e565e17da90fe37ad76393bfd5f8ef67","LICENSE":"88f7ddf73afcffee97e0a19211ddeecd7d178ecb5c09bbfe472ce4cfcceb6269","README.md":"25e8d58974b0d92e0111a1e2f5ea9eb1fdbe5538ab6d9d000a5f0288ae3b2b54","examples/brainfuck.rs":"c10b4c29190211fb3c3e5739a5a0c2380cd0430bf27a660c8e5cf8d24782370b","examples/foo.rs":"8a81b1dbd7ce9e0101e30bad0fcdfd3c681ed4387684c0149a867e73abcd304e","examples/json.rs":"d473c938c5c735ce20b882dd010de87bff6dfd26d32ee96bd02f6ddb08d0bb7f","examples/nano_rust.rs":"2fbaa3afb72e2f4d42efe3b3c5c5b5592e1f381fa948376c28121e1109d64a92","examples/sample.bf":"824a423496b3847b635d8da95d183867115318e671f731149c3603c732dbed77","examples/sample.foo":"f0c3345067c4716498e0c37d142254c6eb8edbb600b3fedd16a90c1031a6fbdf","examples/sample.json":"caa8622c94afa7402e166d1db53a262af17 f74f72573a06a8e47cf655e863032","examples/sample.nrs":"d05c03a0da9e1bb46ecb8da880e087a1580324d443139ff3aa59c7f6b5358c61","src/chain.rs":"434d82a2f281ebef044f4e5a95c894955ae06b047828f05f8836f71ead335ca8","src/combinator.rs":"07dd0935d606935c86073b16c3705c5635cb816b6c925ff46b86285a8e5582ea","src/debug.rs":"0d15d99af4a9dfb796685aae239d0fd683a84d2e902a5e64bf784ebd9db65f5a","src/error.rs":"23a1beaa1d31c9f3a8d134e731a782c9f32a0d1b85c6264a66a50478380e4657","src/lib.rs":"3e3db6bd4aa0f3ffbaf231a3a537fefb865d0179a753f0ed398ad313c9d5465e","src/primitive.rs":"ecd3230a402d3763f3f0fc759eb6a24a9c6063b4cdbc17acdd5f3e43f517b170","src/recovery.rs":"29a95d08fe91981cbd94fc70705fdb1eb4751b560a3a8373906ab6b30eaf5627","src/recursive.rs":"361373ae0a4c788004113c5387626f6091f88b63d084ec143941bf23d53b6c99","src/span.rs":"cee0f45fa29b7753d2c328d156ecd795bb282df233bb8c531e0415d7aae55670","src/stream.rs":"bd4637a893ecf6e94b7b3408a1f6f7e35dbe5065ce22673c51a3f8d5ed2240cc","src/text.rs":"45cf8726dcb52db00d0b1c9d5760 90149755f06e226f83c35ceb4a7413f7b218","tutorial.md":"5ba58fd5a5223e89a3320ecf5a67b5519de49237d3b7537e6a51decd025b7408"},"package":"8d02796e4586c6c41aeb68eae9bfb4558a522c35f1430c14b40136c3706e09e4"} diff -ru vendor/vendor/chumsky/Cargo.lock vendor.new/vendor/chumsky/Cargo.lock --- vendor/vendor/chumsky/Cargo.lock 2022-12-12 20:24:01.634338100 +0100 +++ vendor.new/vendor/chumsky/Cargo.lock 2022-12-12 20:01:38.911052854 +0100 @@ -4,11 +4,13 @@ [[package]] name = "ahash" -version = "0.3.8" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8fd72866655d1904d6b0997d0b07ba561047d070fbe29de039031c641b61217" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ - "const-random", + "getrandom", + "once_cell", + "version_check", ] [[package]] @@ -36,38 +38,10 @@ ] [[package]] -name = "const-random" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f590d95d011aa80b063ffe3253422ed5aa462af4e9867d43ce8337562bac77c4" -dependencies = [ - "const-random-macro", - "proc-macro-hack", -] - -[[package]] -name = "const-random-macro" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "615f6e27d000a2bffbc7f2f6a8669179378fa27ee4d0a509e985dfc0a7defb40" -dependencies = [ - "getrandom", - "lazy_static", - "proc-macro-hack", - "tiny-keccak", -] - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] name = "getrandom" -version = "0.2.3" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" +checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" dependencies = [ "cfg-if", "libc", @@ -75,16 +49,16 @@ ] [[package]] -name = "lazy_static" -version = "1.4.0" +name = "libc" +version = "0.2.138" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8" [[package]] -name = "libc" -version = "0.2.105" +name = "once_cell" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "869d572136620d55835903746bcb5cdc54cb2851fd0aeec53220b4bb65ef3013" +checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" [[package]] name = "pom" @@ -93,25 +67,16 @@ checksum = "07e2192780e9f8e282049ff9bffcaa28171e1cb0844f49ed5374e518ae6024ec" [[package]] -name = "proc-macro-hack" -version = "0.5.19" +name = "version_check" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" - -[[package]] -name = "tiny-keccak" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" -dependencies = [ - "crunchy", -] +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "yansi" diff -ru vendor/vendor/chumsky/Cargo.toml vendor.new/vendor/chumsky/Cargo.toml --- vendor/vendor/chumsky/Cargo.toml 2022-12-12 20:24:01.634338100 +0100 +++ vendor.new/vendor/chumsky/Cargo.toml 2022-12-12 20:01:34.533961770 +0100 @@ -21,7 +21,7 @@ license = "MIT" repository = "https://github.com/zesterer/chumsky" [dependencies.ahash] -version = "^0.3" +version = "^0.7" optional = true [dev-dependencies.ariadne] version = "0.1.2" ++++++ vendor.tar.xz ++++++ /work/SRC/openSUSE:Factory/python-maturin/vendor.tar.xz /work/SRC/openSUSE:Factory/.python-maturin.new.1835/vendor.tar.xz differ: char 27, line 1
