Skip to content

Add basic support for OpenBSD#496

Merged
messense merged 4 commits intoPyO3:mainfrom
messense:openbsd
Apr 12, 2021
Merged

Add basic support for OpenBSD#496
messense merged 4 commits intoPyO3:mainfrom
messense:openbsd

Conversation

@messense
Copy link
Member

Closes #469

cc @octeep

@messense messense force-pushed the openbsd branch 3 times, most recently from 3f58fbc to fa2d9b8 Compare April 10, 2021 07:14
@messense
Copy link
Member Author

messense commented Apr 10, 2021

I've verified that cargo test passed with this branch on OpenBSD 6.8.

https://builds.sr.ht/~messense/job/482109

@ghost
Copy link

ghost commented Apr 11, 2021

I'm facing this issue ArniDagur/python-adblock#36. I though it would be cleared with your patches though it still persists. What do you think is causing this?

On OpenBSD-current with rust-1.51.0.

test.log

@messense
Copy link
Member Author

messense commented Apr 11, 2021

I'm facing this issue ArniDagur/python-adblock#36. I though it would be cleared with your patches though it still persists. What do you think is causing this?

On OpenBSD-current with rust-1.51.0.

test.log

I'm not sure, can you list the steps to reproduce the issue?

@ghost
Copy link

ghost commented Apr 11, 2021

I'm facing this issue ArniDagur/python-adblock#36. I though it would be cleared with your patches though it still persists. What do you think is causing this?
On OpenBSD-current with rust-1.51.0.
test.log

I'm not sure, can you list the steps to reproduce the issue?

The Makefile for this in ports is attached, only thing worth looking there in are the crates used while compiling.

Makefile.txt

And the build command is:
/usr/local/bin/cargo build --manifest-path /usr/ports/pobj/maturin-0.10.2.20200411/maturin-bdf4bb23a12abec2f944167546966b057744d3eb/Cargo.toml --offline --release --verbose ;

But if you have a OpenBSD machine and know how to use ports, try jasperla/openbsd-wip, I've recently commited the ports as devel/maturin and www/py-adblock.

@messense
Copy link
Member Author

I've reproduce the issue with just maturin build, but I don't know how to install rust nightly on OpenBSD thus I'm unable to use cargo-expand to debug the pyo3-macros proc-macro generated code.

@ghost
Copy link

ghost commented Apr 11, 2021

Are you using the ports system? Or downloading the binaries? There is no hope with binary packages. But with ports edit Makefile in lang/rust to have DISTNAME = rustc-nightly-src. Then make makesum and make install. Nightly versions have never been tested and I'm not sure if the build will be successful. I'm trying to build right now. Both nightly and release will not be available in this case though, I hope that is not what you what.

@messense
Copy link
Member Author

@Dkarama I was able to get tests pass with pyo3 git main branch code. Try patch python-adblock's Cargo.toml:

[patch.crates-io]
pyo3 = { git = "https://github.com/PyO3/pyo3.git", rev = "7ac75366c27d5be6cc8fd5b344da1953c12d2c3e" }

@ghost
Copy link

ghost commented Apr 11, 2021

@messense

Did you patch something else? The latest HEAD on python-adblock fails with to compile your changes to Cargo.toml

Building a mixed python/rust project
 Found pyo3 bindings
 Found CPython 3.8 at python3.8
 Built source distribution to /home/zen/Github/python-adblock/target/wheels/adblock-0.4.3.tar.gz
   Compiling adblock v0.4.3 (/home/zen/Github/python-adblock)
error: hidden lifetime parameters in types are deprecated
   --> src/lib.rs:206:52
    |
206 |     pub fn add_filter_list(&mut self, filter_list: &str, format: &str) -> PyResult<()> {
    |                                                    ^- help: indicate the anonymous lifetime: `<'_>`
    |
note: the lint level is defined here
   --> src/lib.rs:5:5
    |
5   |     rust_2018_idioms,
    |     ^^^^^^^^^^^^^^^^
    = note: `#[deny(elided_lifetimes_in_paths)]` implied by `#[deny(rust_2018_idioms)]`


.........

error: aborting due to 20 previous errors


error: could not compile `adblock`

To learn more, run the command again with --verbose.
 maturin failed
  Caused by: Failed to build a native library through cargo
  Caused by: Cargo build finished with "exit code: 101": `cargo rustc --message-format json --manifest-path Cargo.toml --release --lib --`

@messense
Copy link
Member Author

Just remove the rust_2018_idioms lint.

Copy link
Member

@konstin konstin left a comment

Choose a reason for hiding this comment

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

Thanks, looks good

@messense messense merged commit 3e4f390 into PyO3:main Apr 12, 2021
@messense messense deleted the openbsd branch April 12, 2021 13:55
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.

2 participants