Skip to content

Mark more features as optional #739

New issue

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

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

Already on GitHub? # to your account

Closed
zamazan4ik opened this issue Oct 27, 2020 · 5 comments
Closed

Mark more features as optional #739

zamazan4ik opened this issue Oct 27, 2020 · 5 comments
Labels
A-Build-System Related to build systems or continuous integration C-Feature A new feature, making something new possible

Comments

@zamazan4ik
Copy link

What problem does this solve or what need does it fill?

I want to use bevy as an engine for backend part of my project. For now bevy requires a lot of useless dependencies for backend stuff like window features and others.

Describe the solution would you like?

Mark as much as possible features as optional. Then end user will be able to select and use only required features.

Describe the alternative(s) you've considered?

I don't see other solution for the problem.

Additional context

No

@zamazan4ik zamazan4ik added the C-Feature A new feature, making something new possible label Oct 27, 2020
@karroffel karroffel added the A-Build-System Related to build systems or continuous integration label Oct 27, 2020
@smokku
Copy link
Member

smokku commented Oct 27, 2020

default-features = false is enough to run Bevy on backend server.

The simplest server I use on backend looks like:

    App::build()
        // minimal plugins necessary for timers + headless loop
        .add_plugin(bevy::type_registry::TypeRegistryPlugin::default())
        .add_plugin(bevy::core::CorePlugin)
        .add_plugin(ScheduleRunnerPlugin::run_loop(Duration::from_secs_f64(
            1.0 / 60.0,
        )))
        .run();

With Cargo.toml:

[dependencies]
bevy = { version ="*", default-features = false }

@zamazan4ik
Copy link
Author

@smokku Does it require to install all deps from installation guide? Like sudo dnf install gcc-c++ libX11-devel alsa-lib-devel systemd-devel?

@smokku
Copy link
Member

smokku commented Oct 27, 2020

No. Turning off default features disables the whole render pipeline.

@smokku
Copy link
Member

smokku commented Oct 27, 2020

I just checked the dependencies of my server.

$ ldd target/debug/server
	linux-vdso.so.1 (0x00007ffca1de8000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007fb76aea7000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fb76ae85000)
	libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fb76ae6a000)
	libc.so.6 => /lib64/libc.so.6 (0x00007fb76aca0000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fb76b29d000)
	libm.so.6 => /lib64/libm.so.6 (0x00007fb76ab5a000)

@zamazan4ik
Copy link
Author

Thanks for the help and your investigation! Now it's clear for me.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-Build-System Related to build systems or continuous integration C-Feature A new feature, making something new possible
Projects
None yet
Development

No branches or pull requests

3 participants