tim: Tim with short hair, smiling, wearing a black jacket over a white T-shirt (Default)
[personal profile] tim
I finished yesterday's work, in the "tests pass" sense, so now rustpkg can recognize package IDs that resemble URL fragments. For example, I can write:

rustpkg build github.com/catamorphism/test-pkg

and rustpkg will fetch the test-pkg repository from github, then build a local cached copy of it.

We also had a useful meeting today to discuss what Servo needs from rustpkg, resulting in ten or so new github issues. (The rustpkg metabug collects them all.) One thing we talked about will actually obviate the need for the tedious string-munging that I talked about in yesterday's post. Specifically, we'll change the syntax of the extern mod directive -- which says "link this external crate with this program" -- to take a string rather than an identifier. So instead of:

extern mod foo;

we'll allow:

extern mod "foo";

or

extern mod "github.com/catamorphism/foo";

But in the latter case, how will I refer to foo in my code, since the package ID here is not an identifier? The Rust compiler will either guess the package's short name from the package ID's file stem if it's a valid identifier; in other cases, it will support this syntax too:

extern mod foo = "github.com/catamorphism/foo-bar";

that gives a package with arbitrary characters in its package ID a valid Rust identifier.

Not rocket science, but incremental progress towards the dream of writing the Rust build system in Rust.

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