Better HN
topnewbestaskshowjobs
Log inSign up

epage

2,555 karma · joined Apr 30, 2009 (17y ago) · 733 submissions

eopage at gmail dot com
Submissions

comment 4d ago · link · parent

This is my commit style guide I wrote up based on what I've seen that makes PRs easier to review: https://epage.github.io/dev/pr-style/

comment 1w ago · link · parent

https://github.com/rust-lang/rust/issues/161824

comment 1w ago · link · parent

I shared your anecdote with another Cargo team member who helped work on this feature. We appreciate seeing how what we made helped people!

comment 1w ago · link · parent

The crates.io index was updated to have pubtime populated for every version of every crate.

comment 1w ago · link · parent

It was only added to the registry spec a few releases ago. We can't guarantee that a registry has updated to provide it.

comment 1w ago · link · parent

This comes from usability and consistency.

When we added the MSRV aware resolver, we decided to have it not affect `cargo install` because you could get an old version and not notice (especially with how noisy cargo is) when the right answer might be to upgrade.

Somewhat similar for min-publish-age but also we had defined the parent table for these config fields to not affect install.

The change to `--locked` made us feel a little better with this non-ideal circumstance.

comment 1w ago · link · parent

Note that this is a special form of early cut off (which was listed) where you are hashing a more specialized output file, rather than a broader one.

comment 1w ago · link · parent

To do it right you need

- stable id's even when the source changes

- a separate output file dedicated to it so you hash that

Those aren't free, taking extra work to implement and possibly slow down the compiler

comment 1w ago · link · parent

Fixed on nightly.

comment 1w ago · link · parent

I believe so. The maintaner of cargo-udeps did most of the work as an effort to upstream it.

The main limitation is in dev-dep detection since there isn't a way to exhaustively run everything that uses dev-deps yet. You can look at logging statements to get an approximation though.

comment 1w ago · link · parent

For anyone that wants more context on the decision, see https://github.com/rust-lang/cargo/issues/7169#issuecomment-...

comment 1w ago · link · parent

Faster compile and smaller build-dir can be at odds with each other.

That said, this release includes some incremental improvements as well as the unused-dependency lint to help reduce wasted work within the ecosystem.

Some changes that have been or are about to be merged for upcoming releases

- We will be reducing the debug info generated for the `dev` profile which reduces build-dir size and speeds up builds. We've split off a `debug` profile for when that is needed.

- Cargo will be deleting the directory rustc writes before each invocation, avoiding the leaking of debug files when split-debug is enabled (default on Mac)

- rlibs for workspace members will no longer be copied from build-dir to target-dir which takes up extra space on systems without hardlinking or where we skip it (like Mac)

- redundant information in rlibs and rmeta's is going to be de-duplicated

Examples of further out changes

- This release includes the foundational work to add a build-dir GC

- Cross-workspace de-duplicating of build-dirs

- Cross-workspace build-dir cache

- Early cut off

comment 1mo ago · link · parent

That guideline is in response to an API design. I'm speaking to how the default stance (import types) feeds back into API design.

comment 1mo ago · link · parent

> Type names should be imported and used unqualified

This just pushes people to have redundant information in types (`IoError` instead of `io::Error`).

Unless a type is widely recognized (like `HashMap`), I prefer to have them fully qualified so I have the contextual meaning for it. If I am working with a generic name like `Source`, what does that mean? I shouldn't have to look up in the imports to understand the code (or only understand it through an LSP).

Reducing imports also reduces unnecessary merge conflicts.

comment 1mo ago · link · parent

I think which to use in general Rust code depends on the purpose of your type.

A builder type like `Command` will have unqualified setters and `get_` qualified getters.

For record-like-structs, I think unqualified getters becomes preferred and `set_` qualified setters.

comment 1mo ago · link · parent

This will be the default for the `dev` profile in an upcoming release now that the `debug` profile has been split out.

comment 1mo ago · link · parent

Been looking at sandboxing, both low level and higher level like this.

The API for their Rust mxc-sdk looks nice but

- their "sdk" has binaries and the build script has logic for them

- their build scripts do windows-exclusive work on all platforms

- not putting some of the backends behind features causes more build script work (and that work will break on future Cargo versions)

- at least some of the remaíning build script work doesn't need to be a build script

- it seems pretty dependency heavy

comment 2mo ago · link · parent

Why not just pass `-jobs 1` to cargo?

Still won't be quite apples to apples because a multi-crate project will serialize more to disk.

comment 2mo ago · link · parent

Most of these global env vars started somewhere.

That said, at least for cargo, there will also be a `term` config field for it.

comment 2mo ago · link · parent

While this is using ariadne for rendering, for annotate-snippets (the renderer for rustc) there is active work for a screen reader mode. This is being tracked at https://github.com/rust-lang/annotate-snippets-rs/issues/351

comment 4mo ago · link · parent

We are trading away disk space for faster builds. We could make them faster in some cases by using even more...

On the other hand, it would be good to garbage collect those caches. We are wrapping up work on a new layout for intermediate build artifacts that will make it easier to GC them.

comment 5mo ago · link · parent

That and the existing reply are incorrect. Almost everyone has repeated the same superficial requests and design work and not dug into the problems to come up with a proposal that respectfully threads seemingly contradictory requirements (the answer isn't to be dismissive but to step through costs/benefits and explain why a path is justified).

https://internals.rust-lang.org/t/survey-of-organizational-o... is a start in just collecting existing knowledge in one place.

comment 5mo ago · link · parent

An RFC was recently merged to unblock this: https://github.com/rust-lang/rfcs/pull/3963

The implementation on this has started.

Something to keep in mind is https://blog.m-ou.se/rust-is-not-a-company/. Rust is mostly driven by volunteers working on what they find interesting. Boring/uninteresting tasks depend on funding, a warm body to accept the funding, and a reviewer.

comment 5mo ago · link · parent

As a prolific PR author, I've found how I communicate has a major factor on how well and quickly people respond to PRs. I've recorded my lessons at https://epage.github.io/dev/pr-style/.

comment 5mo ago · link · parent

As a reviewer, I love type first because it sets expectations for what I'm going to look at. Similar if I'm bisecting or doing other history operations.

I don't do automated changelogs or versioning but it also makes it faster for me to do so.

I really dislike focusing on issue ids. I only want to jump to another tool if I need more information, so put it in the footer for after I've read what is there, like a front page news article giving you the option to go to the back to read more. Worst case that I've seen is people that think the Issue ID is all you need.

comment 6mo ago · link · parent

Not having used uv but being on the Cargo team for Rust, I wish `cargo update` was `cargo lock update` because it is making our life more difficult to add a version requirement update command/mode inside of Cargo. The effort has been stalled for years.

- Our compatibility guarantees mean we can't fundamentally change `cargo update`

- Using the third-party package name of `cargo upgrade` would be confusing in the distinction between the two

- We have to be very careful adding the mode to the existing command

comment 7mo ago · link · parent

An important part to me that gets overlooked is shared logins. Rust runs the tests of all known Rust projects in a tool called `crater`. I was analyzing a run identifying projects relying on internals of Cargo and opening issues. When making 200 issues by hand, it is a big help when the process is low friction: I had credentials for the site and allowing blank templates. Any time I came across a self-hosted instance, I usually ended up giving up.

comment 7mo ago · link · parent

I appreciate you recognize there is still a reason for grouping commits into mergeable units (PRs). Some go too far and only want every commit to be independent.

I also appreciate the ordering. In my projects, we put an extra focus on tests by having having a commit that adds new tests to reproduce the bad behavior so when you diff the tests with the fix commit, you get a visual of how things changed.

I also find that the order can be PR specific. I wonder about allowing the contributor or reviewrs reorder on per-PR basis.

There are also times we have a lot of test or doc changes. I wonder about grouping items to jump between or collapsing to more easily navigate around than opening and browsing a file picker.

comment 8mo ago · link · parent

Yeah, having `cargo test` require another binary like `uv` is not idiomatic. 99% of the time, I should be able to walk up to a Rust project and run `cargo test` and it should just work.

comment 9mo ago · link · parent

Really interested in this for cargo/rustc. We run into issues where we need one or two more colors but all that is left after going for the basic semantic colors is magenta (odd choice), and black and white (not safe without inspecting the theme).
12345
25