Skip to content

Allow building as dependency on docs.rs with no features enabled - #199

Merged
rib merged 2 commits into
mainfrom
build-on-docsrs
Jan 7, 2026
Merged

Allow building as dependency on docs.rs with no features enabled #199
rib merged 2 commits into
mainfrom
build-on-docsrs

Conversation

@madsmtm

@madsmtm madsmtm commented Jun 5, 2025

Copy link
Copy Markdown
Member

In winit, we have to artificially enable an activity to get the docs to build on Android, which is kinda annoying:
https://github.com/rust-windowing/winit/blob/969237f422e3d1d18821f4ee99e6be7bb6acd913/Cargo.toml#L125-L126

Instead, this PR proposes to handle that logic internally in android-activity, by relying on the fact that docs.rs sets an environment variable (see their docs).

Fixes #117.

@madsmtm
madsmtm requested a review from MarijnS95 August 13, 2025 21:34

@MarijnS95 MarijnS95 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Unless I'm reading this wrong, we already tried to enable the native-activity backend by default for cfg(doc), i.e. a user runs cargo doc in this repository.

Is that also not set on docs.rs for dependency crates?

Comment thread .gitignore Outdated
Comment thread android-activity/build.rs Outdated
Comment thread android-activity/build.rs
Comment thread android-activity/src/lib.rs
@madsmtm madsmtm added the documentation Improvements or additions to documentation label Sep 4, 2025
@madsmtm
madsmtm requested a review from MarijnS95 September 4, 2025 22:36
@madsmtm

madsmtm commented Sep 4, 2025

Copy link
Copy Markdown
Member Author

Is that also not set on docs.rs for dependency crates?

Nope.

@madsmtm

madsmtm commented Nov 23, 2025

Copy link
Copy Markdown
Member Author

Bump?

@rib rib left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, this looks good to me.

@rib
rib merged commit e686e80 into main Jan 7, 2026
10 checks passed
@rib
rib deleted the build-on-docsrs branch January 7, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow downstream libraries' documentation to work without feature flags

3 participants