May. 28th, 2013

tim: Tim with short hair, smiling, wearing a black jacket over a white T-shirt (Default)
I don't know how long I've been saying that extern-mod inference was almost working, but now... it's working. What took so long? Just being consistent about paths and naming conventions and such, plus a bug I found today that had to do with the aforementioned copying-the-session hack. Turns out that was a bad idea, because when you build a new session, it makes a copy of the filesearch object and copies the entire additional-library-search-paths vector... exactly the thing I was mutating in the meantime with a mutable reference. So that was no good. I found a way to do it without copying, but I had to change the driver; I've been trying to avoid changing code in rustc itself just to make rustpkg work, but this seemed pretty reasonable. I just made the additional-library-paths vector an @mut ~[Path] instead of a ~[Path]. This seemed fine, since there's plenty of mutable data in sessions already. Since you need a session to call parsing/macro expansion, and finding extern mods has to be done after macro expansion, it's pretty unavoidable that someone will have to modify the library search paths after creating the session.

Just running a final round of make check and I can finally submit a pull request on this. Next, the last bit of extern-mod-related work, which is actually changing the syntax of extern mod so you can put in a full URL and not just an identifier. That's mostly parser work, which shouldn't be hard (famous last words).

I also started filling in the code examples in my Open Source Bridge slides. So far I'm worried that it's too basic, but I guess you can never be too basic.

Thinking ahead a bit:
  • I didn't know, but the compiler already parses extern mod foo ( id = "a/b/c" );, so for now, I'll just have rustpkg look for a special attribute there, and save #6407 for later.
  • Graydon and I agreed to do the most obvious thing for the test runner and have #[test] unit tests that shell out to call rustpkg, and check the output. I already have some unit tests, so it's just a matter of converting the remaining ones.
  • Getting the version (#5684) shouldn't be hard.

And... that'll bring me up to May 20.

Profile

tim: Tim with short hair, smiling, wearing a black jacket over a white T-shirt (Default)
Tim Chevalier

November 2021

S M T W T F S
 123456
78 910111213
14151617181920
21222324252627
282930    

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags