put git behind feature flag to prevent openssl woes
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-08-25 21:03:38 -07:00
parent a2b4980bf3
commit e05c1ddabf
2 changed files with 16 additions and 1 deletions

View File

@@ -10,7 +10,7 @@ edition = "2021"
anyhow = "1.0.75" anyhow = "1.0.75"
clap = { version = "4.4.2", features = ["derive"] } clap = { version = "4.4.2", features = ["derive"] }
futures = "0.3.30" futures = "0.3.30"
git2 = "0.20.0" git2 = { version = "0.20.0", optional = true }
lazy-regex = "3.1.0" lazy-regex = "3.1.0"
rbx_asset = { path = "rbx_asset", features = ["gzip", "rustls-tls"], default-features = false } rbx_asset = { path = "rbx_asset", features = ["gzip", "rustls-tls"], default-features = false }
rbx_binary = "1.0.0" rbx_binary = "1.0.0"
@@ -21,6 +21,10 @@ rox_compiler = { path = "rox_compiler" }
serde_json = "1.0.111" serde_json = "1.0.111"
tokio = { version = "1.35.1", features = ["macros", "rt-multi-thread", "fs"] } tokio = { version = "1.35.1", features = ["macros", "rt-multi-thread", "fs"] }
[features]
default = []
git = ["dep:git2"]
[profile.release] [profile.release]
#lto = true #lto = true
strip = true strip = true

View File

@@ -8,6 +8,7 @@ use rbx_asset::cookie::{Cookie,Context as CookieContext,AssetVersion,CreationsIt
type AssetID=u64; type AssetID=u64;
type AssetIDFileMap=Vec<(AssetID,PathBuf)>; type AssetIDFileMap=Vec<(AssetID,PathBuf)>;
#[cfg(feature="git")]
const CONCURRENT_DECODE:usize=8; const CONCURRENT_DECODE:usize=8;
const CONCURRENT_REQUESTS:usize=32; const CONCURRENT_REQUESTS:usize=32;
const CONCURRENT_FS:usize=64; const CONCURRENT_FS:usize=64;
@@ -43,7 +44,9 @@ enum Commands{
CompileUploadAsset(CompileUploadAssetSubcommand), CompileUploadAsset(CompileUploadAssetSubcommand),
CompileUploadPlace(CompileUploadPlaceSubcommand), CompileUploadPlace(CompileUploadPlaceSubcommand),
Decompile(DecompileSubcommand), Decompile(DecompileSubcommand),
#[cfg(feature="git")]
DecompileHistoryIntoGit(DecompileHistoryIntoGitSubcommand), DecompileHistoryIntoGit(DecompileHistoryIntoGitSubcommand),
#[cfg(feature="git")]
DownloadAndDecompileHistoryIntoGit(DownloadAndDecompileHistoryIntoGitSubcommand), DownloadAndDecompileHistoryIntoGit(DownloadAndDecompileHistoryIntoGitSubcommand),
RunLuau(RunLuauSubcommand), RunLuau(RunLuauSubcommand),
} }
@@ -739,6 +742,7 @@ async fn main()->AResult<()>{
write_models:subcommand.write_models.unwrap_or(false), write_models:subcommand.write_models.unwrap_or(false),
write_scripts:subcommand.write_scripts.unwrap_or(true), write_scripts:subcommand.write_scripts.unwrap_or(true),
}).await, }).await,
#[cfg(feature="git")]
Commands::DecompileHistoryIntoGit(subcommand)=>decompile_history_into_git(DecompileHistoryConfig{ Commands::DecompileHistoryIntoGit(subcommand)=>decompile_history_into_git(DecompileHistoryConfig{
git_committer_name:subcommand.git_committer_name, git_committer_name:subcommand.git_committer_name,
git_committer_email:subcommand.git_committer_email, git_committer_email:subcommand.git_committer_email,
@@ -749,6 +753,7 @@ async fn main()->AResult<()>{
write_models:subcommand.write_models.unwrap_or(false), write_models:subcommand.write_models.unwrap_or(false),
write_scripts:subcommand.write_scripts.unwrap_or(true), write_scripts:subcommand.write_scripts.unwrap_or(true),
}).await, }).await,
#[cfg(feature="git")]
Commands::DownloadAndDecompileHistoryIntoGit(subcommand)=>download_and_decompile_history_into_git(DownloadAndDecompileHistoryConfig{ Commands::DownloadAndDecompileHistoryIntoGit(subcommand)=>download_and_decompile_history_into_git(DownloadAndDecompileHistoryConfig{
git_committer_name:subcommand.git_committer_name, git_committer_name:subcommand.git_committer_name,
git_committer_email:subcommand.git_committer_email, git_committer_email:subcommand.git_committer_email,
@@ -1712,6 +1717,7 @@ async fn download_decompile(config:DownloadDecompileConfig)->AResult<()>{
Ok(()) Ok(())
} }
#[cfg(feature="git")]
struct WriteCommitConfig{ struct WriteCommitConfig{
git_committer_name:String, git_committer_name:String,
git_committer_email:String, git_committer_email:String,
@@ -1722,6 +1728,7 @@ struct WriteCommitConfig{
write_scripts:bool, write_scripts:bool,
} }
#[cfg(feature="git")]
async fn write_commit(config:WriteCommitConfig,b:Result<AResult<(AssetVersion,rox_compiler::DecompiledContext)>,tokio::task::JoinError>,repo:&git2::Repository)->AResult<()>{ async fn write_commit(config:WriteCommitConfig,b:Result<AResult<(AssetVersion,rox_compiler::DecompiledContext)>,tokio::task::JoinError>,repo:&git2::Repository)->AResult<()>{
let (asset_version,context)=b??; let (asset_version,context)=b??;
println!("writing files for version {}",asset_version.assetVersionNumber); println!("writing files for version {}",asset_version.assetVersionNumber);
@@ -1803,6 +1810,7 @@ async fn write_commit(config:WriteCommitConfig,b:Result<AResult<(AssetVersion,ro
Ok(()) Ok(())
} }
#[cfg(feature="git")]
struct DecompileHistoryConfig{ struct DecompileHistoryConfig{
git_committer_name:String, git_committer_name:String,
git_committer_email:String, git_committer_email:String,
@@ -1814,6 +1822,7 @@ struct DecompileHistoryConfig{
write_scripts:bool, write_scripts:bool,
} }
#[cfg(feature="git")]
async fn decompile_history_into_git(config:DecompileHistoryConfig)->AResult<()>{ async fn decompile_history_into_git(config:DecompileHistoryConfig)->AResult<()>{
//use prexisting versions list //use prexisting versions list
let mut versions_path=config.input_folder.clone(); let mut versions_path=config.input_folder.clone();
@@ -1852,6 +1861,7 @@ async fn decompile_history_into_git(config:DecompileHistoryConfig)->AResult<()>{
Ok(()) Ok(())
} }
#[cfg(feature="git")]
struct DownloadAndDecompileHistoryConfig{ struct DownloadAndDecompileHistoryConfig{
cookie:Cookie, cookie:Cookie,
asset_id:AssetID, asset_id:AssetID,
@@ -1864,6 +1874,7 @@ struct DownloadAndDecompileHistoryConfig{
write_scripts:bool, write_scripts:bool,
} }
#[cfg(feature="git")]
async fn download_and_decompile_history_into_git(config:DownloadAndDecompileHistoryConfig)->AResult<()>{ async fn download_and_decompile_history_into_git(config:DownloadAndDecompileHistoryConfig)->AResult<()>{
let context=CookieContext::new(config.cookie); let context=CookieContext::new(config.cookie);