Skip to content

Commit 745250e

Browse files
committed
finalize post
1 parent 89b1688 commit 745250e

6 files changed

Lines changed: 28 additions & 13 deletions

File tree

content/blog/2024/12-12-rust-feature-debugging/index.md renamed to content/blog/2024/12-16-rust-feature-debugging/index.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
+++
22
title = "Rust crate feature debugging"
3-
date = 2024-12-12
3+
date = 2024-12-16
44
[extra]
55
tags=["rust","bevy","cargo"]
6-
hidden = true
76
custom_summary = "Figure out what enabled a feature in a crate in your dependencies breaking your build."
87
+++
98

@@ -21,9 +20,9 @@ cargo:warning= | ^~~~~~~~~~
2120
cargo:warning=1 error generated.
2221
```
2322

24-
So it looks like some crate is trying to build C-code under the hood which depends on `stdlib.h`. That is not a problem on native build targets but it won't fly on **wasm**.
23+
So it looks like some crate is trying to build C-code under the hood which depends on `stdlib.h`. While this is not a problem on native build targets, it will not work on **Wasm**.
2524

26-
This happens in the `basis-universal` crate, what could that be good for? Reading up on it's [crates.io page](https://crates.io/crates/basis-universal) we find out that it is:
25+
The code in question belongs to the `basis-universal` crate, what could that be good for? Reading up on it's [crates.io page](https://crates.io/crates/basis-universal) we find out that it is:
2726

2827
> Bindings for Binomial LLC's basis-universal Supercompressed GPU Texture Codec
2928
@@ -39,7 +38,7 @@ Let's find the cause for this.
3938

4039
We first want to find out where in our tree of dependencies this one is used. `cargo tree` is the tool to help you analyze your dependencies as the graph structure they make up.
4140

42-
When running `cargo tree` we get over 1.000 lines of output where we can search for `basis-universal`:
41+
When running `cargo tree`, we get over 1.000 outputted lines that we have to search, for somewhere inside this haystack is `basis-universal`:
4342

4443
```sh
4544
│ │ ├── bevy_image v0.15.0

content/blog/2024/12-12-rust-feature-debugging/screen1.png renamed to content/blog/2024/12-16-rust-feature-debugging/screen1.png

File renamed without changes.

docs/blog/2024/12-12-rust-feature-debugging/index.html renamed to docs/blog/2024/12-16-rust-feature-debugging/index.html

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@
2323
</header>
2424

2525
<div id="blogpage">
26-
<div class="date">2024-12-12</div>
27-
28-
<div class="hidden">hidden</div>
26+
<div class="date">2024-12-16</div>
2927

3028
<h1 class="title">
3129
Rust crate feature debugging
@@ -40,8 +38,8 @@ <h1 id="what-happened">What happened</h1>
4038
</span><span>cargo:warning</span><span style="color:#89ddff;">= | </span><span style="color:#82aaff;">^</span><span style="font-style:italic;color:#ff5370;">~~~~~~~~~
4139
</span><span>cargo:warning</span><span style="color:#89ddff;">=</span><span style="color:#c3e88d;">1 </span><span style="color:#82aaff;">error generated.
4240
</span></code></pre>
43-
<p>So it looks like some crate is trying to build C-code under the hood which depends on <code>stdlib.h</code>. That is not a problem on native build targets but it won't fly on <strong>wasm</strong>.</p>
44-
<p>This happens in the <code>basis-universal</code> crate, what could that be good for? Reading up on it's <a href="https://crates.io/crates/basis-universal">crates.io page</a> we find out that it is:</p>
41+
<p>So it looks like some crate is trying to build C-code under the hood which depends on <code>stdlib.h</code>. While this is not a problem on native build targets, it will not work on <strong>Wasm</strong>.</p>
42+
<p>The code in question belongs to the <code>basis-universal</code> crate, what could that be good for? Reading up on it's <a href="https://crates.io/crates/basis-universal">crates.io page</a> we find out that it is:</p>
4543
<blockquote>
4644
<p>Bindings for Binomial LLC's basis-universal Supercompressed GPU Texture Codec</p>
4745
</blockquote>
@@ -51,7 +49,7 @@ <h1 id="what-happened">What happened</h1>
5149
<p>Let's find the cause for this.</p>
5250
<h1 id="how-to-find-the-cause">How to find the cause</h1>
5351
<p>We first want to find out where in our tree of dependencies this one is used. <code>cargo tree</code> is the tool to help you analyze your dependencies as the graph structure they make up.</p>
54-
<p>When running <code>cargo tree</code> we get over 1.000 lines of output where we can search for <code>basis-universal</code>:</p>
52+
<p>When running <code>cargo tree</code>, we get over 1.000 outputted lines that we have to search, for somewhere inside this haystack is <code>basis-universal</code>:</p>
5553
<pre data-lang="sh" style="background-color:#212121;color:#eeffff;" class="language-sh "><code class="language-sh" data-lang="sh"><span style="color:#82aaff;">│ │ ├── bevy_image v0.15.0
5654
</span><span style="color:#82aaff;">│ │ │ ├── basis-universal v0.3.1
5755
</span><span style="color:#82aaff;">│ │ │ │ ├── basis-universal-sys v0.3.1

docs/blog/2024/12-12-rust-feature-debugging/screen1.png renamed to docs/blog/2024/12-16-rust-feature-debugging/screen1.png

File renamed without changes.

docs/blog/index.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,24 @@ <h1>Blog</h1>
2727
<div class="posts">
2828

2929

30+
<div class="post">
31+
<div class="date">2024-12-16</div>
32+
<a href="https://rustunit.com/blog/2024/12-16-rust-feature-debugging/">
33+
<div class="title">Rust crate feature debugging</div>
34+
</a>
35+
<div class="tags">
36+
37+
<div class="tag">rust</div>
38+
39+
<div class="tag">bevy</div>
40+
41+
<div class="tag">cargo</div>
42+
43+
</div>
44+
<div class="summary">Figure out what enabled a feature in a crate in your dependencies breaking your build.</div>
45+
<hr />
46+
</div>
47+
3048

3149

3250
<div class="post">

docs/sitemap.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
<lastmod>2024-12-10</lastmod>
2424
</url>
2525
<url>
26-
<loc>https://rustunit.com/blog/2024/12-12-rust-feature-debugging/</loc>
27-
<lastmod>2024-12-12</lastmod>
26+
<loc>https://rustunit.com/blog/2024/12-16-rust-feature-debugging/</loc>
27+
<lastmod>2024-12-16</lastmod>
2828
</url>
2929
<url>
3030
<loc>https://rustunit.com/blog/2024/hello-world/</loc>

0 commit comments

Comments
 (0)