Skip to content

Conversation

@DelevoXDG
Copy link
Contributor

@DelevoXDG DelevoXDG commented Nov 24, 2025

@DelevoXDG DelevoXDG force-pushed the zdobnikau/execute-save-outputs branch from 41c979a to 037b8ef Compare November 25, 2025 10:22
@DelevoXDG DelevoXDG force-pushed the zdobnikau/refactor-create-output-dir branch from a07fae6 to d5ccd3c Compare November 25, 2025 10:27
@DelevoXDG DelevoXDG changed the title Refactor create-output-dir Unify incremental_create_output_dir Nov 26, 2025
@DelevoXDG DelevoXDG marked this pull request as ready for review November 26, 2025 10:30
@DelevoXDG DelevoXDG requested a review from a team as a code owner November 26, 2025 10:30
@DelevoXDG DelevoXDG force-pushed the zdobnikau/execute-save-outputs branch 2 times, most recently from 0ba8159 to a267865 Compare December 2, 2025 10:16
@DelevoXDG DelevoXDG force-pushed the zdobnikau/refactor-create-output-dir branch 2 times, most recently from 0befe5e to 100b832 Compare December 2, 2025 13:57
@DelevoXDG DelevoXDG force-pushed the zdobnikau/execute-save-outputs branch from 58546ae to f62beb5 Compare December 2, 2025 13:57
@@ -0,0 +1,10 @@
[package]
name = "scarb-execute-utils"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Maybe just scarb-fs-utils? 🤔 Seems general enough to me.

Comment on lines +10 to +11
pub const EXECUTE_PROGRAM_OUTPUT_FILENAME: &str = "program_output.txt";
pub const EXECUTE_PRINT_OUTPUT_FILENAME: &str = "stdout_output.txt";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd just keep them where they are used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved them here so we could re-use these both in scarb execute and scarb doc in #2876.

Can define these in both places, but not sure why?

IMO it's reasonable to keep this crate as scarb execute utils rather then general. If we do, it makes sense to keep those here.

/// The dir name is `execution{N}` with the lowest `N` without existing dir.
///
/// Returns the path to the created directory and corresponding `N`.
pub fn incremental_create_execution_output_dir(path: &Utf8Path) -> Result<(Utf8PathBuf, usize)> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just take execution as param.

Suggested change
pub fn incremental_create_execution_output_dir(path: &Utf8Path) -> Result<(Utf8PathBuf, usize)> {
pub fn incremental_create_dir_unique(path: &Utf8Path, name: &str) -> Result<(Utf8PathBuf, usize)> {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we expect incremental_create_dir_unique to be used in any other contexts? 🤔

If we don't, it seems reasonable to me to keep this crate scarb execute-focused.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems reasonable to me to keep this crate scarb execute-focused

I'd look at this from the other side, that is, it makes sense to me to define some crate for how Scarb interacts with the filesystem. E.g. canonicalization helpers from internal/fsx.rs could go there in the future - this is not Scarb specific, and would make sense in the extensions as well.

@DelevoXDG DelevoXDG requested a review from maciektr December 10, 2025 10:23
@DelevoXDG DelevoXDG force-pushed the zdobnikau/execute-save-outputs branch from f62beb5 to 84d2481 Compare December 18, 2025 13:31
@DelevoXDG DelevoXDG force-pushed the zdobnikau/refactor-create-output-dir branch from 2f3fb9a to f0cbf01 Compare December 22, 2025 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants