Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

#477 seems to have broken cargo doc-based documentation previews #505

Closed
davidbarsky opened this issue Dec 9, 2020 · 2 comments · Fixed by #521
Closed

#477 seems to have broken cargo doc-based documentation previews #505

davidbarsky opened this issue Dec 9, 2020 · 2 comments · Fixed by #521
Assignees

Comments

@davidbarsky
Copy link

Hello! The (extremely welcome!) changes in #477 appears to have broken our (relatively niche) use-case where we generate documentation previews for each PR send to tokio-rs/tracing. I suspect that with the deployment of #447, the target directory that's generated by Cargo is no longer available to publish step. This is problematic for us as we use contents of target/doc as the deployable documentation preview. In my attempts to debug the deployment failures we're seeing (tokio-rs/tracing#1130), I've developed the following theory:

  1. The cache_cwd_directory function (callsite, definition) moves Cargo's build output to $NETLIFY_CACHE_DIR.
  2. cache_cwd_directory calls move_cache, which removes the Cargo-generated target directory.

Contemporaneously with #477 (comment) being posted, we've started noticing the site build errors contain the message "Deploy directory 'target/doc' does not exist". Here's the first build where I've noticed this: https://app.netlify.com/teams/tokio/builds/5fd051070a10d60007567df3.

Anyways, thanks so much for this service! I'm pretty sure this is the first we've ever had to reach out for support!

@mraerino
Copy link
Contributor

this is unfortunate, i'm sorry. we actually have a special flag enabled internally which moves caching after the upload step so we didn't see it for ourselves.

for now the workaround will be to manually copy the docs outside of target, but i'll try to get a fix in so that we don't move those files.

@cecton
Copy link
Contributor

cecton commented Dec 10, 2020

If you are on a filesystem that supports it you can use CoW instead of move:

# copy super fast
cp --reflink=always source/ destination/

https://www.man7.org/linux/man-pages/man1/cp.1.html

It will be as fast as the move you do but it copies instead so both stay accessible.

cc @mraerino

@mraerino mraerino self-assigned this Dec 10, 2020
hawkw pushed a commit to tokio-rs/tracing that referenced this issue Dec 10, 2020
## Motivation

At Netlify we recently introduced native Rust support in the build
system: netlify/build-image#477

## Solution

This PR cleans up the Netlify build config to use a more
straight-forward way of building rust docs.

This also introduces a workaround for
netlify/build-image#505

## Kudos

We're big fans of the `tracing` crate at Netlify and using it for many
new systems recently. Very happy we can give something back!

Closes #1130
hawkw pushed a commit to tokio-rs/tracing that referenced this issue Dec 14, 2020
## Motivation

At Netlify we recently introduced native Rust support in the build
system: netlify/build-image#477

## Solution

This PR cleans up the Netlify build config to use a more
straight-forward way of building rust docs.

This also introduces a workaround for
netlify/build-image#505

## Kudos

We're big fans of the `tracing` crate at Netlify and using it for many
new systems recently. Very happy we can give something back!

Closes #1130
hawkw pushed a commit to tokio-rs/tracing that referenced this issue Dec 14, 2020
## Motivation

At Netlify we recently introduced native Rust support in the build
system: netlify/build-image#477

## Solution

This PR cleans up the Netlify build config to use a more
straight-forward way of building rust docs.

This also introduces a workaround for
netlify/build-image#505

## Kudos

We're big fans of the `tracing` crate at Netlify and using it for many
new systems recently. Very happy we can give something back!

Closes #1130
hawkw added a commit to tokio-rs/tracing that referenced this issue Sep 6, 2021
Previously, the Netlify configuration copied the docs into a
`_netlify_out` dir as a workaround for netlify/build-image#505. This
upstream issue was fixed back in January, so this workaround hasn't been
necessary for a while. Therefore, we can remove this extra complexity
from our configuration.

I also changed the build script to a multi-line string which I think is
a bit nicer.
hawkw added a commit to tokio-rs/tracing that referenced this issue Sep 6, 2021
Previously, the Netlify configuration copied the docs into a
`_netlify_out` dir as a workaround for netlify/build-image#505. This
upstream issue was fixed back in January, so this workaround hasn't been
necessary for a while. Therefore, we can remove this extra complexity
from our configuration.

I also changed the build script to a multi-line string which I think is
a bit nicer.
hawkw added a commit to tokio-rs/tracing that referenced this issue Sep 11, 2021
Previously, the Netlify configuration copied the docs into a
`_netlify_out` dir as a workaround for netlify/build-image#505. This
upstream issue was fixed back in January, so this workaround hasn't been
necessary for a while. Therefore, we can remove this extra complexity
from our configuration.

I also changed the build script to a multi-line string which I think is
a bit nicer.
hawkw added a commit to tokio-rs/tracing that referenced this issue Sep 11, 2021
Previously, the Netlify configuration copied the docs into a
`_netlify_out` dir as a workaround for netlify/build-image#505. This
upstream issue was fixed back in January, so this workaround hasn't been
necessary for a while. Therefore, we can remove this extra complexity
from our configuration.

I also changed the build script to a multi-line string which I think is
a bit nicer.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants