Commit 83a11c9
committed
stdbuf: fix build.rs to propagate custom profiles to libstdbuf nested build
The PROFILE env var only returns the base profile name ('release' or 'debug'),
not the actual profile. For example, when building with --profile=release-small,
PROFILE=release, so the old code would pass --release to the nested libstdbuf
build, causing it to be compiled with release settings instead of release-small
settings (opt-level=z, strip=true, etc.).
Fix this by extracting the actual profile name from OUT_DIR, which always
contains the real profile name in its path (.../target/{profile}/build/...).
This correctly handles all custom profiles like release-small, profiling, etc.
Fixes: #12434
Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>1 parent d41c56b commit 83a11c9
1 file changed
Lines changed: 22 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
88 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
89 | 102 | | |
90 | | - | |
91 | | - | |
92 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
93 | 106 | | |
94 | 107 | | |
95 | 108 | | |
| |||
111 | 124 | | |
112 | 125 | | |
113 | 126 | | |
114 | | - | |
| 127 | + | |
115 | 128 | | |
116 | 129 | | |
117 | | - | |
| 130 | + | |
118 | 131 | | |
119 | 132 | | |
120 | 133 | | |
121 | 134 | | |
122 | 135 | | |
123 | | - | |
124 | | - | |
| 136 | + | |
| 137 | + | |
125 | 138 | | |
126 | 139 | | |
127 | 140 | | |
| |||
0 commit comments