You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code assumes that if we walk up from the out_dir that cargo creates for the crate, we will eventually either hit a directory whose name matches the "target-triple", in this case x86_64-unknown-linux-gnu, or that matches the profile, in this case "release". However, when using the named profile "mobile", the directory will be called "mobile" and not "release".
In mc-util-build-script, instead of searching for a directory whose name matches PROFILE, we should search for a directory whose name matches "target", and then back up one when we find that, so that builds using named profiles will work as expected without workarounds.
The text was updated successfully, but these errors were encountered:
Steps to reproduce:
Go to
libmobilecoin
(orandroid-bindings
) and attempt to build in the mobile profile:Here we reproduce the issue inside the dev docker container:
(The log contains some debugging output that I added)
The issue occurs at this line:
https://github.com/mobilecoinfoundation/mobilecoin/blob/bcb3e26cc85afd3a250f2109e9cd388c0e5c814a/util/build/script/src/env.rs#L226
The code assumes that if we walk up from the
out_dir
that cargo creates for the crate, we will eventually either hit a directory whose name matches the "target-triple", in this casex86_64-unknown-linux-gnu
, or that matches the profile, in this case "release". However, when using the named profile "mobile", the directory will be called "mobile" and not "release".This script is deducing the profile using
PROFILE
env: https://github.com/mobilecoinfoundation/mobilecoin/blob/bcb3e26cc85afd3a250f2109e9cd388c0e5c814a/util/build/script/src/env.rs#L224But this is documented: https://doc.rust-lang.org/cargo/reference/environment-variables.html
and doesn't appear to be updated when the named-profiles feature is used.
As a workaround, the build works if we pass cargo the target explicitly:
Proposal:
In
mc-util-build-script
, instead of searching for a directory whose name matchesPROFILE
, we should search for a directory whose name matches"target"
, and then back up one when we find that, so that builds using named profiles will work as expected without workarounds.The text was updated successfully, but these errors were encountered: