Skip to content

Make desktop notifications feature (dbus) optional #178

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

Merged
merged 1 commit into from
Feb 14, 2020
Merged

Make desktop notifications feature (dbus) optional #178

merged 1 commit into from
Feb 14, 2020

Conversation

osa1
Copy link
Owner

@osa1 osa1 commented Jan 29, 2020

With this I can make a statically linked executable with

$ cargo build --target=x86_64-unknown-linux-musl \
    --no-default-features --features tls-rustls

The generated executable does not support generating desktop
notifications and uses rustls instead of libssl.

(#65)

@osa1
Copy link
Owner Author

osa1 commented Jan 29, 2020

Statically-linked tiny works great on Windows under WSL!

tiny_3

@osa1
Copy link
Owner Author

osa1 commented Feb 14, 2020

I think I found a way to make dbus opt-out without making installation story worse: just make a no-dbus feature that is not optional. That way if a user wants to use rustls but not disable dbus they can still do --no-default-fetaures --features tls-rustls.

@osa1
Copy link
Owner Author

osa1 commented Feb 14, 2020

Ugh.. I keep forgetting this. The idea above is not possible as cargo features are supposed to be "additive". I guess we'll have to write detailed installation instructions in README.

This makes dbus dependency opt-in by making desktop notifications an
optional feature.

We also make native-tls optional and rustls the default. The idea is
that `cargo build` will be easier to build because it doesn't need any
system dependencies, and features that need system dependencies will be
hidden behind feature flags.

After this patch: (all commands in 'tiny' directory)

- dbus + rustls:
  cargo build --features="desktop-notifications"
- dbus + native-tls
  cargo build --features="desktop-notifications tls-native" \
              --no-default-features

Removing "desktop-notifications" will make a build without dbus
dependency.

It's now possible to make a statically-linked executable with

    $ cargo build --target=x86_64-unknown-linux-musl

(#65)
@osa1
Copy link
Owner Author

osa1 commented Feb 14, 2020

I'm still not sure if this is a good idea, but I made rustls the default and desktop notifications opt-in. See commit msg for details.

@osa1 osa1 merged commit b80c356 into master Feb 14, 2020
@osa1 osa1 deleted the no_dbus branch October 12, 2020 07:29
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