Skip to content

Commit

Permalink
Merge pull request #1361 from Wandalen/program_tools_v1
Browse files Browse the repository at this point in the history
Program tools v1
  • Loading branch information
Wandalen authored May 31, 2024
2 parents 1d60153 + 26d1936 commit a36cbfa
Show file tree
Hide file tree
Showing 12 changed files with 75 additions and 67 deletions.
38 changes: 38 additions & 0 deletions bash.exe.stackdump
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Stack trace:
Frame Function Args
0000005FF160 00021006118E (0002102B5B12, 000210272B3E, 00000000005E, 0000005FACC0) msys-2.0.dll+0x2118E
0000005FF160 0002100469BA (000000000000, 000000000000, 000000000130, 000000001000) msys-2.0.dll+0x69BA
0000005FF160 0002100469F2 (000000000000, 0000000005AF, 00000000005E, 000000000000) msys-2.0.dll+0x69F2
0000005FF160 0002101791E8 (0002102B5892, 000800000000, 00080000DFB8, 000000000000) msys-2.0.dll+0x1391E8
0000005FF160 000210183B67 (000000000000, 0002102280C8, 0002102280B0, 0000005FD320) msys-2.0.dll+0x143B67
0000005FF160 000210046DF4 (00021031C800, 0000005FD320, 000000000000, 000000000000) msys-2.0.dll+0x6DF4
0000005FF160 00021004850F (00007FFE0384, 000000000000, 000000000000, 000000000000) msys-2.0.dll+0x850F
0000005FF160 00021007251C (000000000000, 000000713234, 000000000000, 000000000000) msys-2.0.dll+0x3251C
0000005FF400 7FFF332D869F (000210040000, 000000000001, 000000000000, 7FFF333E8A70) ntdll.dll+0x2869F
0000005FF400 7FFF3331D03D (0000005FF300, 000000000000, 00000071A078, 000000000001) ntdll.dll+0x6D03D
0000005FF400 7FFF3331CDEE (0000007130D0, 0000005FF400, 000000718450, 000000000000) ntdll.dll+0x6CDEE
0000005FF400 7FFF3331CE60 (7FFF333EB860, 000000000000, 000000213000, 7FFF00000000) ntdll.dll+0x6CE60
000000000000 7FFF3338EA39 (000000000000, 000000000000, 000000000001, 000000000000) ntdll.dll+0xDEA39
000000000000 7FFF3337A744 (7FFF332B0000, 000000213050, 0000002157EE, 000000000000) ntdll.dll+0xCA744
000000000000 7FFF33323EA3 (000000000000, 0000005FFAD0, 000000000000, 000000000000) ntdll.dll+0x73EA3
000000000000 7FFF33323DCE (000000000000, 0000005FFAD0, 000000000000, 000000000000) ntdll.dll+0x73DCE
End of stack trace
Loaded modules:
000100400000 bash.exe
7FFF332B0000 ntdll.dll
7FFF32910000 KERNEL32.DLL
7FFF307E0000 KERNELBASE.dll
7FFF330C0000 USER32.dll
7FFF307B0000 win32u.dll
000210040000 msys-2.0.dll
7FFF328E0000 GDI32.dll
7FFF305D0000 gdi32full.dll
7FFF30ED0000 msvcp_win.dll
7FFF30C10000 ucrtbase.dll
7FFF31660000 advapi32.dll
7FFF326C0000 msvcrt.dll
7FFF31D90000 sechost.dll
7FFF30D30000 bcrypt.dll
7FFF30FE0000 RPCRT4.dll
7FFF2FE30000 CRYPTBASE.DLL
7FFF30B90000 bcryptPrimitives.dll
2 changes: 1 addition & 1 deletion module/core/derive_tools/examples/derive_tools_trivial.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! qqq : for Petro : write proper description
//! for Petro : write proper description

fn main()
{
Expand Down
4 changes: 2 additions & 2 deletions module/core/derive_tools/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ mod derive_more
#[ cfg( feature = "derive_unwrap" ) ]
pub use ::derive_more::Unwrap;

// qqq2 : list all
// qqq2 : make sure all features of derive_more is reexported
// qqq : list all
// qqq : make sure all features of derive_more is reexported
}

#[ doc( inline ) ]
Expand Down
2 changes: 1 addition & 1 deletion module/core/derive_tools/tests/inc/all_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use super::*;
// #[ default( value = false ) ]
pub struct IsTransparent( bool );

// qqq2 : make Default derive working
// qqq : xxx : make Default derive working

impl Default for IsTransparent
{
Expand Down
2 changes: 1 addition & 1 deletion module/core/former/examples/former_custom_collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ fn main()
#[ derive( Debug, Default ) ]
pub struct LoggingSetDefinitionTypes< K, Context = (), Formed = LoggingSet< K > >
{
_phantom : core::marker::PhantomData< ( K, Context, Formed ) >, // PhantomData is used to handle generic parameters safely.
_phantom : core::marker::PhantomData< ( K, Context, Formed ) >,
}

/// Specifies the storage, formed type, and context for the `LoggingSet` when used in a forming process.
Expand Down
2 changes: 1 addition & 1 deletion module/core/macro_tools/src/phantom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub( crate ) mod private
/// ```rust
/// use syn::{ parse_quote, ItemStruct };
///
/// let input_struct: ItemStruct = parse_quote!
/// let input_struct : ItemStruct = parse_quote!
/// {
/// pub struct MyStruct< T, U >
/// {
Expand Down
2 changes: 0 additions & 2 deletions module/core/macro_tools/tests/inc/generic_params_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,6 @@ fn decompose_generics_without_where_clause()
let exp : syn::Generics = syn::parse_quote! { < T, U, > };
a_id!( ty_gen, exp.params );

// qqq : extend other tests with a_id

}

#[ test ]
Expand Down
5 changes: 2 additions & 3 deletions module/move/willbe/src/action/publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ mod private
for ( path, report ) in &self.packages
{
let report = report.to_string().replace("\n", "\n ");
// qqq : remove unwrap
let path = if let Some( wrd ) = &self.workspace_root_dir
{
path.as_ref().strip_prefix( &wrd.as_ref() ).unwrap()
Expand Down Expand Up @@ -172,15 +171,15 @@ mod private
let queue = graph::toposort( subgraph ).unwrap().into_iter().map( | n | package_map.get( &n ).unwrap() ).cloned().collect::< Vec< _ > >();

let roots = packages_to_publish.iter().map( | p | package_map.get( p ).unwrap().crate_dir() ).collect::< Vec< _ > >();

let plan = package::PublishPlan::former()
.workspace_dir( CrateDir::try_from( workspace_root_dir ).unwrap() )
.option_base_temp_dir( dir.clone() )
.dry( dry )
.roots( roots )
.packages( queue )
.form();

Ok( plan )
}

Expand Down
37 changes: 4 additions & 33 deletions module/move/willbe/src/action/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,9 @@ mod private
use std::collections::HashSet;

use std::{ env, fs };
// qqq : for Petro : https://github.com/obox-systems/conventions/blob/master/code_style.md#importing-structuring-std-imports

#[ cfg( feature = "progress_bar" ) ]
use indicatif::{ MultiProgress, ProgressStyle };
// aaa : for Petro : don't use cargo_metadata and Package directly, use facade
// aaa : ✅

// qqq : for Petro : don't use Package directly. rid it off for the whole willbe

// qqq : for Petro : should not be such combinations full,no_std
// [ release | nightly | full,no_std ]: ❌ failed

// qqq : for Petro : improve formatting
//
// [ optimization : debug | channel : stable | feature : derive_component_from,use_alloc ]
// [ optimization : debug | channel : stable | feature : default,enabled ]
// [ optimization : debug | channel : stable | feature : derive_components_assign ]
// [ optimization : debug | channel : stable | feature : derive_component_from,derive_component_assign ]
// [ optimization : debug | channel : stable | feature : derive_former,derive_component_assign ]
// [ optimization : debug | channel : stable | feature : enabled ]
// [ optimization : debug | channel : stable | feature : derive_component_assign,no_std ]
// [ optimization : debug | channel : stable | feature : default,derive_component_assign ]
// [ optimization : debug | channel : stable | feature : no-features ]
//
// should be
//
// [ optimization : release | channel : nightly | feature : full ] -> [ optimization : release | channel : nightly | feature : [ list all features ] ]
// [ optimization : debug | channel : stable | feature : [] ]
//
// don't create artifical categories as no-features
//
// make table out of that

use former::Former;
use wtools::
Expand Down Expand Up @@ -89,7 +60,7 @@ mod private
#[ former( default = false ) ]
with_progress : bool,
}


/// The function runs tests with a different set of features in the selected crate (the path to the crate is specified in the dir variable).
/// Tests are run with each feature separately, with all features together, and without any features.
Expand Down Expand Up @@ -131,7 +102,7 @@ mod private
with_all_features,
with_none_features,
optimizations,
variants_cap,
variants_cap,
with_progress,
} = args;

Expand Down Expand Up @@ -189,12 +160,12 @@ mod private

#[ cfg( feature = "progress_bar" ) ]
let test_options_former = if with_progress
{
{
let test_options_former = test_options_former.feature( TestOptionsProgressBarFeature{ multiprocess, style } );
test_options_former
}
else
{
{
test_options_former
};

Expand Down
3 changes: 2 additions & 1 deletion module/move/willbe/src/entity/optimization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ mod private
Release,
}

// qqq : use derive
impl std::fmt::Display for Optimization
{
fn fmt( &self, f : &mut Formatter< '_ > ) -> std::fmt::Result
Expand All @@ -30,4 +31,4 @@ mod private
crate::mod_interface!
{
protected use Optimization;
}
}
36 changes: 18 additions & 18 deletions module/move/willbe/src/entity/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ mod private
};
use std::collections::HashMap;
use std::ffi::OsString;
use std::fmt::{ Debug, Display };
use std::fmt::{ Debug, Display }; /* qqq : import only fmt here and everywhere */
use std::marker::PhantomData;
use std::path::PathBuf;
// aaa : for Petro : don't use cargo_metadata directly, use facade
Expand All @@ -24,10 +24,10 @@ mod private
// qqq : for Petro : don't do micro imports
#[ cfg( feature = "progress_bar" ) ]
use indicatif::
{
MultiProgress,
ProgressBar,
ProgressStyle
{
MultiProgress,
ProgressBar,
ProgressStyle
};
use rayon::ThreadPoolBuilder;
use process_tools::process::*;
Expand Down Expand Up @@ -173,11 +173,11 @@ mod private
let mut table = Table::default();
// let format = format();
// table.set_format( format );

let mut header_row = Row::new();
header_row.add_cell( "Channel" );
header_row.add_cell( "Opt" );

for feature in &ff
{
header_row.add_cell( feature );
Expand Down Expand Up @@ -273,7 +273,7 @@ mod private
}
}

fn generate_features_cells( ff : &mut Vec< String >, variant : &TestVariant, row : &mut Row, mut counter : usize, mut flag : bool, enabled_features : &BTreeSet< String > )
fn generate_features_cells( ff : &mut Vec< String >, variant : &TestVariant, row : &mut Row, mut counter : usize, mut flag : bool, enabled_features : &BTreeSet< String > )
{
for feature in ff
{
Expand All @@ -282,20 +282,20 @@ mod private
{
flag = false;
row.add_cell( c );
}
}
else if variant.features.contains( feature )
{
row.add_cell( c );
}
else
}
else
{
c = "";
row.add_cell( c );
}
counter += 1;
}
}

#[ derive( Debug, Former ) ]
pub struct PackageTestOptions< 'a >
{
Expand Down Expand Up @@ -549,7 +549,7 @@ mod private
header_row.add_cell( feature );
}
table.set_header( header_row );

writeln!( f, "{} {}\n", "\n=== Module".bold(), self.package_name.0.bold() )?;
if self.tests.is_empty()
{
Expand Down Expand Up @@ -709,11 +709,11 @@ mod private
let s = if let Some( multi_progress ) = options.progress_bar_feature.as_ref().and_then( | f | f.multi_progress.as_ref() )
{
let s = multi_progress.add( ProgressBar::new_spinner().with_message( format!( "{}", variant ) ) );
s.enable_steady_tick( std::time::Duration::from_millis( 100 ) );
s.enable_steady_tick( std::time::Duration::from_millis( 100 ) );
Some( s )
}
else
{
else
{
None
};
// spinner.enable_steady_tick( std::time::Duration::from_millis( 100 ) );
Expand Down Expand Up @@ -772,8 +772,8 @@ mod private
pb.inc( 0 );
Some( pb )
}
else
{
else
{
None
};
pb
Expand Down
9 changes: 5 additions & 4 deletions module/move/willbe/src/entity/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ mod private
}

// qqq : we have to replace the implementation above with the implementation below, don't we?
// qqq : for Bohdan : duplication?

/// `BumpOptions` manages the details necessary for the version bump process for crates.
/// This includes the directory of the crate whose version is being bumped, the old and new version numbers,
Expand Down Expand Up @@ -295,7 +296,7 @@ mod private

Ok( report )
}

/// Reverts the version of a package in the provided `ExtendedBumpReport`.
///
/// # Arguments
Expand All @@ -310,7 +311,7 @@ mod private
let Some( name ) = report.name.as_ref() else { return Ok( () ) };
let Some( old_version ) = report.old_version.as_ref() else { return Ok( () ) };
let Some( new_version ) = report.new_version.as_ref() else { return Ok( () ) };

let dependencies = | item_maybe_with_dependencies : &mut toml_edit::Item |
{
if let Some( dependency ) = item_maybe_with_dependencies.get_mut( "dependencies" ).and_then( | ds | ds.get_mut( name ) )
Expand All @@ -330,10 +331,10 @@ mod private
}
}
}

Ok( () )
};

for path in &report.changed_files
{
let mut manifest = manifest::open( path.clone() )?;
Expand Down

0 comments on commit a36cbfa

Please sign in to comment.