<?xml version='1.0' encoding='utf-8' ?>

<rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/' xmlns:atom10='http://www.w3.org/2005/Atom'>
<channel>
  <title>Tim&apos;s journal</title>
  <link>https://tim.dreamwidth.org/</link>
  <description>Tim&apos;s journal - Dreamwidth Studios</description>
  <lastBuildDate>Sat, 09 Nov 2013 02:38:58 GMT</lastBuildDate>
  <generator>LiveJournal / Dreamwidth Studios</generator>
  <lj:journal>tim</lj:journal>
  <lj:journaltype>personal</lj:journaltype>
  <image>
    <url>https://v2.dreamwidth.org/6843885/234887</url>
    <title>Tim&apos;s journal</title>
    <link>https://tim.dreamwidth.org/</link>
    <width>72</width>
    <height>100</height>
  </image>

<item>
  <guid isPermaLink='true'>https://tim.dreamwidth.org/1832202.html</guid>
  <pubDate>Sat, 09 Nov 2013 02:38:58 GMT</pubDate>
  <title>TMI: Changing Roles</title>
  <link>https://tim.dreamwidth.org/1832202.html</link>
  <description>Six weeks short of what would have been my two-year anniversary as a Mozilla full-timer (January 1, 2014), I&apos;ve decided to leave Mozilla to work at a startup, &lt;a href=&quot;http://alephcloud.com/&quot;&gt;AlephCloud&lt;/a&gt;. I&apos;ve worked at Mozilla for longer than I&apos;ve worked at any other full-time job: first six months as an intern, and now a year and ten months as a Research Engineer.&lt;br /&gt;&lt;br /&gt;Some people leave a job and say that they&apos;re ready to move on. I wasn&apos;t ready, and I still had a lot to contribute to Rust. I just didn&apos;t see any way that I could continue contributing to it as a Mozilla employee. I&apos;m unlikely to elaborate on that further except in private over a beer or a cup of tea.&lt;br /&gt;&lt;br /&gt;I still hope to contribute to Rust as a volunteer. I know it&apos;s BS to say &quot;hope&quot; when talking about work; if I end up feeling like I want to do it enough, I know that I will, and if I don&apos;t, I know that I won&apos;t. That said, if I find myself with time to contribute to any open source project at all, it&apos;ll be Rust. For sure, I&apos;m committed to mentoring a Rust intern through &lt;a href=&quot;http://tim.dreamwidth.org/1829830.html&quot;&gt;GNOME OPW&lt;/a&gt;, and I&apos;ll still be committed to doing that even as a volunteer. Thus, I&apos;ll still be the contact person for anyone still interested in working on a Rust project through OPW. &lt;a href=&quot;https://mozillians.org/en-US/u/lshapiro/&quot;&gt;Larissa Shapiro&lt;/a&gt; will take over the role coordinator for this round of Mozilla&apos;s participation in OPW.&lt;br /&gt;&lt;br /&gt;That said, I can&apos;t commit to continuing my work on rustpkg while a volunteer, so I&apos;m hoping to be able to identify a new owner for it. I&apos;ve talked with one person on the core team who would like to take over ownership, and will try to settle the question before my last day.&lt;br /&gt;&lt;br /&gt;On a personal level, I&apos;ve grown a lot over the past two years. I mean both that I&apos;ve learned a lot about software, and that I&apos;ve grown as a person. Moreover, I think I understand a lot more about how the software industry works than I did at the beginning of 2011. In general, my colleagues on the Mozilla Research team have set an example both for how to build software, and how to build a community. I wish nothing but success to the Rust project, and what&apos;s more, I intend to continue to be there to help the project advance, even if it&apos;ll be for a smaller percentage of my time. &lt;br /&gt;&lt;br /&gt;My last day as a Mozilla employee will be Friday, November 15, and with just a weekend in between, I&apos;m starting at AlephCloud on Monday, November 18, in the role of Principal Software Engineer. At AlephCloud, I will be programming in Haskell full-time. I wasn&apos;t exactly ever expecting to be active in the Haskell community again, but I look forward to doing work that is central to the mission of my company, and it&apos;s icing on the cake that the company&apos;s language of choice happens to be Haskell. Though I expect I&apos;ll be working from various locations, my new office will be in Sunnyvale, so I&apos;m not going far. Especially since my two closest future colleagues both work remotely (outside the Bay Area), I&apos;m hoping to experiment with living outside the Bay Area for a while (student loans don&apos;t pay themselves), but I&apos;ll only consider that after a couple of months from now.&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=tim&amp;ditemid=1832202&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://tim.dreamwidth.org/1832202.html</comments>
  <category>research</category>
  <lj:security>public</lj:security>
  <lj:reply-count>4</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://tim.dreamwidth.org/1829830.html</guid>
  <pubDate>Fri, 18 Oct 2013 22:03:56 GMT</pubDate>
  <title>TMI: Rust and Servo participating in the GNOME Outreach Program for Women this year</title>
  <link>https://tim.dreamwidth.org/1829830.html</link>
  <description>I&apos;ve mostly been quiet lately since a lot of what I&apos;ve been doing is wrestling with Linux test bots that behave slightly differently from other Linux test bots, and that&apos;s not very useful to write about (plus, if I did, it would mostly be swearing). However, I do want to make an exciting announcement! &lt;a href=&quot;https://mail.mozilla.org/pipermail/rust-dev/2013-October/006036.html&quot;&gt;Copied verbatim from the mailing list&lt;/a&gt;:&lt;hr&gt;Hello,&lt;br /&gt;&lt;br /&gt;This year, the Rust and Servo projects are participating in the GNOME &lt;br /&gt;Outreach Program for Women (OPW). OPW is an opportunity for women to &lt;br /&gt;take on a paid, full-time, three-month internship working on one of &lt;br /&gt;several open-source projects. Interns can be located anywhere in the &lt;br /&gt;world and will primarily work from home; some funding will be available &lt;br /&gt;to travel to meet with the project mentors for a brief period of time.&lt;br /&gt;&lt;br /&gt;This is the third time that Mozilla has participated as a source of &lt;br /&gt;project mentors, but it&apos;s the first time that the Rust and Servo &lt;br /&gt;projects specifically have participated. We&apos;re very excited about this &lt;br /&gt;and encourage you to apply if you&apos;re a woman who&apos;s interested in Rust. &lt;br /&gt;(OPW is an inclusive program: as per their information for applicants, &lt;br /&gt;&quot;This program is open to anyone who is a female assigned at birth and &lt;br /&gt;anyone who identifies as a woman, genderqueer, genderfluid, or &lt;br /&gt;genderfree regardless of gender presentation or assigned sex at birth. &lt;br /&gt;Participants must be at least 18 years old at the start date of the &lt;br /&gt;internship.&quot;) If you&apos;re not eligible, please spread the word to any &lt;br /&gt;eligible individuals you know who have any interest in Rust or Servo.&lt;br /&gt;&lt;br /&gt;No previous experience with Rust is required, but we do request some &lt;br /&gt;experience with C and systems programming, and of course people who have &lt;br /&gt;previously used Rust may make faster progress.&lt;br /&gt;&lt;br /&gt;The deadline to apply is November 11.&lt;br /&gt;&lt;br /&gt;The details are available at:&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://wiki.mozilla.org/GNOME_Outreach_December2013&quot;&gt;https://wiki.mozilla.org/GNOME_Outreach_December2013&lt;/a&gt; (specific to Mozilla)&lt;br /&gt;&lt;a href=&quot;https://wiki.gnome.org/OutreachProgramForWomen&quot;&gt;https://wiki.gnome.org/OutreachProgramForWomen&lt;/a&gt; (applying to OPW)&lt;br /&gt;&lt;br /&gt;If you are not a woman, but interested in an internship working on Rust, &lt;br /&gt;never fear! If you are currently enrolled in an undergraduate or &lt;br /&gt;graduate program, you can apply for an internship at Mozilla Research &lt;br /&gt;for the winter, spring, or summer term. (Note that OPW is open to both &lt;br /&gt;students and non-students.) We will be announcing this program to the &lt;br /&gt;mailing list as well as soon as the details are finalized.&lt;br /&gt;&lt;br /&gt;If you have any questions, please join #opw on irc.mozilla.org and/or &lt;br /&gt;contact Tim Chevalier (tchevalier at mozilla.com, tjc on IRC) (Rust contact &lt;br /&gt;person) or Lars Bergstrom (lbergstrom at mozilla.com, lbergstrom on IRC) &lt;br /&gt;(Servo contact person).&lt;hr&gt;I&apos;m coordinating Mozilla&apos;s involvement in OPW this year as well as any potential Rust projects (others may end up mentoring interns depending on the intern&apos;s preferred project, but the buck stops with me), so I&apos;d be very grateful if readers would publicize this notice to relevant venues, as well as direct any questions to me (via email, IRC, or in a comment on this post).&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=tim&amp;ditemid=1829830&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://tim.dreamwidth.org/1829830.html</comments>
  <category>research</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://tim.dreamwidth.org/1828264.html</guid>
  <pubDate>Tue, 08 Oct 2013 02:08:01 GMT</pubDate>
  <title>TMI: Summit and beyond</title>
  <link>https://tim.dreamwidth.org/1828264.html</link>
  <description>The last five days have been one full day of travel, preceded by three full days of &lt;a href=&quot;http://summit.mozilla.org/&quot;&gt;Mozilla Summit&lt;/a&gt; in Toronto, preceded by another full day of travel. It&apos;s been quite a time, with not much sleep involved, but (for me) a surprising amount of code getting written &lt;i&gt;and&lt;/i&gt; interesting sessions being attended &lt;i&gt;and&lt;/i&gt; pure fun being had (karaoke night Friday and dance party Sunday -- if any of the organizers were reading, both of those were &lt;i&gt;really good ideas&lt;/i&gt;). Actually, watching &lt;a href=&quot;http://clickmovement.org/coderush&quot;&gt;&quot;Code Rush&quot;&lt;/a&gt; -- a documentary made in 2000 about the very early history of Mozilla -- with Mozilla folks was quite an experience as well. You can watch it for free online; it&apos;s only about an hour, and I encourage you to if you have any interest at all in where we came from. (Passive sexism and other kinds of isms aside.)&lt;br /&gt;&lt;br /&gt;So far as sessions, one of the highlights was Jack&apos;s talk on the Servo strategy on Saturday -- featuring about 30 minutes of lecture followed by a full &lt;i&gt;80 minutes&lt;/i&gt; of Q&amp;A. The questions were the most focused, on-topic, respectful set of questions I&apos;ve heard after any talk I&apos;ve been to in recent memory (and it wasn&apos;t just because Jack prepared &lt;a href=&quot;https://etherpad.mozilla.org/summit-sessions-saturday-understandingservo&quot;&gt;a list of suggested questions to ask&lt;/a&gt; in advance!) The other highlight for me was the excellent &quot;Designing your project for participation&quot; session with David Eaves, Emma Irwin, and Jess Klein on Sunday. One of the reasons why this session was so great was that it was mostly small-group discussion, so everybody got to be more engaged than they might have been if most of the time had been sitting and listening. I came away with a better understanding that a lot of different people are thinking about how to make the volunteer experience better in their specific project, and there are lessons to learn about that that are transferable. For example: volunteers are much more likely to keep participating if they get a prompt review for their first bug; and, it might actually be okay to ask volunteers to commit to finishing a particular task by a deadline.&lt;br /&gt;&lt;br /&gt;During downtime, I got a few pull requests in, some of which even landed. One of the bigger ones, though, was &lt;a href=&quot;https://github.com/mozilla/rust/pull/9732&quot;&gt;#9732&lt;/a&gt;, for making automatically checked-out source files read-only and overhauling where rustpkg keeps temporary files. (That one hasn&apos;t been reviewed yet.) &lt;a href=&quot;https://github.com/mozilla/rust/pull/9736&quot;&gt;#9736&lt;/a&gt;, making it easier to get started with rustpkg by not requiring a workspace to be created (it will build files in the current directory if there&apos;s a crate file with the right name) is also important to me -- alas, it bounced on the Linux bot, like so many of my pull requests have been doing lately, so I&apos;ll have to investigate that when I&apos;m back on the office network and able to log in to that bot tomorrow. Finally, I was excited to be able to fix &lt;a href=&quot;https://github.com/mozilla/rust/pull/9756&quot;&gt;#9756&lt;/a&gt;, an error-message-quality bug that&apos;s been biting me a lot lately, while I was on the plane back to San Francisco, and surprised that the fix was so easy!&lt;br /&gt;&lt;br /&gt;Finally, I request that anyone reading this who&apos;s part of the Rust community read &lt;a href=&quot;http://lindseykuper.livejournal.com/418854.html&quot;&gt;Lindsey Kuper&apos;s blog post&lt;/a&gt; about the IRC channel and how we should be treating each other. Lindsey notes, and I agree, that the incident that she describes is an anomaly in an otherwise very respectful and decorous IRC channel. However, as the Rust community grows, it&apos;s my job, and the job of the other core Rust team members, to keep it that way. I know that communities don&apos;t stay healthy by themselves -- every community, no matter how small, exists within a &lt;a href=&quot;http://en.wikipedia.org/wiki/Kyriarchy&quot;&gt;kyriarchy&lt;/a&gt; that rewards everybody for exercising unearned power and privilege. Stopping people from following those patterns of non-consensual domination and submission -- whether in such a (seemingly) small way as inappropriately calling attention to another person&apos;s gender on IRC, or in larger ways like sexual assault at conferences -- requires active effort. I can&apos;t change the world as a whole on my own, but I do have a lot of influence over a very small part of the world -- the same is true of most other human beings. So, I&apos;m still thinking about how to put in that effort for Rust. The same is true for community processes as for code: patches welcome.&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=tim&amp;ditemid=1828264&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://tim.dreamwidth.org/1828264.html</comments>
  <category>research</category>
  <lj:security>public</lj:security>
  <lj:reply-count>1</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://tim.dreamwidth.org/1826851.html</guid>
  <pubDate>Wed, 02 Oct 2013 06:13:11 GMT</pubDate>
  <title>TMI: Bringing rustpkg into the real world</title>
  <link>https://tim.dreamwidth.org/1826851.html</link>
  <description>Once &lt;a href=&quot;https://github.com/mozilla/rust/pull/9654&quot;&gt;#9654 lands&lt;/a&gt; (after ~ 24 hours in the queue, it finally started building only to fail because of an overly long line... and I thought I checked that every time I pushed a new version, but apparently not), we&apos;ll have completed the &quot;build Servo with rustpkg&quot; milestone. The next milestone is the first part of &lt;a href=&quot;https://github.com/mozilla/rust/wiki/Rustpkg-schedule&quot;&gt;community adoption&lt;/a&gt;, which, roughly speaking, is the list of features we think rustpkg has to have in order for it to get widespread use in the Rust community (such as it is).&lt;br /&gt;&lt;br /&gt;The first thing on that list, which I started working on today, is &lt;a href=&quot;https://github.com/mozilla/rust/issues/6480&quot;&gt;#6480&lt;/a&gt;: making locally-cached copies of source files that rustpkg automatically fetched from github (or, in the future, elsewhere) read-only. The intent behind this bug is to prevent &lt;a href=&quot;http://forums.thedailywtf.com/forums/t/27755.aspx&quot;&gt;a sad situation&lt;/a&gt; -- that really happened to a Go developer, and could happen again with a similar package manager -- where somebody makes local changes to packages that their projects depends on without realizing they&apos;re editing automatically-fetched files, and then loses those changes when they redistribute the code (without their local changes).&lt;br /&gt;&lt;br /&gt;One solution is for rustpkg to make any source files that it automatically fetches read-only. Of course, anybody can just change the permissions, but that requires deliberate action and (with hope) will remind people that they might be making a poor life decision. That&apos;s easy enough to implement, and in fact, I implemented it today.&lt;br /&gt;&lt;br /&gt;But I realized that this really goes along with another issue I filed, &lt;a href=&quot;https://github.com/mozilla/rust/issues/9514&quot;&gt;#9514&lt;/a&gt;. Servo depends on many packages that the Servo developers are also hacking on in tandem with hacking on Servo -- so if we started making everything read-only, that would make it hard to work with local (uncommitted) changes.&lt;br /&gt;&lt;br /&gt;I think the right thing to do (and as per discussion in meetings, it sounds like it&apos;s the general consensus) is to make rustpkg do two things differently: (1) store fetched sources in a subdirectory of a workspace&apos;s &lt;tt&gt;build&lt;/tt&gt; directory, not its &lt;tt&gt;src&lt;/tt&gt; directly (it&apos;s less confusing if &lt;tt&gt;src&lt;/tt&gt; is only things you created yourself); and (2) always search for sources under &lt;tt&gt;src&lt;/tt&gt; before searching under &lt;tt&gt;build&lt;/tt&gt;. That way, if you want to make local changes to a package that you refer to with an &lt;tt&gt;extern mod&lt;/tt&gt; that points to a remote package, you can manually &lt;tt&gt;git clone&lt;/tt&gt; the sources for it under a workspace&apos;s &lt;tt&gt;src&lt;/tt&gt; directory, and then rustpkg will automatically find your locally-changed copy (which it will also never overwrite with newly fetched sources).&lt;br /&gt;&lt;br /&gt;I looked at &lt;a href=&quot;http://golang.org/cmd/go/#hdr-Compile_packages_and_dependencies&quot;&gt;what Go does&lt;/a&gt;, and it looks like it does more or less what I want to do in rustpkg: &quot;By default, get uses the network to check out missing packages but does not use it to look for updates to existing packages.&quot; So, the only case where rustpkg will pull a fresh copy of a repository off github is if there&apos;s no local copy of the sources, or installed version of the binaries for it, that can be found by searching the RUST_PATH.&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=tim&amp;ditemid=1826851&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://tim.dreamwidth.org/1826851.html</comments>
  <category>research</category>
  <lj:security>public</lj:security>
  <lj:reply-count>2</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://tim.dreamwidth.org/1826736.html</guid>
  <pubDate>Tue, 01 Oct 2013 06:43:44 GMT</pubDate>
  <title>TMI: Building C dependencies in custom build scripts</title>
  <link>https://tim.dreamwidth.org/1826736.html</link>
  <description>It&apos;s been a while since my last Rust blog post. The latest thing that&apos;s happened is that I just submitted &lt;a href=&quot;https://github.com/mozilla/rust/pull/9654&quot;&gt;a pull request&lt;/a&gt; that gives rustpkg packages that have custom build scripts the ability to have C dependencies (or, in fact, dependencies on any sort of artifact that you can write a Rust program to build). There&apos;s no magic here -- in fact, for the most part, it&apos;s just a matter of writing &lt;a href=&quot;https://github.com/catamorphism/rust/blob/bd1cbb33cab782dc0d966ecd645c45aa3551e5be/src/librustpkg/testsuite/pass/src/c-dependencies/pkg.rs&quot;&gt;an example&lt;/a&gt; to show what needs to be done. Someday there will be a higher-level interface to rustpkg where you can just declare some source file names and rustpkg will do the rest, but not today. In the meantime, the build script explicitly sets up a workcache context and declares foreign source files as inputs, and so on.&lt;br /&gt;&lt;br /&gt;The thing I did have to change in rustpkg itself was changing the &lt;tt&gt;install_pkg&lt;/tt&gt; function (in the API that build scripts can call) so as to take a vector of extra dependencies. Currently, the types of dependencies supported are files (any source files, which get checked for freshness based on hashing their contents and metadata) and binaries (any files at all, which get checked for freshness based on their modification times).&lt;br /&gt;&lt;br /&gt;Completing this bug means that (once it&apos;s reviewed and merged) I&apos;ll have completed the &quot;build all of Servo&quot; milestone for rustpkg, and &lt;a href=&quot;https://github.com/mozilla/rust/wiki/Rustpkg-schedule&quot;&gt;on time&lt;/a&gt;, no less (albeit with less than 30 minutes remaining). Jack has been steadily working on actually building Servo with rustpkg, discovering many issues in the process, and once this pull request is merged, we should be able to do the rest.&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=tim&amp;ditemid=1826736&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://tim.dreamwidth.org/1826736.html</comments>
  <category>research</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://tim.dreamwidth.org/1825515.html</guid>
  <pubDate>Tue, 17 Sep 2013 02:34:51 GMT</pubDate>
  <title>TMI: The sweet taste of passing tests</title>
  <link>https://tim.dreamwidth.org/1825515.html</link>
  <description>I&apos;ve got tests passing for my fix for &lt;a href=&quot;https://github.com/mozilla/rust/issues/7879&quot;&gt;#7879&lt;/a&gt;, making dependencies work more sensibly. I was proud of my voluminous &lt;a href=&quot;http://benjamin.smedbergs.us/weekly-updates.fcgi/user/catamorphism%40gmail.com&quot;&gt;status update&lt;/a&gt; for the past week, so it was a bit sad to only work on one bug today. It was a hard one, though, and I finished it! Aside from fixing tidy errors and such, anyway.&lt;br /&gt;&lt;br /&gt;Amusingly/frustratingly enough, I did the real work over the weekend and the work I did today was almost completely centered around testability. I realized I can&apos;t use timestamps from &lt;tt&gt;stat()&lt;/tt&gt; to ensure that a given file wasn&apos;t rebuilt. &lt;a href=&quot;https://github.com/mozilla/rust/issues/9240&quot;&gt;Someone else&lt;/a&gt; discovered this too: time granularity on Unix is only 1 second, so it&apos;s easy for two files that get created in quick succession, but sequentially, to have equal timestamps. Next idea was to compare hashes (which is what workcache already does!), but that won&apos;t do since if no dependencies have changed, but a file gets rebuilt anyway, it&apos;s likely to be bitwise identical. Jack suggested making the test case set the output to be read-only so that in case the second invocation of rustpkg tries to overwrite it, that would be an error. This required a little bit of fiddling due to details about conditions and tasks that I fought with before (see &lt;a href=&quot;https://github.com/mozilla/rust/issues/9001&quot;&gt;#9001&lt;/a&gt;), but the basic approach works.&lt;br /&gt;&lt;br /&gt;So I can get a pull request in for this tomorrow, and happily, it&apos;s likely to fix several other bugs without additional work (or with minimal work): #7420, #9112, #8892, #9240, and I&apos;m probably missing some.&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=tim&amp;ditemid=1825515&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://tim.dreamwidth.org/1825515.html</comments>
  <category>research</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://tim.dreamwidth.org/1824647.html</guid>
  <pubDate>Sat, 14 Sep 2013 01:33:43 GMT</pubDate>
  <title>TMI: Packages vs. crates</title>
  <link>https://tim.dreamwidth.org/1824647.html</link>
  <description>I landed four pull requests between middle-of-yesterday and now! See &lt;a href=&quot;https://github.com/mozilla/rust/wiki/Rustpkg-schedule&quot;&gt;the schedule&lt;/a&gt; -- #6408, #8524, #7402, and #8672.&lt;br /&gt;&lt;br /&gt;The remaining work that&apos;s necessary for building Servo for rustpkg is making dependencies between crates in the same package work right; building C libraries; and (added today) &lt;tt&gt;rustpkg test&lt;/tt&gt;. I worked mostly on the first one today (but worked a little on making a test case for the second one).&lt;br /&gt;&lt;br /&gt;A community member reported &lt;a href=&quot;https://github.com/mozilla/rust/issues/7879&quot;&gt;this bug&lt;/a&gt; about rustpkg going into an infinite loop when compiling a package with two crates in it, where one depends on the other. Digging in, I realized that various parts of rustpkg assume that a package contains either only one crate, or several crates that are all independent of each other. The key thing is that it was computing dependencies at the package level, not the crate level. So if you have a package P containing crates A and B, and B depends on A, rustpkg goes back and tries to compile all the &lt;i&gt;crates&lt;/i&gt; in P first, rather than just compiling &lt;tt&gt;A&lt;/tt&gt;.&lt;br /&gt;&lt;br /&gt;So I&apos;m working on that; it requires some refactoring, but nothing too complicated. I was thinking at first that I would have to topologically sort the dependencies, but after talking to Erick Tryzelaar on IRC, I realized that that approach (the declarative one) isn&apos;t necessary in the framework of workcache, where function calls express dependencies. The issue was just that I was treating packages, rather than crates, as the unit of recompilation.&lt;br /&gt;&lt;br /&gt;This past week was the Servo work week, so today I also spent some time in person working with Jack to get more Servo packages to build with rustpkg. He found a bug in how &lt;tt&gt;extern mod&lt;/tt&gt; works that &lt;a href=&quot;https://github.com/mozilla/rust/pull/9179&quot;&gt;I fixed&lt;/a&gt;, but only after he had to leave for the airport.&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=tim&amp;ditemid=1824647&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://tim.dreamwidth.org/1824647.html</comments>
  <category>research</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://tim.dreamwidth.org/1824040.html</guid>
  <pubDate>Fri, 13 Sep 2013 01:42:10 GMT</pubDate>
  <title>TMI: Busy day</title>
  <link>https://tim.dreamwidth.org/1824040.html</link>
  <description>Today I was able to finish the first three items on the &quot;Build all of Servo&quot; milestone on &lt;a href=&quot;https://github.com/mozilla/rust/wiki/Rustpkg-schedule&quot;&gt;the schedule&lt;/a&gt;: &lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;a href=&quot;https://github.com/mozilla/rust/pull/9146&quot;&gt;Sub-package-IDs&lt;/a&gt; allow you to name a subdirectory of a package directory by its own package ID. For example, if your package &lt;tt&gt;foo&lt;/tt&gt; has an &lt;tt&gt;extras&lt;/tt&gt; directory with several subdirectories, and &lt;tt&gt;foo/extras/baz&lt;/tt&gt; has a crate file in it, you can &lt;tt&gt;rustpkg build foo/extras/baz&lt;/tt&gt; without building the other crates in the &lt;tt&gt;foo&lt;/tt&gt; package. This pull request landed already.&lt;br /&gt;&lt;li&gt;&lt;a href=&quot;https://github.com/mozilla/rust/issues/8524&quot;&gt;Recursive dependencies&lt;/a&gt;: actually, this almost worked before, and it was a matter of fixing a bug that assumed that all of the dependencies for a package (except for system libraries) were in the same workspace. This is building on the bots and should land in another ten minutes or so.&lt;br /&gt;&lt;li&gt;&lt;a href=&quot;https://github.com/mozilla/rust/issues/7402&quot;&gt;Installing to RUST_PATH&lt;/a&gt;: previously, rustpkg would install a package to the same workspace its sources were in. Now, it installs the package to the first workspace in RUST_PATH, if you&apos;ve set a RUST_PATH in the environment; if you didn&apos;t, it defaults to the old behavior. This is in the queue to build.&lt;br /&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ul&gt;I&apos;m working on &lt;a href=&quot;https://github.com/mozilla/rust/issues/8672&quot;&gt;putting build output in a target-specific subdirectory now&lt;/a&gt;, which is easy except for cleaning up all of my crufty test code that made assumptions in lots of different places about the directory structure. Along those lines, I&apos;m also cleaning up some of the test code to make it less crufty.&lt;br /&gt;&lt;br /&gt;I looked at &lt;a href=&quot;https://github.com/mozilla/rust/issues/7879&quot;&gt;#7879&lt;/a&gt; (infinite loop compiling dependencies) too, and it&apos;s harder than I thought; right now, rustpkg assumes it&apos;s okay to build the crates in a multi-crate package in any order. That&apos;s not necessarily true (as the examples given in the original bug and in my comment show) and so rustpkg can end up telling workcache that there&apos;s a circular dependency between two files (when there&apos;s not). I think fixing this will require topologically sorting the crates in a package in dependency order, which in turn will actually require... writing a graph library in Rust, since there isn&apos;t one. So that will be fun, but I don&apos;t have time today.&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=tim&amp;ditemid=1824040&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://tim.dreamwidth.org/1824040.html</comments>
  <category>research</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://tim.dreamwidth.org/1823905.html</guid>
  <pubDate>Thu, 12 Sep 2013 06:13:25 GMT</pubDate>
  <title>TMI: Transitive dependencies</title>
  <link>https://tim.dreamwidth.org/1823905.html</link>
  <description>Today&apos;s pull request: &lt;a href=&quot;https://github.com/mozilla/rust/pull/9132&quot;&gt;making rustpkg find dependencies recursively&lt;/a&gt;. It wouldn&apos;t be much of a build system if it didn&apos;t do that, and it actually almost did without deliberate effort -- the missing piece was making the code that infers dependencies and searches for them actually search different workspaces other than the workspace of the package that has the dependencies. Other than that, it was just a matter of adding a test case, and then &lt;a href=&quot;https://github.com/mozilla/rust/issues/8524&quot;&gt;#8524&lt;/a&gt; can close.&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=tim&amp;ditemid=1823905&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://tim.dreamwidth.org/1823905.html</comments>
  <category>research</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://tim.dreamwidth.org/1823731.html</guid>
  <pubDate>Tue, 10 Sep 2013 23:52:04 GMT</pubDate>
  <title>TMI: Finishing command-line arguments</title>
  <link>https://tim.dreamwidth.org/1823731.html</link>
  <description>I just &lt;a href=&quot;https://github.com/mozilla/rust/pull/9107&quot;&gt;submitted a pull request&lt;/a&gt; that implements most of the commonly-used rustc flags as flags for rustpkg. This took longer than it would have taken if I had taken the approach of just passing any &quot;unknown&quot; flag to rustc, but I think it&apos;s useful for rustpkg to do a bit of checking so as to tell you if you&apos;re passing nonsensical combinations of flag and command. For example, most rustc flags don&apos;t make sense unless you&apos;re either building or installing a package, so rustpkg errors out in those cases (for example, if you do &lt;tt&gt;rustpkg list --opt-level=3&lt;/tt&gt;).&lt;br /&gt;&lt;br /&gt;I didn&apos;t add a test case for every flag, and there&apos;s still some refactoring of boilerplate that could be done, but I prioritized getting this done on schedule over completeness.&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=tim&amp;ditemid=1823731&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://tim.dreamwidth.org/1823731.html</comments>
  <category>research</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://tim.dreamwidth.org/1823009.html</guid>
  <pubDate>Tue, 10 Sep 2013 00:22:27 GMT</pubDate>
  <title>TMI: Command-line arguments</title>
  <link>https://tim.dreamwidth.org/1823009.html</link>
  <description>Now that &lt;a href=&quot;https://github.com/mozilla/rust/pull/9034&quot;&gt;workcache&lt;/a&gt; is in the queue, I&apos;ve moved on to &lt;a href=&quot;https://github.com/mozilla/rust/issues/8522&quot;&gt;teaching rustpkg how to pass command-line flags to rustc&lt;/a&gt;. At first, I thought I was going to implement a syntax like:&lt;br /&gt;&lt;br /&gt;&lt;tt&gt;rustpkg +RUSTC --linker myspeciallinker --emit-llvm -RUSTC build foo&lt;/tt&gt;&lt;br /&gt;&lt;br /&gt;(ripped off GHC&apos;s +RTS/-RTS options), where &lt;tt&gt;+RUSTC&lt;/tt&gt; and &lt;tt&gt;-RUSTC&lt;/tt&gt; delimit arguments that rustpkg should just pass straight to rustc. But then I realized that Rust&apos;s getopts library doesn&apos;t support this kind of flag. I didn&apos;t want to change it, and also realized that many flags are only valid when you&apos;re actually building or installing a package. So, I decided to enumerate the flags you can use in rustpkg (a subset of rustc&apos;s flags), as well as the subset of flags that work only with &lt;tt&gt;build&lt;/tt&gt;, or with &lt;tt&gt;build&lt;/tt&gt; and install.&lt;br /&gt;&lt;br /&gt;So far, this approach is working fine; I&apos;m writing a test for each flag, as well as a test that the same flag gets rejected when in the wrong context. I don&apos;t expect any surprises with this one.&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=tim&amp;ditemid=1823009&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://tim.dreamwidth.org/1823009.html</comments>
  <category>research</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://tim.dreamwidth.org/1822499.html</guid>
  <pubDate>Sat, 07 Sep 2013 06:56:03 GMT</pubDate>
  <title>TMI: workcache: finished!</title>
  <link>https://tim.dreamwidth.org/1822499.html</link>
  <description>Short post, since I stayed up late getting the workcache pull request ready. But: &lt;a href=&quot;https://github.com/mozilla/rust/pull/9034&quot;&gt;the workcache pull request is ready&lt;/a&gt;! Once this lands, I won&apos;t feel like I have to use finger air quotes anymore when saying that I&apos;m working on a build system.&lt;br /&gt;&lt;br /&gt;I thought I might be able to come up with something profound to say about it, but apparently not.&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=tim&amp;ditemid=1822499&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://tim.dreamwidth.org/1822499.html</comments>
  <category>research</category>
  <lj:security>public</lj:security>
  <lj:reply-count>1</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://tim.dreamwidth.org/1822443.html</guid>
  <pubDate>Fri, 06 Sep 2013 06:09:17 GMT</pubDate>
  <title>TMI: Concurrent conditions</title>
  <link>https://tim.dreamwidth.org/1822443.html</link>
  <description>Today, I finished the initial work to integrate rustpkg with the workcache library, so that it remembers dependencies and only recompiles sources when they or their dependencies have changed. I&apos;ll write about that in a later post, though; for now I want to talk about a bug, or infelicity, that I discovered today.&lt;br /&gt;&lt;br /&gt;Conditions are Rust&apos;s answer to exceptions; they&apos;re a lot simpler and more predictable than exceptions, and &lt;a href=&quot;http://static.rust-lang.org/doc/tutorial-conditions.html&quot;&gt;the conditions tutorial&lt;/a&gt; is quite clear, so you should probably just go read that first.&lt;br /&gt;&lt;br /&gt;I&apos;ve tried to exercise conditions a fair bit in rustpkg, since they are a fairly new feature and it&apos;s good to be able to see how they work out. For testing purposes, I wrote one regression test that makes sure the right conditions get raised when you try to install a package that doesn&apos;t exist.&lt;br /&gt;&lt;br /&gt;When I finished with workcache, that test failed. Which was weird at first, since avoiding recompilation shouldn&apos;t affect the behavior of a test that never compiles anything. Eventually, I realized the problem: conditions don&apos;t propagate to different tasks. Before adding workcache, rustpkg was totally single-task; but, when workcache does a unit-of-work-that-can-be-cached, it spawns a new task for it. That&apos;s great, because it means we get parallel compilation for free (at the crate level, anyway). But, it means that if the process of compiling one crate raises a condition, it will manifest as that entire task failing.&lt;br /&gt;&lt;br /&gt;I&apos;m not sure what to do about this in the long term, but for now I just changed that test case to use &lt;tt&gt;task::try&lt;/tt&gt;, which catches task failure, and to test something weaker than it did before (that the task fails, rather than that it raises three particular conditions in sequence).&lt;br /&gt;&lt;br /&gt;That solves my problem, but I&apos;m not totally sure that this interaction between conditions and tasks was intentional, so I &lt;a href=&quot;https://github.com/mozilla/rust/issues/9001&quot;&gt;filed an issue&lt;/a&gt;. It seems to me like it&apos;s confusing to have to know whether a particular piece of code spawns multiple tasks in order to know whether the condition handlers you wrap around it will actually handle all the conditions that that code raises. That seems like an abstraction violation. On the other hand, maybe I&apos;m misguided for thinking that conditions should be used for anything but signaling anomalous cases within a &lt;i&gt;single&lt;/i&gt; task.&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=tim&amp;ditemid=1822443&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://tim.dreamwidth.org/1822443.html</comments>
  <category>research</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://tim.dreamwidth.org/1821842.html</guid>
  <pubDate>Wed, 04 Sep 2013 01:12:29 GMT</pubDate>
  <title>TMI: workcache progress</title>
  <link>https://tim.dreamwidth.org/1821842.html</link>
  <description>I&apos;m continuing to make progress on workcache/rustpkg integration. Today I realized that I&apos;d been doing things a bit wrong, and that it would be important for rustpkg to declare all the inputs (for a particular package) before starting to do actual work (building).&lt;br /&gt;&lt;br /&gt;Let me back up a bit, though. workcache is a library for tracking cached function results. A function, in this case, is the process of generating build artifacts (libraries and/or executables) from inputs (source files). workcache knows about declared inputs, discovered inputs, and discovered outputs. In the case of rustpkg:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;A declared input is a source file that you know about when you start building. For example, if the user wanted to build package &lt;tt&gt;foo&lt;/tt&gt; in &lt;tt&gt;someworkspace&lt;/tt&gt;, and &lt;tt&gt;someworkspace/src/foo/lib.rs&lt;/tt&gt; exists, then you know that &lt;tt&gt;someworkspace/src/foo/lib.rs&lt;/tt&gt; is a declared input.&lt;br /&gt;&lt;li&gt;A discovered input is a source file or binary file that you discover while searching for dependencies. In the previous example, if lib.rs contains &lt;tt&gt;extern mod bar&lt;/tt&gt;, and rustpkg determines that &lt;tt&gt;bar&lt;/tt&gt; lives in &lt;tt&gt;$HOME/.rust/lib/libbar-whatever-someversion.dylib&lt;/tt&gt;, then &lt;tt&gt;$HOME/.rust/lib/libbar-whatever-someversion.dylib&lt;/tt&gt; gets added as a discovered input.&lt;br /&gt;&lt;li&gt;A discovered output is what you&apos;re trying to build when you build the package. So, in this example, &lt;tt&gt;someworkspace/lib/libfoo-whatever-someversion.dylib&lt;/tt&gt; would be a discovered output.&lt;br /&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;The code I&apos;d written so far was interleaving declaring inputs with doing actual work (building, which produces discovered output). That won&apos;t do, because when you look up a cached function result, you&apos;re looking it up by the name of the function paired with the list of declared inputs. If you don&apos;t know all the inputs yet, you won&apos;t get the right function result, and you also won&apos;t save it in a way that lets it be found later.&lt;br /&gt;&lt;br /&gt;So, I fixed that, and am putting it all back together now. It&apos;s slow going since workcache is not entirely documented (although it has more documentation than some Rust libraries do!) and I&apos;ve had to add functionality to it.&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=tim&amp;ditemid=1821842&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://tim.dreamwidth.org/1821842.html</comments>
  <category>research</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://tim.dreamwidth.org/1820526.html</guid>
  <pubDate>Thu, 29 Aug 2013 05:46:30 GMT</pubDate>
  <title>TMI: Making rustpkg work</title>
  <link>https://tim.dreamwidth.org/1820526.html</link>
  <description>&lt;p&gt;I know my daily posts are usually pretty low-level, so today I want to step back just a bit and explain a little bit of how rustpkg works. rustpkg is heavily modeled on &lt;a href=&quot;http://golang.org/cmd/go/&quot;&gt;the Go package manager&lt;/a&gt;.

&lt;p&gt;rustpkg operates on workspaces.
A workspace is a directory.
It has several subdirectories: &lt;tt&gt;src&lt;/tt&gt;, &lt;tt&gt;lib&lt;/tt&gt;, &lt;tt&gt;bin&lt;/tt&gt;, &lt;tt&gt;build&lt;/tt&gt;.
rustpkg creates the last three automatically if they don&apos;t exist.

&lt;p&gt;If you are using rustpkg, you probably want to build and install Rust code that you wrote yourself.
You probably also want to build and install code that other people wrote,
living in version control repositories that are available online
(for example, on Github).

&lt;p&gt;When you check out a remote repository to build,
you check it out into a workspace you already created.
So if you want to use my library called &quot;quux&quot; (which doesn&apos;t really exist),
you would do:

&lt;p&gt;&lt;tt&gt;mkdir -p Workspace/src&lt;br&gt;
cd Workspace/src&lt;br&gt;
git clone http://github.com/catamorphism/quux&lt;br&gt;
cd ..
rustpkg install quux
&lt;/tt&gt;

&lt;p&gt;This would make a directory called &lt;tt&gt;Workspace/src/quux&lt;/tt&gt;.
Here, &lt;tt&gt;quux&lt;/tt&gt; is a &lt;i&gt;package ID&lt;/i&gt;.
A workspace can contain several different packages with different IDs.

&lt;p&gt;rustpkg actually makes this a little bit easier for you.
You can also do:

&lt;p&gt;&lt;tt&gt;mkdir -p Workspace/src&lt;br&gt;
cd Workspace&lt;br&gt;
rustpkg install github.com/catamorphism/quux&lt;br&gt;
&lt;/tt&gt;

&lt;i&gt;n.b. Next paragraph edited for clarity on 8/29/2013&lt;/i&gt;

&lt;p&gt;This would make a directory called &lt;tt&gt;Workspace/src/github.com/catamorphism/quux&lt;/tt&gt;.
Since the source of the package is a remote repository,
here the package ID is a URL-fragment: &lt;tt&gt;github.com/catamorphism/quux&lt;/tt&gt;.
Supposing quux is a library,
it would be installed in &lt;tt&gt;Workspace/.rust/lib/libquux-HASH-VERSION.dylib&lt;/tt&gt;,
where HASH is computed by rustc and VERSION is quux&apos;s version (as per the most recent git tag). You might assume that it would be installed in &lt;tt&gt;Workspace/lib/...&lt;/tt&gt;, but since the source code was fetched remotely, rustpkg uses the first workspace in the Rust path as the destination workspace. By default, the first workspace in the Rust path is &lt;tt&gt;CWD/.rust,&lt;/tt&gt;, where &lt;tt&gt;CWD&lt;/tt&gt; is the current working directory.
You can change the Rust path by changing the &lt;tt&gt;RUST_PATH&lt;/tt&gt; environment variable,
but I&apos;ll get to that.

&lt;p&gt;You can use one workspace for many different projects.
The idea is that the sources for each project live in its own subdirectory under &lt;tt&gt;Workspace/src&lt;/tt&gt; (or whatever you want to call your workspace).
Or, you can make one workspace per project.
Then the &lt;tt&gt;src/&lt;/tt&gt; directory would contain one subdirectory for the sources for your project,
and one subdirectory for the sources for each of its dependencies.

&lt;p&gt;The motivation here is to avoid so-called &quot;dependency hell&quot;
by compartmentalizing the dependencies for different projects,
rather than storing all libraries in one system directory.
So if project A needs version 1.2 of library Z,
and project B needs version 3.6 of library Z, no problem!
The downside is potential multiple copies of libraries;
we&apos;ll see how that works out in practice.

&lt;p&gt;You do have a choice if you want to avoid multiple copies:
you can use the &lt;tt&gt;RUST_PATH&lt;/tt&gt;.
&lt;tt&gt;RUST_PATH&lt;/tt&gt; is an environment variable that rustpkg knows about;
it&apos;s a colon-separated list of workspaces. Like:

&lt;p&gt;&lt;tt&gt;declare -x RUST_PATH=/home/tjc/rust:/home/tjc/servo:/home/tjc/miscellaneous-useful-libraries&lt;/tt&gt;

&lt;p&gt;(if you use bash, anyway.)

&lt;p&gt;It&apos;s assumed that if you add a directory to the &lt;tt&gt;RUST_PATH&lt;/tt&gt;,
that directory is a workspace:
that is, it has a &lt;tt&gt;src/&lt;/tt&gt; directory with one or more project-specific subdirectories.
If it doesn&apos;t have a &lt;tt&gt;src/&lt;/tt&gt; directory,
rustpkg won&apos;t find any source files -- or installed libraries -- there.

&lt;p&gt;After I implemented all of that,
Jack began trying to port some of the Servo submodules to rustpkg.
He ran into the issue that rustpkg always installed the build artifacts
into the &lt;i&gt;same&lt;/i&gt; workspace as the sources, assuming the sources are in a workspace.
He wanted to be able to have the source in one workspace,
and tell rustpkg to put the build artifacts into a different workspace.
As he pointed out,
&lt;tt&gt;RUST_PATH&lt;/tt&gt; represents both &quot;where to find binaries&quot; and &quot;where to find sources&quot;.
This was by design, but that doesn&apos;t mean it&apos;s necessarily the best design.

&lt;p&gt;Jack wanted to be able to support the Servo submodule scenario
without too much restructing.
Once ported to rustpkg, the Servo repository will look something like:

&lt;p&gt;&lt;tt&gt;servo/src/bin.rs&lt;br&gt;
servo/deps/src/foo/lib.rs&lt;br&gt;
...
&lt;/tt&gt;

&lt;p&gt;&lt;tt&gt;bin.rs&lt;/tt&gt; is the main crate module for the Servo executable.
&lt;tt&gt;foo&lt;/tt&gt; is an example submodule of Servo; &lt;tt&gt;lib.rs&lt;/tt&gt; is its crate module.
There are many other submodules under &lt;tt&gt;servo/deps/src&lt;/tt&gt;.
We want to be able to build &lt;tt&gt;foo&lt;/tt&gt; with rustpkg and put its build output
in &lt;tt&gt;servo/build&lt;/tt&gt; and &lt;tt&gt;servo/lib&lt;/tt&gt;,
so that they can be found when building Servo with rustpkg.

&lt;p&gt;At this point, I said: why not just put the &lt;tt&gt;deps&lt;/tt&gt; directory under &lt;tt&gt;servo/src&lt;/tt&gt;?
Jack&apos;s answer is that the Servo repository has many subprojects,
so the developers want to organize them somewhat.
And if the &lt;tt&gt;deps&lt;/tt&gt; directory has subdirectories,
the subdirectory names become part of the package ID.
Since these subprojects all have their own git repositories,
it starts looking a little strange for the local directory structure
to affect how you refer to the package.

&lt;p&gt;Then we considered whether or not to just use the &lt;tt&gt;extern mod foo = ...&lt;/tt&gt; mechanism for everything.
That is, don&apos;t manually store the subprojects locally;
rather, write a directive in the Servo crate like &lt;tt&gt;extern mod foo = &quot;github.com/mozilla/foo&quot;;&lt;/tt&gt;
that tells rustpkg &quot;fetch the sources in the repository named &lt;tt&gt;mozilla/foo&lt;/tt&gt; on &lt;tt&gt;github.com&lt;/tt&gt;,
cache a local copy, and build them&quot;.
That way it&apos;s up to rustpkg how to organize the local files,
and the developers won&apos;t have to think about it.
However, this solution does not work well
if the Servo developers often make local uncommitted changes to the libraries they depend on,
concurrently with developing Servo.
In this scenario, rustpkg will use the revision it found in the remote repository,
and not the locally modified version.

&lt;p&gt;The solution we came up with is to change what&apos;s allowed to appear in the &lt;tt&gt;RUST_PATH&lt;/tt&gt;.
So when building Servo,
if somebody wanted to build a particular submodule -- &lt;tt&gt;rust-geom&lt;/tt&gt; -- first,
their &lt;tt&gt;RUST_PATH&lt;/tt&gt; would look like:

&lt;p&gt;&lt;tt&gt;RUST_PATH=$HOME/servo:$HOME/servo/src/support/geom/rust-geom&lt;/tt&gt;

&lt;p&gt;and they would type &lt;tt&gt;rustpkg build rust-geom&lt;/tt&gt; to install &lt;tt&gt;rust-geom&lt;/tt&gt; into the &lt;tt&gt;$HOME/servo&lt;/tt&gt; workspace.

&lt;p&gt;I have a &lt;a href=&quot;https://github.com/mozilla/rust/pull/8831&quot;&gt;pull request&lt;/a&gt; in the queue to implement this change.
I wasn&apos;t sure whether we wanted it to be transitional --
until, perhaps, the Servo repository gets restructured to make it conform to rustpkg&apos;s view of the world --
or permanent, so I put it behind a command-line flag, &lt;tt&gt;--rust-path-hack&lt;/tt&gt;.
Perhaps instead, rustpkg should conform to Servo&apos;s view of the world,
since we are motivated by wanting to build Servo and rustc with rustpkg.

&lt;p&gt;The main advantage of allowing the &lt;tt&gt;RUST_PATH&lt;/tt&gt; to only contain workspaces
seems to be simplicity.
But for a project with many submodules that may be organized in an arbitrarily complicated way,
perhaps making the &lt;tt&gt;RUST_PATH&lt;/tt&gt; more flexible makes it simpler to build packages.&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=tim&amp;ditemid=1820526&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://tim.dreamwidth.org/1820526.html</comments>
  <category>research</category>
  <lj:security>public</lj:security>
  <lj:reply-count>7</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://tim.dreamwidth.org/1819992.html</guid>
  <pubDate>Wed, 28 Aug 2013 03:30:44 GMT</pubDate>
  <title>TMI: What I learned about git today</title>
  <link>https://tim.dreamwidth.org/1819992.html</link>
  <description>Today, I learned something unpleasant about git. Specifically, that if you:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;git clone somegarbage a/b/c&lt;/pre&gt;where &lt;tt&gt;somegarbage&lt;/tt&gt; isn&apos;t a valid repo, it will happily create &lt;tt&gt;a/b&lt;/tt&gt; anyway, and leave them sitting there, empty.&lt;br /&gt;&lt;br /&gt;In the context of rustpkg, this was bad because it resulted in a &lt;tt&gt;src&lt;/tt&gt; directory getting created, which resulted in a non-workspace directory getting assumed to be a workspace. Very confusing. There went several hours.&lt;br /&gt;&lt;br /&gt;The right thing to do when we try to &lt;tt&gt;git clone&lt;/tt&gt; a package, I think (Eridius on IRC suggested this first, and I initially rejected it) is to make a temporary directory, clone into that, and if the clone is successful, copy it into the actual destination.&lt;br /&gt;&lt;br /&gt;Easy enough, right? No, because we don&apos;t have a &quot;rename directory&quot; function in the standard library yet; there&apos;s one in &lt;tt&gt;std::libc&lt;/tt&gt;, but it should have a safe wrapper. Rather than taking that on today, though, I&apos;m going home.&lt;br /&gt;&lt;br /&gt;This was all in the context of implementing the RUST_PATH hack that I talked about &lt;a href=&quot;http://tim.dreamwidth.org/1819633.html&quot;&gt;yesterday&lt;/a&gt;. Jack says that when this patch lands, he&apos;ll be able to port 11 Servo packages to build with rustpkg!&lt;hr&gt;Also, in the team meeting today, we discussed my &lt;a href=&quot;https://github.com/mozilla/rust/wiki/Rustpkg-schedule&quot;&gt;new proposed schedule for rustpkg&lt;/a&gt;, and made some adjustments. I&apos;m glad I mostly had the right idea about which bugs were high-priority.&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=tim&amp;ditemid=1819992&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://tim.dreamwidth.org/1819992.html</comments>
  <category>research</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://tim.dreamwidth.org/1819633.html</guid>
  <pubDate>Tue, 27 Aug 2013 00:35:10 GMT</pubDate>
  <title>TMI: I did all these things today!</title>
  <link>https://tim.dreamwidth.org/1819633.html</link>
  <description>I started off the day by blowing away my build directory in one of my workspaces because last Friday, I was getting a mysterious compiletest crash, sometimes complaining about &quot;too many open files&quot;. Building from scratch did not make the crash go away, but asking Brian did; he said there would be a pull request fixing the problem soon, but in the meantime, I could run &lt;tt&gt;make check&lt;/tt&gt; with &lt;tt&gt;RUST_THREADS=2&lt;/tt&gt;, and that worked.&lt;br /&gt;&lt;br /&gt;I landed &lt;a href=&quot;https://github.com/mozilla/rust/pull/8712&quot;&gt;#8712&lt;/a&gt;, which fixes &lt;a href=&quot;https://github.com/mozilla/rust/issues/7241&quot;&gt;#7241&lt;/a&gt;, which is making the scenario where copies of the same package exist in multiple workspaces work right. Normally, rustc errors out when it finds multiple crates that match a particular identifier. I changed filesearch so it treats searching directories in the RUST_PATH specially, and breaks out of the loop if it finds a matching crate in one of the RUST_PATH directories.&lt;br /&gt;&lt;br /&gt;In the queue is &lt;a href=&quot;https://github.com/mozilla/rust/pull/8773&quot;&gt;#8773&lt;/a&gt;, which implements the &lt;tt&gt;--version&lt;/tt&gt; flag for rustpkg. It&apos;s a little thing, but it&apos;s nice to have that work right, and it turned out to be just a matter of calling the right function in rustc-as-a-library.&lt;br /&gt;&lt;br /&gt;I&apos;m also progressing on &lt;a href=&quot;https://github.com/mozilla/rust/issues/7075&quot;&gt;#7075&lt;/a&gt;, using workcache. Last week I had the problem that I wanted to use borrowed pointers inside an &lt;span style=&apos;white-space: nowrap;&apos;&gt;&lt;a href=&apos;https://www.dreamwidth.org/profile?user=_function&apos;&gt;&lt;img src=&apos;https://www.dreamwidth.org/img/silk/identity/user.png&apos; alt=&apos;[profile] &apos; width=&apos;17&apos; height=&apos;17&apos; style=&apos;vertical-align: text-bottom; border: 0; padding-right: 1px;&apos; /&gt;&lt;/a&gt;&lt;a href=&apos;https://www.dreamwidth.org/profile?user=_function&apos;&gt;&lt;b&gt;_function&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;, which is verboten in Rust. I realized that the only reason I needed an &lt;span style=&apos;white-space: nowrap;&apos;&gt;&lt;a href=&apos;https://www.dreamwidth.org/profile?user=_function&apos;&gt;&lt;img src=&apos;https://www.dreamwidth.org/img/silk/identity/user.png&apos; alt=&apos;[profile] &apos; width=&apos;17&apos; height=&apos;17&apos; style=&apos;vertical-align: text-bottom; border: 0; padding-right: 1px;&apos; /&gt;&lt;/a&gt;&lt;a href=&apos;https://www.dreamwidth.org/profile?user=_function&apos;&gt;&lt;b&gt;_function&lt;/b&gt;&lt;/a&gt;&lt;/span&gt; was that I was calling a function in libsyntax called &lt;tt&gt;each_view_item&lt;/tt&gt; that I wrote, which uses the SimpleVisitor trait. Long story short, SimpleVisitor uses &lt;span style=&apos;white-space: nowrap;&apos;&gt;&lt;a href=&apos;https://www.dreamwidth.org/profile?user=_functions&apos;&gt;&lt;img src=&apos;https://www.dreamwidth.org/img/silk/identity/user.png&apos; alt=&apos;[profile] &apos; width=&apos;17&apos; height=&apos;17&apos; style=&apos;vertical-align: text-bottom; border: 0; padding-right: 1px;&apos; /&gt;&lt;/a&gt;&lt;a href=&apos;https://www.dreamwidth.org/profile?user=_functions&apos;&gt;&lt;b&gt;_functions&lt;/b&gt;&lt;/a&gt;&lt;/span&gt; (probably because no one got around to rewriting that code), but Visitor is more general and takes &amp;-functions (more or less any sort of closure). So I rewrote the code to use a Visitor, which also made it shorter, since Visitor is fully default-method-ized. Happiness! Now at least my code compiles, though the behavior isn&apos;t right yet.&lt;br /&gt;&lt;br /&gt;I also finished a temporary change that Jack requested to make it easier to port Servo submodules to rustpkg; I changed the way that RUST_PATH works so you can list a package directory (that is, a subdirectory of a workspace) and not just a workspace in the RUST_PATH, and rustpkg will find source files there but install to a workspace. In addition, it doesn&apos;t behave this way unless you pass in the &lt;tt&gt;--rust-path-hack&lt;/tt&gt; flag. I had Jack try it out, and he pointed out that one scenario worked, but one other scenario -- where the current working directory is not a workspace -- didn&apos;t. I guess it would be more consistent to allow the CWD to be a non-workspace when the hack is enabled, so I&apos;ll change that.&lt;br /&gt;&lt;br /&gt;Finally, I did some work on &lt;a href=&quot;https://github.com/mozilla/rust/issues/6408&quot;&gt;#6408&lt;/a&gt; (allowing package IDs to point into the middle of a repository), finishing the test case and figuring out where in the code I needed to start extending things. First of all, I can see that I need to fix &lt;tt&gt;find_and_install_dependencies&lt;/tt&gt;, the function that scans through &lt;tt&gt;extern mod&lt;/tt&gt;s and infers dependencies, so that if it doesn&apos;t find an already-compiled library, it doesn&apos;t assume the sources for the library being imported live in the same workspace as the importer. I can&apos;t believe I didn&apos;t already have a test that would have found that, but that&apos;s how it goes.&lt;br /&gt;&lt;br /&gt;Also, if you would like to read a much more pedagogical post about Rust that doesn&apos;t assume all kinds of obscure knowledge, you should read &lt;a href=&quot;http://composition.al/blog/2013/08/26/default-methods-and-negative-diffstats/&quot;&gt;Lindsey Kuper&apos;s post on default methods&lt;/a&gt;!&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=tim&amp;ditemid=1819633&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://tim.dreamwidth.org/1819633.html</comments>
  <category>research</category>
  <lj:security>public</lj:security>
  <lj:reply-count>2</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://tim.dreamwidth.org/1818698.html</guid>
  <pubDate>Thu, 22 Aug 2013 02:10:05 GMT</pubDate>
  <title>TMI: Miscellaneous</title>
  <link>https://tim.dreamwidth.org/1818698.html</link>
  <description>Today: meetings, trying my best to get a &lt;a href=&quot;https://github.com/mozilla/rust/pull/8570&quot;&gt;miscellaneous pull request&lt;/a&gt; (collecting together small changes, including enabling some more rustpkg tests) to go through, working on workcache some. I changed the freshness function for files so that just changing the datestamp, even without changing the contents, counts as changing the file. But, I realized that I&apos;m not declaring any discovered dependencies as inputs to workcache; only the files in the main package we&apos;re building. That won&apos;t do. Fixing it tomorrow.&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=tim&amp;ditemid=1818698&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://tim.dreamwidth.org/1818698.html</comments>
  <category>research</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://tim.dreamwidth.org/1818374.html</guid>
  <pubDate>Sat, 17 Aug 2013 03:50:51 GMT</pubDate>
  <title>TMI: Workcache!</title>
  <link>https://tim.dreamwidth.org/1818374.html</link>
  <description>I got rustpkg to use workcache to enough of a degree that one of the existing tests fails because it &lt;i&gt;isn&apos;t&lt;/i&gt; rebuilding a file when it&apos;s not necessary to :-) The old test used &quot;touch&quot; to make a dependency look as if it had changed, then ran rustpkg and checked datestamps. Since workcache works based on a hash of the file contents, the test fails even though it works correctly.&lt;br /&gt;&lt;br /&gt;So that&apos;s exciting! Despite Graydon explaining it to me, I hadn&apos;t quite grokked how workcache works till now. It&apos;s a quite neat idea: most build systems (including) make are declarative. You write a whole other program to explain how to build your program (albeit in a very weird programming language, usually). Workcache, and a system called &lt;a href=&quot;https://github.com/felix-lang/fbuild&quot;&gt;fbuild&lt;/a&gt; that it&apos;s based on, are imperative. You express your dependencies in your usual programming language, specifying &lt;i&gt;how&lt;/i&gt; to determine if a particular target needs to be rebuilt. That made more sense in my head than it did when I tried to write it down just now.&lt;br /&gt;&lt;br /&gt;In any case, the missing piece that I filled in today was the freshness map, which is part of the state that you have to pass around for workcache to work. The freshness map is a hash table that maps &quot;kinds&quot; (just strings) onto functions. The &quot;kinds&quot; in this case are &quot;source file&quot;, &quot;executable or library file&quot;, &quot;URL&quot;, and maybe a few other things. The function takes a name (for example, a file path) and a value (for example, a hash of the file&apos;s contents) and returns a boolean indicating whether the given name and hash are up-to-date. The &quot;given&quot; name and hash come from the workcache database (which is persistent) and the freshness function is the code that (in this case) reads in the contents of the file, hashes it, and compares the two hashes for equality.&lt;br /&gt;&lt;br /&gt;Most of the time that took was understanding the code well enough to write the previous paragraph; once I understood that, the code was quite simple.&lt;br /&gt;&lt;br /&gt;Next step is to change the test cases to reflect that rustpkg won&apos;t just rebuild if the timestamp changes[*], and make sure they change the contents of the file if they want to test behavior-if-a-file-changes. But I feel like things are moving now.&lt;br /&gt;&lt;br /&gt;[*] Or maybe it should, I&apos;m not sure, but in that case the freshness function would have to be changed so that the hash is a hash of both the file&apos;s contents and its metadata.&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=tim&amp;ditemid=1818374&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://tim.dreamwidth.org/1818374.html</comments>
  <category>research</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://tim.dreamwidth.org/1818356.html</guid>
  <pubDate>Fri, 16 Aug 2013 01:42:44 GMT</pubDate>
  <title>TMI: While my try build runs...</title>
  <link>https://tim.dreamwidth.org/1818356.html</link>
  <description>What I meant to do today: work on workcache.&lt;br /&gt;&lt;br /&gt;What I did today: un-ignore most of the rustpkg tests -- except for the ones that depend on features that aren&apos;t implemented yet (workcache, and the &lt;tt&gt;do&lt;/tt&gt;, &lt;tt&gt;test&lt;/tt&gt;, and &lt;tt&gt;info&lt;/tt&gt; commands). A bunch of the tests were xfailed because the tests weren&apos;t playing nicely with cross-compilation. That&apos;s fixed now, so they should work. But I spent most of today getting one test to work, which was one of the tests for custom build logic. The hard part had nothing to do with custom build logic, but rather to do with library names that contain dashes. Previously if you called your library foo-bar, rustpkg would generate a library called &lt;tt&gt;libfoo_bar-xxxxx-0.1.dylib&lt;/tt&gt; (on Mac, anyway), where xxxxx is a hash. Now that we separate the name used as an identifier in Rust code from the actual package ID, we can call the library &lt;tt&gt;libfoo-bar-xxxxx-0.1.dylib&lt;/tt&gt;, but since &apos;-&apos; also separates the name, hash, and version, the old parsing code didn&apos;t work anymore. Now it does! (I&apos;m not completely sure that we should be naming libraries this way anyway, but hey, everything works now, or should.)&lt;br /&gt;&lt;br /&gt;Running a try build now to make sure everything works on the bots where the host and target are potentially different, and then I&apos;ll submit a pull request. And, uh, tomorrow I&apos;ll work on workcache.&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=tim&amp;ditemid=1818356&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://tim.dreamwidth.org/1818356.html</comments>
  <category>research</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://tim.dreamwidth.org/1817940.html</guid>
  <pubDate>Thu, 15 Aug 2013 01:28:50 GMT</pubDate>
  <title>TMI: rustpkg status</title>
  <link>https://tim.dreamwidth.org/1817940.html</link>
  <description>Today, I looked at the &lt;a href=&quot;https://github.com/mozilla/rust/issues/5677&quot;&gt;metabug&lt;/a&gt; for rustpkg and noticed that all of the items marked as &quot;necessary to call rustpkg &apos;ready for use&apos;&quot; are finished. I added one more that was overlooked, which is workcache support, and after discussion with Graydon, added several more issues. Still, most of those should be pretty easy to fix, so we&apos;re very close to the point where we&apos;ll want to say to the community &quot;hey, start using this and test!&quot; Some people, of course, already have, such as cmr with &lt;a href=&quot;https://github.com/cmr/rustdoc_ng&quot;&gt;rustdoc_ng&lt;/a&gt;. Which I&apos;m currently trying to build on my system with rustpkg but am making rustc segfault. Must be Wednesday.&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=tim&amp;ditemid=1817940&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://tim.dreamwidth.org/1817940.html</comments>
  <category>research</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://tim.dreamwidth.org/1817758.html</guid>
  <pubDate>Wed, 14 Aug 2013 01:21:05 GMT</pubDate>
  <title>TMI: A day of debugging-by-println</title>
  <link>https://tim.dreamwidth.org/1817758.html</link>
  <description>I really wanted to isolate that OS X spawning bug from yesterday, and today I filed &lt;a href=&quot;https://github.com/mozilla/rust/issues/8498&quot;&gt;#8498&lt;/a&gt;. It turns out the problem isn&apos;t about spawning at all, but rather, with &lt;tt&gt;Option&lt;/tt&gt;s that contain vector slices. The &lt;tt&gt;ProcessOptions&lt;/tt&gt; struct in &lt;tt&gt;std::run&lt;/tt&gt;, which represents data needed to spawn a process, has a field with type &lt;tt&gt;Option&amp;lt;&amp;[(~str, ~str)]&amp;gt;&lt;/tt&gt;: that is, it takes an option of a vector of pairs of strings representing name/value pairs for the environment. That&apos;s all fine, but the &amp; makes it a borrowed vector, and there is apparently some bug where memory gets corrupted if you construct one and then match on it. I replaced &amp; with ~ (which allocates more memory, since it means the process will own its environment vector, meaning that callers may have to make a copy) and that fixed the problem. Once tests finish, I&apos;ll check that in as a temporary workaround.&lt;br /&gt;&lt;br /&gt;While browsing not-recently-updated bugs, I found #6702, an unclear-error-message bug in resolve, &lt;a href=&quot;https://github.com/mozilla/rust/pull/8502&quot;&gt;which was an easy fix&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The option/slice bug, which came up while working on rustpkg, took up some time, but tomorrow I really need to get back to rustpkg itself, hopefully finishing the workcache integration over the next few days.&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=tim&amp;ditemid=1817758&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://tim.dreamwidth.org/1817758.html</comments>
  <category>research</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://tim.dreamwidth.org/1817152.html</guid>
  <pubDate>Tue, 13 Aug 2013 03:54:49 GMT</pubDate>
  <title>TMI: Multithreaded Monday</title>
  <link>https://tim.dreamwidth.org/1817152.html</link>
  <description>Today: Bug triage! Leading to &lt;a href=&quot;https://github.com/mozilla/rust/pull/8479&quot;&gt;fixing this bug related to derived type errors&lt;/a&gt;, one of the remaining corner cases of something I worked on a while ago. Well, actually that was as a result of a question someone asked on IRC. Close enough! I also &lt;a href=&quot;https://github.com/mozilla/rust/pull/8477&quot;&gt;improved a type error message to do with static methods&lt;/a&gt;, allowing us to close one of the older bugs.&lt;br /&gt;&lt;br /&gt;While working on rustpkg, I discovered something was weird with OS X process spawning. For rustpkg I was able to work around it, but I thought I should isolate the test case anyway. The conclusion, so far, is that &lt;a href=&quot;https://github.com/mozilla/rust/issues/8482&quot;&gt;something is really weird with OS X process spawning&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;And at some point tomorrow, I have to finish some paper reviews, documentation for my recent rustpkg changes, preparation for interviewing a candidate on Wednesday, my weekly status report, and checking if any pull requests I could review are in the queue. All of which I meant to do today. Good times.&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=tim&amp;ditemid=1817152&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://tim.dreamwidth.org/1817152.html</comments>
  <category>research</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://tim.dreamwidth.org/1816591.html</guid>
  <pubDate>Sat, 10 Aug 2013 01:40:38 GMT</pubDate>
  <title>TMI: 14 green boxes means it&apos;s time to go home!</title>
  <link>https://tim.dreamwidth.org/1816591.html</link>
  <description>The extern-mod patch finally landed! The last bug: it turns out that something on Mac OS X wasn&apos;t right in our &lt;tt&gt;run&lt;/tt&gt; code (that shells out to create a new process), and if you supplied environment variables, it was extending the environment and not overwriting it. On Linux, the code was correct, which meant shell commands failed because among other things, the PATH was getting set to &quot;&quot;. I changed my test code that was calling the &lt;tt&gt;run&lt;/tt&gt; code to explicitly fetch and extend the existing environment, and that was the last fix.&lt;br /&gt;&lt;br /&gt;The next big thing to finish will be using workcache. I&apos;m realizing that the workcache library itself needs some work before rustpkg can use it. The first thing to do was to change it so that it actually saves and reloads its database to disk, so that you can see changes in between runs of rustpkg, and not just within the same run. I did that, and now it&apos;s complaining about something missing from the file when it reads it back in, which is at least progress.&lt;br /&gt;&lt;br /&gt;When running up-to-date master on my local machine, I was noticing a segfault while building the docs that obviously didn&apos;t happen on the bots, but it seems to be due to the new scheduler and the handling of stack overflows (I git-bisected and saw that the first bad commit was the &quot;Turn on the new runtime&quot; commit). There&apos;s a patch in the queue to increase the stack size, so I&apos;m going to go home and hope it&apos;ll magically be fixed in the morning.&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=tim&amp;ditemid=1816591&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://tim.dreamwidth.org/1816591.html</comments>
  <category>research</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://tim.dreamwidth.org/1816181.html</guid>
  <pubDate>Wed, 07 Aug 2013 02:06:18 GMT</pubDate>
  <title>TMI: Quick update</title>
  <link>https://tim.dreamwidth.org/1816181.html</link>
  <description>The extern-mod patch of doom is blocked on... &lt;tt&gt;std::path&lt;/tt&gt; tests? I moved a function from rustc into the standard library (&lt;tt&gt;get_relative_to&lt;/tt&gt;), and moved its test cases as well. This caused the tests to fail. I don&apos;t know why.&lt;br /&gt;&lt;br /&gt;The workcache branch is also blocked, because I don&apos;t understand the rules about what you can and can&apos;t capture in a ~ closure. I will probably need to consult with someone tomorrow.&lt;br /&gt;&lt;br /&gt;In the background, doing some AST refactoring that is proving harder than I thought (as it always does).&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=tim&amp;ditemid=1816181&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://tim.dreamwidth.org/1816181.html</comments>
  <category>research</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
</channel>
</rss>
