-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't tries to determine correct target #68
Comments
As an first ugly hot-fix I could suggest something like following. Instead of that let target = env::var_os("AUTOCONF_TARGET").or_else(|| env::var_os("TARGET"))?; So we can override the target passed to autoconf with env |
I think would prefer to have Cargo pass through the But even with the right target spec (especially if it can be found in |
I agree, but this issue is about more than just build-std, you know. |
I've did some research and realized that it's impossible to guess where spec-file is in most cases, as well as some other necessary info. So I filled proposal-issue rust-lang/cargo/issues 14208. |
I'm considering that override hack, but one thing is that I think it should only take effect for In theory, we should also emit |
For this we can compare env vars
If I remember correctly...
Here is the problem. We can't know for sure what it is. And we can't guess because it's very likely that we won't find the json file (our WPD != initial PWD, same for .ext, also there can be symlinks), because only cargo knows the absolute file path. You know. |
It doesn't know that For anything that comes from your cargo proposal, yes it should automatically handle changes. |
Yes, now Ive got it, thanks for explanation. I suppose we should try to tell cargo to track, firstly. If it really break incremental builds (causes full rebuild every time), so will think. May be that isn't good decision. But I think that in ordinary pipeline the |
As we all know, env
TARGET
contains rustc's "short target name", not exactly target-triple. It can be triple only if builtin target requested. So autoconf can't use it to probe if some custom target requested, e.g. for--target=my-spec.json
envTARGET
will be"my-spec"
.There are many problems about it, here is just one for example.
It could be great to
rustc --print cfg --target my-spec
or any other "tell me something about this target" (?)0
if yes!= 0
if unknown / not found, that means that spec is not in$PWD
or rustc's target dir (or just invalid)$PWD/my-spec.json
for requested--target my-spec
(without ext)$PWD
point to the crate root in most cases, so it where we probably can findmy-spec.json
if needed, or not 🤷🏻♂️rustc
returns error we can try to construct kinda "compatible base target" (?) with env like this:unknown
andnone
respectively.$PWD/my-spec.json
(or$CARGO_MANIFEST_DIR/my-spec.json
) and then use full path of it as target for probesActual error on probe:
The text was updated successfully, but these errors were encountered: