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

[Stacked PR] Remove warn_later from output #760

Merged
merged 2 commits into from
Jan 19, 2024

Conversation

schneems
Copy link
Contributor

The warn_later functionality relies on global state in a way that we're not thrilled about putting into everyone's build packs by default. This removes the feature, plain and simple.

@schneems schneems requested a review from a team as a code owner January 18, 2024 21:23
@schneems schneems force-pushed the schneems/clean-background-timer-take-one branch from 87f4d6c to 47ac797 Compare January 18, 2024 22:37
@schneems schneems force-pushed the schneems/stacked-remove-warn-later branch from 6521058 to a7406e7 Compare January 18, 2024 22:38
The background timer prints dots to the UI while the buildpack performs some expensive operation. This requires we use threading and Rust really wants to be sure that we're not going to have data races and that our data is secure.

The original version of the code relied on wrapping our IO in an Arc<Mutex<W>> so that we don't "lose" it when we pass it to the background thread. This worked, but was overly complicated based on my limited understanding of working with lifetimes and threads. This version instead relies on the ability to retrieve a struct when we join the thread to get the IO object back out. This reduces complexity that the BuildLog interface needs to know about.

# This is the commit message #2:

Inject tick state

The tick values for the printer was hardcoded. Passing in the values allows us to remove the `style` module dependency and makes the tests simpler.

# This is the commit message #3:

Rename modules and add docs

The prior name `print_dots` isn't technically valid anymore as it could be printing something else. I also moved the guard struct into it's own module to make it a bit safer (ensure that Option is always Some at creation time).

# This is the commit message #4:

Clarify intention that option is Some in code

The debug_assert adds a stronger signal that the option must be Some when it is being constructed.
The `warn_later` functionality relies on global state in a way that we're not thrilled about putting into everyone's build packs by default. This removes the feature, plain and simple.
@schneems schneems force-pushed the schneems/clean-background-timer-take-one branch from 47ac797 to 3a92e33 Compare January 18, 2024 23:15
@schneems schneems force-pushed the schneems/stacked-remove-warn-later branch from a7406e7 to 141f892 Compare January 18, 2024 23:15
@Malax Malax requested review from Malax and removed request for a team January 19, 2024 11:59
@schneems schneems changed the base branch from schneems/clean-background-timer-take-one to schneems/output January 19, 2024 15:04
@schneems schneems merged commit ebb092c into schneems/output Jan 19, 2024
5 checks passed
@schneems schneems deleted the schneems/stacked-remove-warn-later branch January 19, 2024 15:04
@schneems schneems restored the schneems/stacked-remove-warn-later branch January 19, 2024 15:09
@edmorley edmorley deleted the schneems/stacked-remove-warn-later branch March 16, 2024 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants