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

rust_doc: strip directory prefix from archive names #474

Merged
merged 9 commits into from
Dec 12, 2020

Commits on Nov 4, 2020

  1. rust_doc: strip directory prefix from archive names

    The Zip archives emitted by `rust_doc` rules used to contain a long
    `/bazel-bin/k8-fastbuild/path/to/target` prefix before each archive
    entry name. This made it hard to work with the generated archive. This
    patch adds a transformation to
    
    This could be written in Starlark using the `DirectoryExapnder` API, but
    that was only introduced in Bazel 3.4.0. Since we have a minimum Bazel
    version of 0.17.1, we instead write the helper as a small Python script.
    
    Fixes bazelbuild#471.
    
    Test Plan:
    Unit tests included. As an end-to-end test, run
    
    ```
    cd examples/ &&
    bazel build //hello_world:hello_world_doc &&
    unzip -l bazel-bin/hello_world/hello_world_doc.zip
    ```
    
    to list the contents of the built `hello_world_doc.zip` archive. Before
    this patch, the result was like:
    
    ```
    Archive:  bazel-bin/hello_world/hello_world_doc.zip
      Length      Date    Time    Name
    ---------  ---------- -----   ----
            0  2010-01-01 00:00   bazel-out/k8-fastbuild/bin/hello_world/hello_world_doc/.lock
         1792  2010-01-01 00:00   bazel-out/k8-fastbuild/bin/hello_world/hello_world_doc/COPYRIGHT.txt
         4421  2010-01-01 00:00   bazel-out/k8-fastbuild/bin/hello_world/hello_world_doc/FiraSans-LICENSE.txt
    ...
         2132  2010-01-01 00:00   bazel-out/k8-fastbuild/bin/hello_world/hello_world_doc/storage.js
         1180  2010-01-01 00:00   bazel-out/k8-fastbuild/bin/hello_world/hello_world_doc/theme.js
         3764  2010-01-01 00:00   bazel-out/k8-fastbuild/bin/hello_world/hello_world_doc/wheel.svg
    ---------                     -------
       890555                     38 files
    ```
    
    After this patch:
    
    ```
    Archive:  bazel-bin/hello_world/hello_world_doc.zip
      Length      Date    Time    Name
    ---------  ---------- -----   ----
            0  2010-01-01 00:00   .lock
         1792  2010-01-01 00:00   COPYRIGHT.txt
         4421  2010-01-01 00:00   FiraSans-LICENSE.txt
    ...
         2132  2010-01-01 00:00   storage.js
         1180  2010-01-01 00:00   theme.js
         3764  2010-01-01 00:00   wheel.svg
    ---------                     -------
       890555                     38 files
    ```
    
    wchargin-branch: rustdoc-strip-prefix
    wchargin-source: 29978cf3bdb7de6cee154f8c11d0251574c2b104
    wchargin committed Nov 4, 2020
    Configuration menu
    Copy the full SHA
    51b1ba8 View commit details
    Browse the repository at this point in the history
  2. [update patch]

    wchargin-branch: rustdoc-strip-prefix
    wchargin-source: 69b2e78f1f52c88609aff631c908471c7521c5f7
    wchargin committed Nov 4, 2020
    Configuration menu
    Copy the full SHA
    0bd884c View commit details
    Browse the repository at this point in the history

Commits on Nov 6, 2020

  1. [update patch]

    wchargin-branch: rustdoc-strip-prefix
    wchargin-source: 40227180c7f910d9f76716cf42621e08e5f808a1
    wchargin committed Nov 6, 2020
    Configuration menu
    Copy the full SHA
    24d6478 View commit details
    Browse the repository at this point in the history
  2. [update patch]

    wchargin-branch: rustdoc-strip-prefix
    wchargin-source: 8c46290195fc0668f3126589fd07ee863df8749f
    wchargin committed Nov 6, 2020
    Configuration menu
    Copy the full SHA
    5ab7c6e View commit details
    Browse the repository at this point in the history
  3. [update diffbase]

    wchargin-branch: rustdoc-strip-prefix
    wchargin-source: 838287ca34eb69c27f62e4a0900dbb7ac6a3ebd0
    wchargin committed Nov 6, 2020
    Configuration menu
    Copy the full SHA
    2674343 View commit details
    Browse the repository at this point in the history

Commits on Nov 19, 2020

  1. [update diffbase]

    wchargin-branch: rustdoc-strip-prefix
    wchargin-source: ea88a0484df0608cb08521fb4cde2d4dc7904553
    wchargin committed Nov 19, 2020
    Configuration menu
    Copy the full SHA
    1c405e0 View commit details
    Browse the repository at this point in the history
  2. [update patch]

    wchargin-branch: rustdoc-strip-prefix
    wchargin-source: ea88a0484df0608cb08521fb4cde2d4dc7904553
    wchargin committed Nov 19, 2020
    Configuration menu
    Copy the full SHA
    a2f58a8 View commit details
    Browse the repository at this point in the history

Commits on Dec 3, 2020

  1. [rustdoc-strip-prefix: update diffbase]

    wchargin-branch: rustdoc-strip-prefix
    wchargin-source: aba05e35e129db74d032bcbfdb7764233a2d94ce
    wchargin committed Dec 3, 2020
    Configuration menu
    Copy the full SHA
    9cacb6e View commit details
    Browse the repository at this point in the history

Commits on Dec 12, 2020

  1. Merge branch 'master' into wchargin-rustdoc-strip-prefix

    David Freese committed Dec 12, 2020
    Configuration menu
    Copy the full SHA
    569c738 View commit details
    Browse the repository at this point in the history