Apologies for my delay in posting this; I’m used to dealing with one problem at a time when it comes to Homebrew just to be careful within its host system directory, and I was distracted by a stall in resolving another one with a WIP PR. On a note more relevant here, a ‘TL;DR’, summary of my current status on this, a request for advice on how best to report the multiple issues involved here, and some additional debugging information all follow, though not necessarily in that order, at the bottom of this post.

For some odd reason, my machine seems to think this PR introduced a dependency cycle between librsvg.rb and rust.rb even though, looking at it, the latter doesn’t seem to have a dependency on the former declared in it… Whatever the reason, that’s stragne! In any case, I’m going to try some more troubleshooting tactics beyond what I’ve already gone through here on my end before I file an issue, and those will also have to wait until I finish filing another issue I’m currently collecting logs for (boy, when it rains, it definitely pours for me…grrrrr.) Hopefully it’s probably just something wonky to do with my local configuration and/or odd Homebrew usage tendencies, but I’m not exactly looking forward to debugging this (on top of libRSVG and Rust not liking at the moment, their antics are blocking an ImageMagick upgrade for me, the scurvy dogs.)

P. S.: Please pardon the scathing rhetoric, folks; I’m just a bit peeved at computers in general at the moment, but it’ll pass…; deep breaths, deep breaths… (Takes some.)

Me again:

@tschoonj, @vinyldarkscratch, and/or @fxcoudert:

Never mind, I found the source of Rust’s dependency on libRSVG: it’s through its formula’s --with-llvm option (I was trying to avoid waiting for Homebrew to finish building Rust’s vendors LLVM since I already have a copy of the compiler toolchain suite installed, you see)…and I have Homebrew’s LLVM built and installed with its formula’s --with-graphviz option and my Homebrew copy of Graphviz built and installed with its formula’s --with-librsvg option. Then libRSVG tries to pull in Rust again since the former now requires the latter, and…Homebrew makes itself a bit dizzy. Fun. I think I’ll ask what exactly I should do about this as a continuation of this discussion on the project Discourse, quoting the stuff I’ve posted here, so that I don’t bloat this PR discussion thread further.

Also me:

@tschoonj, @vinyldarkscratch, and/or @fxcoudert: As the last peep I intend to make here (though I might be persuaded otherwise if any of really need a reply from me here on/about something) bond pointing toward the Discourse thread I said I’d start, I just wanted to leave a heads up: I think I’m going to save this mess for tomorrow, so said thread likely won’t appear until some time tomorrow.

@tschoonj:

Not sure what the best course of action is here. You ran into trouble because of three librsvg dependencies that were built with :optional dependencies, which is not going to be a very commonly observed scenario… How about removing the --with-llvm option from the rust formula?

My reply to that:

@tschoonj:

If you mean to say that’s what you propose globally for all users of Homebrew Core, then that would only be a solution until Rust finishes getting all of its LLVM patches upstreamed, after which the language’s in-tree copy of the compiler toolchain suite would likely go away. If you mean to suggest that I simply attempt a build of Rust without --with-llvmlocally, then I’ve tried that before and gotten a different error which I’ll report separately. Just for full preliminary disclosure, said issue appears to occur whether libRSVG takes care of its own dependencies and triggers a Rust build all by itself when I just brew upgrade the former package only or I attempt to build Rust separately to satisfy this new libRSVG dependency beforehand. This gives the impression that its independent of any difference between what happens when libRSVG’s invokes its automated Rust build without --with-racer or when I have Homebrew build Rust separately --with-racer (I’d appreciate code completion, personally.)

ensured that brew has built and installed libRSVG’s Rust dependency rust from source --with-llvm, among any other chosen options

ensured that brew has built and installed Rust’s optional LLVM dependency llvm from source --with-graphviz, among any other chosen options

ensured that brew has built and installed LLVM’s optional Graphviz dependency graphviz from source --with-librsvg, among any other chosen options

