Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

let's try rust again #64

Merged
merged 14 commits into from
Mar 9, 2021
Merged

let's try rust again #64

merged 14 commits into from
Mar 9, 2021

Conversation

ocefpaf
Copy link
Member

@ocefpaf ocefpaf commented Feb 16, 2021

Updates the deps and removed those that are for py<36.

@ocefpaf ocefpaf requested a review from jakirkham as a code owner February 16, 2021 20:36
@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

@isuruf
Copy link
Member

isuruf commented Feb 16, 2021

This also needs a way to package the licenses of the rust dependencies.

@isuruf
Copy link
Member

isuruf commented Feb 16, 2021

Can you ask upstream about how to package the licenses of the rust dependencies for a binary package of cryptography?

@ocefpaf ocefpaf closed this Feb 17, 2021
@ocefpaf ocefpaf reopened this Feb 17, 2021
@ocefpaf
Copy link
Member Author

ocefpaf commented Feb 17, 2021

Can you ask upstream about how to package the licenses of the rust dependencies for a binary package of cryptography?

Will do! Is there an easy way to get a list of them from the build? Checking the logs I could not see anything obvious?

@ocefpaf
Copy link
Member Author

ocefpaf commented Feb 24, 2021

This also needs a way to package the licenses of the rust dependencies.

xref.: pyca/cryptography#5864

@ocefpaf
Copy link
Member Author

ocefpaf commented Feb 24, 2021

@isuruf I'm not a Rust expert but upstream told me to check each Cargo.toml for the licenses. I believe the direct dependency are listed in

https://github.com/pyca/cryptography/blob/main/src/rust/Cargo.lock

However, we would need to dig into the dependencies of the dependencies and things can get out of hand pretty quickly. Should we just "assume" that the downstream licenses are compatible with cryptography's licenses (Apache-2.0 AND BSD-3-Clause AND PSF-2.0) and that is the responsibility of upstream? Otherwise we will need to either package and handle the rust deps, highly unlikely and probably quite difficult, or we will need to build a tool to extract those licenses.

@isuruf
Copy link
Member

isuruf commented Feb 24, 2021

There is such a tool. See conda-forge/conda-forge.github.io#1052 for more discussion.

@ocefpaf
Copy link
Member Author

ocefpaf commented Feb 24, 2021

Below is what I got from cargo-rust. Most deps don't have a license file :-(

