Skip to content

Commit

Permalink
Update cfg_aliases (#4589)
Browse files Browse the repository at this point in the history
### What

@zicklag was super awesome and merged these two PRs + published a new
version instantly <3

* katharostech/cfg_aliases#5
* katharostech/cfg_aliases#4

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested the web demo (if applicable):
* Using newly built examples:
[app.rerun.io](https://app.rerun.io/pr/4589/index.html)
* Using examples from latest `main` build:
[app.rerun.io](https://app.rerun.io/pr/4589/index.html?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[app.rerun.io](https://app.rerun.io/pr/4589/index.html?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG

- [PR Build Summary](https://build.rerun.io/pr/4589)
- [Docs
preview](https://rerun.io/preview/dc1a046880d479c82de3536ebb85e06645208401/docs)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/dc1a046880d479c82de3536ebb85e06645208401/examples)
<!--EXAMPLES-PREVIEW-->
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)
  • Loading branch information
Wumpf authored Dec 19, 2023
1 parent cde58b1 commit 832da05
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 20 deletions.
10 changes: 8 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ bytemuck = { version = "1.11", features = ["extern_crate_alloc"] }
camino = "1.1"
cargo_metadata = "0.18"
cargo-run-wasm = "0.3.2"
cfg_aliases = "0.1"
cfg_aliases = "0.2"
cfg-if = "1.0"
clang-format = "0.3"
clap = "4.0"
Expand Down
21 changes: 5 additions & 16 deletions crates/re_renderer/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,22 +119,11 @@ fn should_run() -> bool {
}

fn main() {
// TODO(andreas): Create an upstream PR `cfg_aliases` to fix this.
// Workaround for CARGO_CFG_DEBUG_ASSERTIONS not being set as expected.
// `cfg_aliases` relies on this.
if std::env::var("PROFILE") == Ok("debug".to_owned()) {
std::env::set_var("CARGO_CFG_DEBUG_ASSERTIONS", "1");
}

#[allow(clippy::str_to_string)]
// TODO(andreas): Create an upstream PR to `cfg_aliases` fix this.
{
cfg_aliases::cfg_aliases! {
native: { not(target_arch = "wasm32") },
webgl: { all(not(native), feature = "webgl") },
webgpu: { all(not(webgl), not(native)) },
load_shaders_from_disk: { all(native, debug_assertions) } // Shader reloading is only supported on native-debug currently.
}
cfg_aliases::cfg_aliases! {
native: { not(target_arch = "wasm32") },
webgl: { all(not(native), feature = "webgl") },
webgpu: { all(not(webgl), not(native)) },
load_shaders_from_disk: { all(native, debug_assertions) } // Shader reloading is only supported on native-debug currently.
}

if !should_run() {
Expand Down
3 changes: 2 additions & 1 deletion deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ skip = [
{ name = "ahash" }, # Popular crate + fast release schedule = lots of crates still using old versions
{ name = "base64" }, # Too popular
{ name = "cargo_metadata" }, # Older version used by ply-rs. It's small, and it's build-time only!
{ name = "foreign-types" }, # used for cocoa bindings. wgpu uses newer than eframe.
{ name = "cfg_aliases" }, # Tiny macro-only crate. Winit and other use older version than us.
{ name = "foreign-types-shared" }, # used for cocoa bindings. wgpu uses newer than eframe.
{ name = "foreign-types" }, # used for cocoa bindings. wgpu uses newer than eframe.
{ name = "hashbrown" }, # Old version used by polar-rs
{ name = "libloading" }, # Old version used by ash (vulkan binding), newer version used by khronos-egl
{ name = "memoffset" }, # Small crate
Expand Down

0 comments on commit 832da05

Please sign in to comment.