using brew install, brew upgrade, and/or brew reinstall (as needed depending on the in-Homebrew installation status of each of those formula’s related software packages) with or without either the --build-from-source option and/or the HOMEBREW_BUILD_FROM_SOURCE environment variable set to 1 as desired to achieve the intended results. What results is an unresolvable circular dependency between libRSVG and its Rust dependency that causes build-time misbehavior and, eventually, a crash of the build process or processes involved.
I’m initially reporting this here on Discourse because Homebrew users like myself are not supposed to submit issues involving builds from source forced by setting HOMEBREW_BUILD_FROM_SOURCE=1 to GitHub, at least not without also proving that said issue(s) also occur without that environment variable set. Given the involvement of nested dependencies, all built from source, in this issue’s manifestation, I anticipate that trying to reproduce it in the normal way would fail, as Homebrew would pick up bottled versions of all of libRSVG’s dependencies even when building the requested package itself from source. Fiddling around with using --ignore-dependencies in any of the command invocations I tried didn’t help me troubleshoot this issue. Any further troubleshooting advice, though admittedly unlikely due to the obscure/obtuse nature of this issue, or suggestions on how to report this issue in an acceptable manner (likely by filing multiple issues of some sort if I can somehow figure out how to reproduce this one without my preferred recursive enforcement of building from source enabled, though, again, I doubt that’s possible in this case) would be greatly appreciated.
All that being said, I’ve thought of the following possible workaround which might work:

Have Homebrew install Rust, but don’t use said software’s formula’s --with-llvm while building/installing it at first.

Upgrade libRSVG using that Rust to begin with as a stop-gap measure.

Rebuild and reinstall Rust, this time --with-llvm.

Reinstall libRSVG using this final Rust build.

Unfortunately, attempting step one of that workflow didn’t work for me, as it resulted in another issue. That one, however, is one I can report on GitHub (in that Rust and/or its bundled LLVM wouldn’t build regardless of whether HOMEBREW_BUILD_FROM_SOURCE=1 was set due to one of its build sub-processes complaining that it couldn’t find CMake even though all of its parent processes could, oddly enough; I’ve no idea why that is…)
Additionally, I thought I might give the output of running brew deps --tree --include-build --include-optional --include-requirements --annotate librsvg here (probably overkill, I suspect, but perhaps the additional information could be useful,) but it didn’t end up fitting in my initial post to this thread, so I’ll provide it separately in a follow-up post. I can provide additional debugging information, such as that typically requested of users when they file issues on GitHub, here on request. Hopefully that’s everything for now…

P. S.: Hmm, I guess that wasn’t much of a ‘TL;DR’ summary in and of itself due to its additional length, now, was it?

(Which reminds me: when I finally have a clean Homebrew setup with nothing out of date again, I should probably report the slight grammatical/typographical unsightliness that results from dependencies annotated as optional in such reports not having a closing right parenthesis on the annotations that mark them as such…)

OK, now that’s…quite odd. I’ve been seeing consistent build crashes when trying to build Rust --with-racer within the past week or so…and now it’s built successfully, thus allowing me to use my postulated workaround. I call that downright weird: the only change to the Rust formula that I can find was made within even just the past month is Homebrew Core PR #22796 — and the issue that pulls down a patch for has absolutely nothing to do with my system’s configuration…!? (I’m still on OS X v10.11.6 ‘El Capitan’ due to system constraints, which of course rules out anything APFS-related, if I know my OS versions right.) How the issue could have been intermittent and, if so, what in the blazes its one or more underlying dependencies might have been is just boggling my mind in eluding me. The only thing of note that I’ve done recently is take this old clunker of a machine over to my grandparents’ house when I visited there over the weekend, and I obviously can’t see how anything I’d’ve done there would have changed things, either. (Changes in Wi-Fi network connectivity settings can’t possibly affect whether a CMake invocation succeeds or fails when said invocation doesn’t, as far as I know, depend on any such possible affected network in any conceivable way.) Utterly strange, I tell you… Guess I’ll just call it a night and be grateful I can get my system back to a cleaner, more up-to-date state in the morning, eh? For now, I’m off to bed (I thought I’d leave my Rust build attempt on overnight, but it finished just as I came to check on it…)