> cargo-license --json
[
  {
    "name": "bitflags",
    "version": "1.2.1",
    "authors": "The Rust Project Developers",
    "repository": "https://github.com/bitflags/bitflags",
    "license": "Apache-2.0 OR MIT",
    "license_file": null,
    "description": "A macro to generate structures which behave like bitflags."
  },
  {
    "name": "cfg-if",
    "version": "1.0.0",
    "authors": "Alex Crichton <[email protected]>",
    "repository": "https://github.com/alexcrichton/cfg-if",
    "license": "Apache-2.0 OR MIT",
    "license_file": null,
    "description": "A macro to ergonomically define an item depending on a large number of #[cfg] parameters. Structured like an if-else chain, the first matching branch is the item that gets emitted."
  },
  {
    "name": "cryptography-rust",
    "version": "0.1.0",
    "authors": "The cryptography developers <[email protected]>",
    "repository": null,
    "license": null,
    "license_file": null,
    "description": null
  },
  {
    "name": "ctor",
    "version": "0.1.19",
    "authors": "Matt Mastracci <[email protected]>",
    "repository": "https://github.com/mmastrac/rust-ctor",
    "license": "Apache-2.0 OR MIT",
    "license_file": null,
    "description": "__attribute__((constructor)) for Rust"
  },
  {
    "name": "ghost",
    "version": "0.1.2",
    "authors": "David Tolnay <[email protected]>",
    "repository": "https://github.com/dtolnay/ghost",
    "license": "Apache-2.0 OR MIT",
    "license_file": null,
    "description": "Define your own PhantomData"
  },
  {
    "name": "indoc",
    "version": "0.3.6",
    "authors": "David Tolnay <[email protected]>",
    "repository": "https://github.com/dtolnay/indoc",
    "license": "Apache-2.0 OR MIT",
    "license_file": null,
    "description": "Indented document literals"
  },
  {
    "name": "indoc-impl",
    "version": "0.3.6",
    "authors": "David Tolnay <[email protected]>",
    "repository": "https://github.com/dtolnay/indoc",
    "license": "Apache-2.0 OR MIT",
    "license_file": null,
    "description": "Indented document literals"
  },
  {
    "name": "instant",
    "version": "0.1.9",
    "authors": "sebcrozet <[email protected]>",
    "repository": "https://github.com/sebcrozet/instant",
    "license": "BSD-3-Clause",
    "license_file": null,
    "description": "A partial replacement for std::time::Instant that works on WASM too."
  },
  {
    "name": "inventory",
    "version": "0.1.10",
    "authors": "David Tolnay <[email protected]>",
    "repository": "https://github.com/dtolnay/inventory",
    "license": "Apache-2.0 OR MIT",
    "license_file": null,
    "description": "Typed distributed plugin registration"
  },
  {
    "name": "inventory-impl",
    "version": "0.1.10",
    "authors": "David Tolnay <[email protected]>",
    "repository": "https://github.com/dtolnay/inventory",
    "license": "Apache-2.0 OR MIT",
    "license_file": null,
    "description": "Implementation of macros for the `inventory` crate"
  },
  {
    "name": "libc",
    "version": "0.2.85",
    "authors": "The Rust Project Developers",
    "repository": "https://github.com/rust-lang/libc",
    "license": "Apache-2.0 OR MIT",
    "license_file": null,
    "description": "Raw FFI bindings to platform libraries like libc."
  },
  {
    "name": "lock_api",
    "version": "0.4.2",
    "authors": "Amanieu d'Antras <[email protected]>",
    "repository": "https://github.com/Amanieu/parking_lot",
    "license": "Apache-2.0 OR MIT",
    "license_file": null,
    "description": "Wrappers to create fully-featured Mutex and RwLock types. Compatible with no_std."
  },
  {
    "name": "parking_lot",
    "version": "0.11.1",
    "authors": "Amanieu d'Antras <[email protected]>",
    "repository": "https://github.com/Amanieu/parking_lot",
    "license": "Apache-2.0 OR MIT",
    "license_file": null,
    "description": "More compact and efficient implementations of the standard synchronization primitives."
  },
  {
    "name": "parking_lot_core",
    "version": "0.8.3",
    "authors": "Amanieu d'Antras <[email protected]>",
    "repository": "https://github.com/Amanieu/parking_lot",
    "license": "Apache-2.0 OR MIT",
    "license_file": null,
    "description": "An advanced API for creating custom synchronization primitives."
  },
  {
    "name": "paste",
    "version": "0.1.18",
    "authors": "David Tolnay <[email protected]>",
    "repository": "https://github.com/dtolnay/paste",
    "license": "Apache-2.0 OR MIT",
    "license_file": null,
    "description": "Macros for all your token pasting needs"
  },
  {
    "name": "paste-impl",
    "version": "0.1.18",
    "authors": "David Tolnay <[email protected]>",
    "repository": "https://github.com/dtolnay/paste",
    "license": "Apache-2.0 OR MIT",
    "license_file": null,
    "description": "Implementation detail of the `paste` crate"
  },
  {
    "name": "proc-macro-hack",
    "version": "0.5.19",
    "authors": "David Tolnay <[email protected]>",
    "repository": "https://github.com/dtolnay/proc-macro-hack",
    "license": "Apache-2.0 OR MIT",
    "license_file": null,
    "description": "Procedural macros in expression position"
  },
  {
    "name": "proc-macro2",
    "version": "1.0.24",
    "authors": "Alex Crichton <[email protected]>|David Tolnay <[email protected]>",
    "repository": "https://github.com/alexcrichton/proc-macro2",
    "license": "Apache-2.0 OR MIT",
    "license_file": null,
    "description": "A substitute implementation of the compiler's `proc_macro` API to decouple token-based libraries from the procedural macro use case."
  },
  {
    "name": "pyo3",
    "version": "0.13.2",
    "authors": "PyO3 Project and Contributors <https://github.com/PyO3>",
    "repository": "https://github.com/pyo3/pyo3",
    "license": "Apache-2.0",
    "license_file": null,
    "description": "Bindings to Python interpreter"
  },
  {
    "name": "pyo3-macros",
    "version": "0.13.2",
    "authors": "PyO3 Project and Contributors <https://github.com/PyO3>",
    "repository": "https://github.com/pyo3/pyo3",
    "license": "Apache-2.0",
    "license_file": null,
    "description": "Proc macros for PyO3 package"
  },
  {
    "name": "pyo3-macros-backend",
    "version": "0.13.2",
    "authors": "PyO3 Project and Contributors <https://github.com/PyO3>",
    "repository": "https://github.com/pyo3/pyo3",
    "license": "Apache-2.0",
    "license_file": null,
    "description": "Code generation for PyO3 package"
  },
  {
    "name": "quote",
    "version": "1.0.9",
    "authors": "David Tolnay <[email protected]>",
    "repository": "https://github.com/dtolnay/quote",
    "license": "Apache-2.0 OR MIT",
    "license_file": null,
    "description": "Quasi-quoting macro quote!(...)"
  },
  {
    "name": "redox_syscall",
    "version": "0.2.4",
    "authors": "Jeremy Soller <[email protected]>",
    "repository": "https://gitlab.redox-os.org/redox-os/syscall",
    "license": "MIT",
    "license_file": null,
    "description": "A Rust library to access raw Redox system calls"
  },
  {
    "name": "scopeguard",
    "version": "1.1.0",
    "authors": "bluss",
    "repository": "https://github.com/bluss/scopeguard",
    "license": "Apache-2.0 OR MIT",
    "license_file": null,
    "description": "A RAII scope guard that will run a given closure when it goes out of scope, even if the code between panics (assuming unwinding panic).  Defines the macros `defer!`, `defer_on_unwind!`, `defer_on_success!` as shorthands for guards with one of the implemented strategies."
  },
  {
    "name": "smallvec",
    "version": "1.6.1",
    "authors": "The Servo Project Developers",
    "repository": "https://github.com/servo/rust-smallvec",
    "license": "Apache-2.0 OR MIT",
    "license_file": null,
    "description": "'Small vector' optimization: store up to a small number of items on the stack"
  },
  {
    "name": "syn",
    "version": "1.0.60",
    "authors": "David Tolnay <[email protected]>",
    "repository": "https://github.com/dtolnay/syn",
    "license": "Apache-2.0 OR MIT",
    "license_file": null,
    "description": "Parser for Rust source code"
  },
  {
    "name": "unicode-xid",
    "version": "0.2.1",
    "authors": "erick.tryzelaar <[email protected]>|kwantam <[email protected]>",
    "repository": "https://github.com/unicode-rs/unicode-xid",
    "license": "Apache-2.0 OR MIT",
    "license_file": null,
    "description": "Determine whether characters have the XID_Start or XID_Continue properties according to Unicode Standard Annex #31."
  },
  {
    "name": "unindent",
    "version": "0.1.7",
    "authors": "David Tolnay <[email protected]>",
    "repository": "https://github.com/dtolnay/indoc",
    "license": "Apache-2.0 OR MIT",
    "license_file": null,
    "description": "Remove a column of leading whitespace from a string"
  },
  {
    "name": "winapi",
    "version": "0.3.9",
    "authors": "Peter Atashian <[email protected]>",
    "repository": "https://github.com/retep998/winapi-rs",
    "license": "Apache-2.0 OR MIT",
    "license_file": null,
    "description": "Raw FFI bindings for all of Windows API."
  },
  {
    "name": "winapi-i686-pc-windows-gnu",
    "version": "0.4.0",
    "authors": "Peter Atashian <[email protected]>",
    "repository": "https://github.com/retep998/winapi-rs",
    "license": "Apache-2.0 OR MIT",
    "license_file": null,
    "description": "Import libraries for the i686-pc-windows-gnu target. Please don't use this crate directly, depend on winapi instead."
  },
  {
    "name": "winapi-x86_64-pc-windows-gnu",
    "version": "0.4.0",
    "authors": "Peter Atashian <[email protected]>",
    "repository": "https://github.com/retep998/winapi-rs",
    "license": "Apache-2.0 OR MIT",
    "license_file": null,
    "description": "Import libraries for the x86_64-pc-windows-gnu target. Please don't use this crate directly, depend on winapi instead."
  }
]

@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I wanted to let you know that I linted all conda-recipes in your PR (recipe) and found some lint.

Here's what I've got...

For recipe:

  • Failed to even lint the recipe, probably because of a conda-smithy bug 😢. This likely indicates a problem in your meta.yaml, though. To get a traceback to help figure out what's going on, install conda-smithy and run conda smithy recipe-lint . from the recipe directory.

@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

@ocefpaf
Copy link
Member Author

ocefpaf commented Feb 25, 2021

@isuruf is the extra directory with the licenses file OK?

PS: after going through the process of checking all licenses with cargo-license I have to say that this does not scale. The licenses files usually have the same name, we are pre-pending the project name but that changes from the metadata, the GH name, or even multiple packages in the same repo making sorting the licenses our a bit fuzzy.

recipe/meta.yaml Outdated Show resolved Hide resolved
@ocefpaf
Copy link
Member Author

ocefpaf commented Mar 9, 2021

@isuruf should we merge this to "cash" the passing archs and open an issue for osx_arm?

@ocefpaf ocefpaf merged commit b2ff8be into conda-forge:master Mar 9, 2021
@ocefpaf ocefpaf deleted the rust branch March 9, 2021 22:54
@ocefpaf
Copy link
Member Author

ocefpaf commented Mar 9, 2021

🎉

Thanks @isuruf!!!

Comment on lines +18 to +20
- ls $PYO3_CROSS_LIB_DIR # [build_platform != target_platform]
- find $PYO3_CROSS_LIB_DIR -name "_sysconfigdata*.py" -not -name "${_CONDA_PYTHON_SYSCONFIGDATA_NAME_BACKUP}.py" -type f -exec rm -f {} + # [build_platform != target_platform]
- ls $PYO3_CROSS_LIB_DIR # [build_platform != target_platform]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These 3 lines can be removed now because this is done in cross-python now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll remove them tomorrow. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants