Stream: t-compiler/cargo-bisect-rustc

Topic: nixos support


davidtwco (Jul 12 2020 at 14:49, on Zulip):

Just tried out cargo-bisect-rustc for the first time and it worked great - really awesome work!

I did have to make some changes to get it working on NixOS though (the same issue might affect some other people who work on the compiler, I think eddyb, nagisa and oli are also NixOS users).

Because cargo-bisect-rustc downloads pre-built toolchains, they won't work out-of-the-box on NixOS where interpreter and shared objects don't live in a normal place, so they have to be run through patchelf to work (e.g. rustup is patched to do this on NixOS).

You can find the patch I've made here - which might be useful for anyone else that has this issue. I'm not sure how easy it would be to transform into something upstreamable.

nagisa (Jul 12 2020 at 14:50, on Zulip):

You can avoid the --set-interpreter by just calling interpreter directly (i.e. ld-linux.so.1 $command $args.

davidtwco (Jul 12 2020 at 14:51, on Zulip):

How would I do that when cargo-bisect-rustc is invoking the compiler?

nagisa (Jul 12 2020 at 14:51, on Zulip):

similarly for --rpath, just set LD_LIBRARY_PATH. That should reduce the overhead of spawning the compiler at least somewhat.

davidtwco (Jul 12 2020 at 14:52, on Zulip):

nagisa said:

similarly for --rpath, just set LD_LIBRARY_PATH. That should reduce the overhead of spawning the compiler at least somewhat.

that probably would have been an easier solution

nagisa (Jul 12 2020 at 14:52, on Zulip):

IIRC cargo-bisect-rustc had arguments that allowed you to modify exactly how it spawns things

Chris Simpkins (Jul 12 2020 at 14:52, on Zulip):

Something that we should add to the docs?

nagisa (Jul 12 2020 at 14:52, on Zulip):

I think you can supply it with the test command or something? I remember writing a wrapper shell script that invoked rustc the right way and passing it into cargo-bisect-rustc, but it was a while ago.

davidtwco (Jul 12 2020 at 14:53, on Zulip):

ah, I could have used --script and LD_LIBRARY_PATH, I see

davidtwco (Jul 12 2020 at 14:53, on Zulip):

well, I over-complicated this - hopefully it's still useful to someone

nagisa (Jul 12 2020 at 14:53, on Zulip):

Yeah, its cool ^^

nagisa (Jul 12 2020 at 14:53, on Zulip):

/me'd use it if they don't forget it before next time they need to bisect

Chris Simpkins (Jul 12 2020 at 14:53, on Zulip):

Sorry! The documentation could use an update. We've added quite a bit since we last touched the docs

davidtwco (Jul 12 2020 at 14:54, on Zulip):

I saw --script in the docs, I just didn't think to use it to workaround my issue with the interpreter.

Chris Simpkins (Jul 12 2020 at 14:59, on Zulip):

Definitely check out the --access github option if you haven't discovered it yet. Saves a good deal of time

Last update: Nov 25 2020 at 03:00UTC