-
Notifications
You must be signed in to change notification settings - Fork 2k
fix: respect output mode 'none' even when caching is disabled #9670
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
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
9a6ce31
fix: respect output mode 'none' even when caching is disabled
anthonyshew 2f814be
WIP
anthonyshew 7098d5b
WIP
anthonyshew e3cd1e0
WIP
anthonyshew cf21275
WIP
anthonyshew 388bde2
WIP
anthonyshew d707817
WIP
anthonyshew 38e3eaa
WIP
anthonyshew aa08d93
WIP
anthonyshew 077c3d5
WIP
anthonyshew 8fa23be
WIP
anthonyshew 6862f13
Merge branch 'main' into shew-bae6f
anthonyshew 75eb988
WIP
anthonyshew bfb50c3
Merge branch 'shew-bae6f' of https://github.com/vercel/turborepo into…
anthonyshew 03b8e1f
Update crates/turborepo-lib/src/run/cache.rs
anthonyshew e26fbb8
Merge branch 'main' into shew-bae6f
anthonyshew File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,9 +58,14 @@ impl<W: Write> Write for LogWriter<W> { | |
(Some(log_file), None) => log_file.write(buf), | ||
(None, Some(prefixed_writer)) => prefixed_writer.write(buf), | ||
(None, None) => { | ||
// Should this be an error or even a panic? | ||
debug!("no log file or prefixed writer"); | ||
Ok(0) | ||
debug!( | ||
"No log file or prefixed writer to write to. This should only happen when \ | ||
both caching is disabled and output logs are set to none." | ||
); | ||
|
||
// Returning the buffer's length so callers don't think this is a failure to | ||
// create the buffer | ||
Ok(buf.len()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice catch! This was dead code before so we were never hitting the bad return of |
||
} | ||
} | ||
} | ||
|
13 changes: 13 additions & 0 deletions
13
turborepo-tests/integration/tests/run-logging/no-cache-and-no-output-logs.t
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Setup | ||
$ . ${TESTDIR}/../../../helpers/setup_integration_test.sh run_logging | ||
|
||
$ ${TURBO} run build --cache=local:,remote: --output-logs=none | ||
WARNING no caches are enabled | ||
\xe2\x80\xa2 Packages in scope: app-a (esc) | ||
\xe2\x80\xa2 Running build in 1 packages (esc) | ||
\xe2\x80\xa2 Remote caching disabled (esc) | ||
|
||
Tasks: 1 successful, 1 total | ||
Cached: 0 cached, 1 total | ||
Time:\s*[\.0-9]+m?s (re) | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Translating this for myself: "if a task has
"cache": true
and is run at least one cache it can write to"This is changed from: "if task has
"cache": false
or cannot write to disk"