Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement experimental registry HTTP API from RFC #8890

Closed
wants to merge 86 commits into from

Commits on Nov 19, 2020

  1. Lift make_dep_prefix so it can be shared

    Jon Gjengset committed Nov 19, 2020
    Configuration menu
    Copy the full SHA
    ac37cc5 View commit details
    Browse the repository at this point in the history

Commits on Nov 20, 2020

  1. Implement registry HTTP API from RFC

    This commit implements the HTTP registry API from
    rust-lang/rfcs#2789.
    
    A proof-of-concept server implementation exists at
    https://github.com/kornelski/cargo-static-registry-rfc-proof-of-concept
    
    The client implementation supports the changelog extension in the RFC,
    but the server does not at the time of writing.
    
    This first draft does not take advantage of `Etag` to avoid
    re-downloads if the server does not support changelog. It also does not
    download multiple index files concurrently, since the Registry trait
    doesn't lend itself well to that at the moment.
    Jon Gjengset committed Nov 20, 2020
    Configuration menu
    Copy the full SHA
    c92f34c View commit details
    Browse the repository at this point in the history
  2. Improve support for non-changelog HTTP registries

    With this change, a registry that does not support the optional
    changelog feature will no longer purge the index on every build.
    Instead, it will double-check the current file contents with the server
    for each load, which is fairly efficient if a given index file has _not_
    changed. The changelog is (unsurprisingly) still much more efficient.
    Jon Gjengset committed Nov 20, 2020
    Configuration menu
    Copy the full SHA
    37bd64d View commit details
    Browse the repository at this point in the history
  3. Share try_old_curl

    Jon Gjengset committed Nov 20, 2020
    Configuration menu
    Copy the full SHA
    f04eee1 View commit details
    Browse the repository at this point in the history
  4. Tidy up significantly

    Jon Gjengset committed Nov 20, 2020
    Configuration menu
    Copy the full SHA
    6881d67 View commit details
    Browse the repository at this point in the history

Commits on Nov 21, 2020

  1. Detect rfc+http as HTTP registry

    Jon Gjengset committed Nov 21, 2020
    Configuration menu
    Copy the full SHA
    c2b7ec7 View commit details
    Browse the repository at this point in the history
  2. Double-check anything that's not synchronized

    Jon Gjengset committed Nov 21, 2020
    Configuration menu
    Copy the full SHA
    e67ea79 View commit details
    Browse the repository at this point in the history
  3. Add more debug output

    Jon Gjengset committed Nov 21, 2020
    Configuration menu
    Copy the full SHA
    4c1af67 View commit details
    Browse the repository at this point in the history
  4. Handle directories that don't exist

    Jon Gjengset committed Nov 21, 2020
    Configuration menu
    Copy the full SHA
    011e483 View commit details
    Browse the repository at this point in the history
  5. Allow empty lines in changelog

    Jon Gjengset committed Nov 21, 2020
    Configuration menu
    Copy the full SHA
    ff86ee2 View commit details
    Browse the repository at this point in the history
  6. A note about non-Range servers

    Jon Gjengset committed Nov 21, 2020
    Configuration menu
    Copy the full SHA
    2220c19 View commit details
    Browse the repository at this point in the history
  7. Add rudimentary testing for HTTP registry

    Jon Gjengset committed Nov 21, 2020
    Configuration menu
    Copy the full SHA
    3ec6f87 View commit details
    Browse the repository at this point in the history
  8. No changelog means no version means no cache

    Jon Gjengset committed Nov 21, 2020
    Configuration menu
    Copy the full SHA
    184fa41 View commit details
    Browse the repository at this point in the history
  9. Unify unknown and unsupported changelog states

    They're handled the same anyway.
    Jon Gjengset committed Nov 21, 2020
    Configuration menu
    Copy the full SHA
    9527f00 View commit details
    Browse the repository at this point in the history
  10. More tests for HTTP registry

    Jon Gjengset committed Nov 21, 2020
    Configuration menu
    Copy the full SHA
    572ceeb View commit details
    Browse the repository at this point in the history

Commits on Nov 23, 2020

  1. Don't write JSON-encoded name to changelog

    Jon Gjengset committed Nov 23, 2020
    Configuration menu
    Copy the full SHA
    d9aed8a View commit details
    Browse the repository at this point in the history
  2. All headers end with CRLF

    Jon Gjengset committed Nov 23, 2020
    Configuration menu
    Copy the full SHA
    45dbbb7 View commit details
    Browse the repository at this point in the history
  3. Don't overwrite last-updated if nothing changed

    Jon Gjengset committed Nov 23, 2020
    Configuration menu
    Copy the full SHA
    3604da8 View commit details
    Browse the repository at this point in the history
  4. Adopt more tests from registry.rs

    Jon Gjengset committed Nov 23, 2020
    Configuration menu
    Copy the full SHA
    8f99f76 View commit details
    Browse the repository at this point in the history

Commits on Nov 25, 2020

  1. Push forward the greedy route

    This doesn't quite work yet. Something needs to call `prefetch`, and
    there's still an important TODO about making sure calls to `load` do not
    re-fetch files that have already been prefetched.
    Jon Gjengset committed Nov 25, 2020
    Configuration menu
    Copy the full SHA
    f9b1262 View commit details
    Browse the repository at this point in the history
  2. Progress on greedy prefetching

    Jon Gjengset committed Nov 25, 2020
    Configuration menu
    Copy the full SHA
    42453f5 View commit details
    Browse the repository at this point in the history
  3. Document fields

    Jon Gjengset committed Nov 25, 2020
    Configuration menu
    Copy the full SHA
    5568cb6 View commit details
    Browse the repository at this point in the history
  4. Boolean logic is hard

    Jon Gjengset committed Nov 25, 2020
    Configuration menu
    Copy the full SHA
    e29b21e View commit details
    Browse the repository at this point in the history
  5. Fix interactions between prefetching and loads

    Jon Gjengset committed Nov 25, 2020
    Configuration menu
    Copy the full SHA
    202258e View commit details
    Browse the repository at this point in the history
  6. Give example crate for load source failure

    Jon Gjengset committed Nov 25, 2020
    Configuration menu
    Copy the full SHA
    acd3ee7 View commit details
    Browse the repository at this point in the history
  7. Make prefetch respect patches

    Since we now also have to collect the `deps` iterator, we have it
    implemented `ExactSizeIterator` to avoid excessive allocations.
    Jon Gjengset committed Nov 25, 2020
    Configuration menu
    Copy the full SHA
    b52740d View commit details
    Browse the repository at this point in the history
  8. Fix up expected output in path test

    Jon Gjengset committed Nov 25, 2020
    Configuration menu
    Copy the full SHA
    5799fc8 View commit details
    Browse the repository at this point in the history
  9. Improve docs for prefetching methods/types

    Jon Gjengset committed Nov 25, 2020
    Configuration menu
    Copy the full SHA
    d0d4ccb View commit details
    Browse the repository at this point in the history
  10. Update tests to match new error messages

    This is kind of unfortunate since it talks about prefetching even for
    sources that do not support it. The reason for this is that we have to
    load the source before we can even check whether it supports
    prefetching, and for these tests what fails is loading the source...
    Jon Gjengset committed Nov 25, 2020
    Configuration menu
    Copy the full SHA
    e970a0c View commit details
    Browse the repository at this point in the history
  11. Fix overeager test fixing

    Jon Gjengset committed Nov 25, 2020
    Configuration menu
    Copy the full SHA
    e1018d0 View commit details
    Browse the repository at this point in the history

Commits on Nov 26, 2020

  1. Fix resolver-tests crate compile failure

    Jon Gjengset committed Nov 26, 2020
    Configuration menu
    Copy the full SHA
    8ccaf4f View commit details
    Browse the repository at this point in the history
  2. Avoid UncanonicalizedIter during prefetch

    It's not really necessary. It's okay if it takes us slightly longer to
    generate an error.
    Jon Gjengset committed Nov 26, 2020
    Configuration menu
    Copy the full SHA
    9ad0ff6 View commit details
    Browse the repository at this point in the history
  3. Keep better track of what has been downloaded

    Jon Gjengset committed Nov 26, 2020
    Configuration menu
    Copy the full SHA
    6b1bd18 View commit details
    Browse the repository at this point in the history
  4. Don't yield the same package many times

    Note that this could be a decent amount nicer with
    dtolnay/semver#170
    
    This currently ends up in some kind of loop for cargo-like deps:
    
        yielding already-fetched rustversion
        yielding already-fetched futures
        yielding already-fetched thiserror
        yielding already-fetched anyhow
        yielding already-fetched rustversion
        yielding already-fetched futures
        yielding already-fetched thiserror
    
    Everything _up_ to that point terminates pretty quickly.
    Jon Gjengset committed Nov 26, 2020
    Configuration menu
    Copy the full SHA
    5d092de View commit details
    Browse the repository at this point in the history

Commits on Nov 30, 2020

  1. New time format

    Jon Gjengset committed Nov 30, 2020
    Configuration menu
    Copy the full SHA
    0e2ead6 View commit details
    Browse the repository at this point in the history
  2. Avoid walking in circles

    Jon Gjengset committed Nov 30, 2020
    Configuration menu
    Copy the full SHA
    f11440e View commit details
    Browse the repository at this point in the history
  3. Only allow HTTP registry under -Z http-registry

    Jon Gjengset committed Nov 30, 2020
    Configuration menu
    Copy the full SHA
    e1f96cc View commit details
    Browse the repository at this point in the history
  4. Add prefetch progress tracking

    It's not _super_ helpful at the moment since the number keeps
    fluctuating...
    Jon Gjengset committed Nov 30, 2020
    Configuration menu
    Copy the full SHA
    5345b83 View commit details
    Browse the repository at this point in the history
  5. Use Cargo.lock to seed prefetching

    This allows us to start downloads of a tonne of index files we otherwise
    would not discover until much later, which saves us many RTTs. On a
    dependency graph like that of cargo itself, it cut my download time to
    1/5th.
    Jon Gjengset committed Nov 30, 2020
    Configuration menu
    Copy the full SHA
    cd7a553 View commit details
    Browse the repository at this point in the history
  6. Remove old note about pipelining

    Jon Gjengset committed Nov 30, 2020
    Configuration menu
    Copy the full SHA
    f97db19 View commit details
    Browse the repository at this point in the history

Commits on Dec 1, 2020

  1. Only prefetch once per invocation

    Jon Gjengset committed Dec 1, 2020
    Configuration menu
    Copy the full SHA
    9a11d49 View commit details
    Browse the repository at this point in the history
  2. Fix tests to pass -Z flag and use 'nightly'

    Jon Gjengset committed Dec 1, 2020
    Configuration menu
    Copy the full SHA
    7535830 View commit details
    Browse the repository at this point in the history
  3. Fix more tests from hoisting prefetching phase

    Jon Gjengset committed Dec 1, 2020
    Configuration menu
    Copy the full SHA
    a385413 View commit details
    Browse the repository at this point in the history
  4. Use the right API def for resolver-tests

    Jon Gjengset committed Dec 1, 2020
    Configuration menu
    Copy the full SHA
    de13064 View commit details
    Browse the repository at this point in the history
  5. Move to sparse+http and add index= support

    Jon Gjengset committed Dec 1, 2020
    Configuration menu
    Copy the full SHA
    6c2e28f View commit details
    Browse the repository at this point in the history
  6. Move RegistryData::load to &mut self

    This will be needed for the new sparse registry to allow it to keep
    track of files it has already checked with the server.
    Jon Gjengset committed Dec 1, 2020
    Configuration menu
    Copy the full SHA
    15aa11f View commit details
    Browse the repository at this point in the history
  7. Look for LAST_UPDATED in the right place

    Jon Gjengset committed Dec 1, 2020
    Configuration menu
    Copy the full SHA
    bad9d3c View commit details
    Browse the repository at this point in the history
  8. Correct handling of 404s during prefetch

    Jon Gjengset committed Dec 1, 2020
    Configuration menu
    Copy the full SHA
    ee6abeb View commit details
    Browse the repository at this point in the history
  9. Handle offline errors earlier

    Jon Gjengset committed Dec 1, 2020
    Configuration menu
    Copy the full SHA
    a9f80f8 View commit details
    Browse the repository at this point in the history
  10. Actually show a progress bar

    It does jump a bit, but it's better than what was.
    Jon Gjengset committed Dec 1, 2020
    Configuration menu
    Copy the full SHA
    38ad840 View commit details
    Browse the repository at this point in the history

Commits on Dec 2, 2020

  1. Mention -Zhttp-registries in help output

    Jon Gjengset committed Dec 2, 2020
    Configuration menu
    Copy the full SHA
    508ffa6 View commit details
    Browse the repository at this point in the history
  2. Fix botched manual diff

    Jon Gjengset committed Dec 2, 2020
    Configuration menu
    Copy the full SHA
    517a3e2 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c57c92c View commit details
    Browse the repository at this point in the history
  4. Better name for set of already-checked files

    Jon Gjengset committed Dec 2, 2020
    Configuration menu
    Copy the full SHA
    666895b View commit details
    Browse the repository at this point in the history
  5. Make sparse+ work in more places

    Thanks @Nemo157
    Jon Gjengset committed Dec 2, 2020
    Configuration menu
    Copy the full SHA
    b41dfbb View commit details
    Browse the repository at this point in the history
  6. Keep iterating while there's work

    Jon Gjengset committed Dec 2, 2020
    Configuration menu
    Copy the full SHA
    3a71c4c View commit details
    Browse the repository at this point in the history
  7. Don't fetch transitive dev-dependencies

    Jon Gjengset committed Dec 2, 2020
    Configuration menu
    Copy the full SHA
    165f01d View commit details
    Browse the repository at this point in the history
  8. Add early top for dependency version walk

    Jon Gjengset committed Dec 2, 2020
    2 Configuration menu
    Copy the full SHA
    1bcbc63 View commit details
    Browse the repository at this point in the history
  9. Improve trace output and some comments

    Jon Gjengset committed Dec 2, 2020
    Configuration menu
    Copy the full SHA
    ced491a View commit details
    Browse the repository at this point in the history
  10. Remove invalid optimization

    The index yields versions in chronological order, but 0.2.7 can still be
    released as a hotfix release after 0.3.0 was released. Similarly, we may
    depend on something like 1.0 _and_ 2.0 of a crate through different
    dependency paths. _Maybe_ there's an optimization in there somewhere,
    but it's not as simple as this.
    Jon Gjengset committed Dec 2, 2020
    Configuration menu
    Copy the full SHA
    8098e60 View commit details
    Browse the repository at this point in the history

Commits on Dec 3, 2020

  1. Fetch config.json from the right directory

    Jon Gjengset committed Dec 3, 2020
    Configuration menu
    Copy the full SHA
    3f746b3 View commit details
    Browse the repository at this point in the history
  2. Fix up alt_registry tests with registry+ prefix

    Jon Gjengset committed Dec 3, 2020
    Configuration menu
    Copy the full SHA
    3a8b69d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7caae82 View commit details
    Browse the repository at this point in the history
  4. Treat 403 as 404 from a privacy-sensitive server

    Jon Gjengset committed Dec 3, 2020
    Configuration menu
    Copy the full SHA
    fa296f0 View commit details
    Browse the repository at this point in the history
  5. Be more helpful about HTTP status code errors

    Jon Gjengset committed Dec 3, 2020
    Configuration menu
    Copy the full SHA
    88649de View commit details
    Browse the repository at this point in the history
  6. Remove the changelog optimization

    Jon Gjengset committed Dec 3, 2020
    Configuration menu
    Copy the full SHA
    bda120a View commit details
    Browse the repository at this point in the history

Commits on Dec 4, 2020

  1. nits

    Jon Gjengset committed Dec 4, 2020
    Configuration menu
    Copy the full SHA
    7d1fef8 View commit details
    Browse the repository at this point in the history
  2. Avoid index updates if we can update just one file

    Jon Gjengset committed Dec 4, 2020
    Configuration menu
    Copy the full SHA
    cc87623 View commit details
    Browse the repository at this point in the history
  3. Avoid hitting assertion failures

    Jon Gjengset committed Dec 4, 2020
    Configuration menu
    Copy the full SHA
    c56c4d2 View commit details
    Browse the repository at this point in the history
  4. All index paths should be lowercase

    Jon Gjengset committed Dec 4, 2020
    Configuration menu
    Copy the full SHA
    7efa4da View commit details
    Browse the repository at this point in the history

Commits on Dec 9, 2020

  1. Default to empty prefetch

    Jon Gjengset committed Dec 9, 2020
    Configuration menu
    Copy the full SHA
    3c5c89b View commit details
    Browse the repository at this point in the history
  2. Avoid extra indentation

    Jon Gjengset committed Dec 9, 2020
    Configuration menu
    Copy the full SHA
    a5e8b9f View commit details
    Browse the repository at this point in the history
  3. Only be conditional on fields the server provided

    Jon Gjengset committed Dec 9, 2020
    Configuration menu
    Copy the full SHA
    a1383e0 View commit details
    Browse the repository at this point in the history
  4. Fix cut-off comment

    Jon Gjengset committed Dec 9, 2020
    Configuration menu
    Copy the full SHA
    5750fdf View commit details
    Browse the repository at this point in the history
  5. Remove index files we get ~404 for

    Jon Gjengset committed Dec 9, 2020
    Configuration menu
    Copy the full SHA
    e89e37c View commit details
    Browse the repository at this point in the history
  6. Be more helpful about HTTP status code errors

    Jon Gjengset committed Dec 9, 2020
    Configuration menu
    Copy the full SHA
    ad63b9d View commit details
    Browse the repository at this point in the history
  7. Spelling is hard

    Jon Gjengset committed Dec 9, 2020
    Configuration menu
    Copy the full SHA
    8b8e3df View commit details
    Browse the repository at this point in the history
  8. Assert we have valid utf-8 paths

    Jon Gjengset committed Dec 9, 2020
    Configuration menu
    Copy the full SHA
    917f5d0 View commit details
    Browse the repository at this point in the history
  9. Avoid duplicating crate download code

    Jon Gjengset committed Dec 9, 2020
    Configuration menu
    Copy the full SHA
    cd5281d View commit details
    Browse the repository at this point in the history
  10. Avoid adding a new SourceId

    Jon Gjengset committed Dec 9, 2020
    Configuration menu
    Copy the full SHA
    3382ddf View commit details
    Browse the repository at this point in the history

Commits on Dec 14, 2020

  1. Use masquerade_as_nightly

    Jon Gjengset committed Dec 14, 2020
    Configuration menu
    Copy the full SHA
    7871824 View commit details
    Browse the repository at this point in the history
  2. Suggest correct -Z name

    Jon Gjengset committed Dec 14, 2020
    Configuration menu
    Copy the full SHA
    ee333d3 View commit details
    Browse the repository at this point in the history
  3. Make sparse+ an impl detail of RegistrySource

    This also re-enables the requirement of -Z http-registry
    Jon Gjengset committed Dec 14, 2020
    Configuration menu
    Copy the full SHA
    f1f63cc View commit details
    Browse the repository at this point in the history
  4. Add test for nightly-only

    Jon Gjengset committed Dec 14, 2020
    Configuration menu
    Copy the full SHA
    94ba59e View commit details
    Browse the repository at this point in the history
  5. Merge branch 'master' into http-registry

    Jon Gjengset committed Dec 14, 2020
    Configuration menu
    Copy the full SHA
    f9e35b3 View commit details
    Browse the repository at this point in the history
  6. Do not prefetch w/o -Z http-registry

    Jon Gjengset committed Dec 14, 2020
    Configuration menu
    Copy the full SHA
    365e9f2 View commit details
    Browse the repository at this point in the history