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

Modernize secret-rs to work on modern versions of glib #10

Open
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

penguin359
Copy link

This enabled secret-rs to compile and work with the latest releases of the glib crate on both stable and nightly Rust channels.

This fixes various errors with translating types to/from glib's FFI and using the glib crates wrapper! macro. This branch should compile warning-free.

This is a newer version of glib-rs than the original crate was compiled
against. glib-rs 0.0.x fails to compile on Rust 1.22 (2017/11) or newer
and much older compilers are just broken in a modern environment.

There was a conflict between the libsecret-sys being loaded as private,
but the ffi module was exported as public. Defaulted it to private as
well.
This version nearly compiles successfully with Rust 1.22 and glib 0.1.3.
There are a few lines in util.rs that need to be commented out for that.
A slightly newer version of glib-rs should have some improvements to fix
that bit of code.
Except for the few lines in util.rs mentioned in the last commit that
need to be commented out, this compiles with the newer glib-rs and
passes the test suite.
This comments out lines that breaks the lock/unlock calls for secret
items and collections. This will need to be reverted once the correct
code has been implemented to get this to compile on glib-rs.

With this workaround added, the crate compiled even with current stable
and nightly compilers using this older glib 0.3.1 crate.
It no longer compiles with Rust 1.22, but it does compile and pass all
tests on stable and nightly channels.
Small fix-ups needed for new glib.
Small fix-ups needed for new glib.
from_glib() is now unsafe in this glib release and needs to be wrapped
appropriately.

Also, the actual classes (structs) for GObjects need to be imported with
the FFI now.
This is the latest glib release at this time.
It is now that it's compatible with the latest dependencies.
With this commit, the last breakage in this crate has been fixed for the
latest glib library. All functionality should be restored.
This uses glib::ffi again to access anything it might need from that
crate indirectly.
All tests marked as ignored are now fixed and passing.
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.

1 participant