From 7e265ac7bfaad11839add4371b8c3bbbca83f5bb Mon Sep 17 00:00:00 2001 From: "Brian R. Murphy" <132495859+brmataptos@users.noreply.github.com> Date: Wed, 19 Jun 2024 18:01:56 -0700 Subject: [PATCH] Revert "[Feature] [Package System] Add option to override standard library version (#13318)" This reverts commit bbce0f188d7bef08218f1fc1f46bbd3676b5c74b. --- aptos-move/framework/src/aptos.rs | 1 - aptos-move/framework/src/built_package.rs | 11 +- crates/aptos/src/common/types.rs | 6 - crates/aptos/src/governance/mod.rs | 1 - crates/aptos/src/move_tool/mod.rs | 17 +-- crates/aptos/src/move_tool/show.rs | 1 - crates/aptos/src/test/mod.rs | 1 - .../move/tools/move-package/src/lib.rs | 6 +- .../src/resolution/resolution_graph.rs | 36 ++---- .../src/source_package/manifest_parser.rs | 17 +-- .../move-package/src/source_package/mod.rs | 1 - .../src/source_package/std_lib.rs | 109 ------------------ .../tools/move-package/tests/test_runner.rs | 15 +-- .../compilation/basic_no_deps/Move.exp | 1 - .../basic_no_deps_address_assigned/Move.exp | 1 - .../Move.exp | 1 - .../basic_no_deps_test_mode/Move.exp | 1 - .../Move.exp | 1 - .../diamond_problem_no_conflict/Move.exp | 1 - .../compilation/multiple_deps_rename/Move.exp | 1 - .../multiple_deps_rename_one/Move.exp | 1 - .../test_sources/compilation/one_dep/Move.exp | 1 - .../one_dep_assigned_address/Move.exp | 1 - .../compilation/one_dep_renamed/Move.exp | 1 - .../compilation/one_dep_with_scripts/Move.exp | 1 - .../compilation/std-lib-override/Move.compile | 0 .../compilation/std-lib-override/Move.exp | 55 --------- .../std-lib-override/Move.override | 1 - .../std-lib-override/deps_only/Move.toml | 16 --- .../std-lib-override/deps_only/sources/B.move | 3 - .../std-lib-override/sources/A.move | 6 - .../compilation/test_symlinks/Move.exp | 1 - .../invalid_identifier_package_name/Move.exp | 1 - .../parsing/minimal_manifest/Move.exp | 1 - .../resolution/basic_no_deps/Move.exp | 1 - .../basic_no_deps_address_assigned/Move.exp | 1 - .../Move.exp | 1 - .../resolution/dep_good_digest/Move.exp | 1 - .../Move.exp | 1 - .../diamond_problem_no_conflict/Move.exp | 1 - .../resolution/multiple_deps_rename/Move.exp | 1 - .../test_sources/resolution/one_dep/Move.exp | 1 - .../one_dep_assigned_address/Move.exp | 1 - .../one_dep_multiple_of_same_name/Move.exp | 1 - .../one_dep_reassigned_address/Move.exp | 1 - .../Move.exp | 1 - 46 files changed, 19 insertions(+), 311 deletions(-) delete mode 100644 third_party/move/tools/move-package/src/source_package/std_lib.rs delete mode 100644 third_party/move/tools/move-package/tests/test_sources/compilation/std-lib-override/Move.compile delete mode 100644 third_party/move/tools/move-package/tests/test_sources/compilation/std-lib-override/Move.exp delete mode 100644 third_party/move/tools/move-package/tests/test_sources/compilation/std-lib-override/Move.override delete mode 100644 third_party/move/tools/move-package/tests/test_sources/compilation/std-lib-override/deps_only/Move.toml delete mode 100644 third_party/move/tools/move-package/tests/test_sources/compilation/std-lib-override/deps_only/sources/B.move delete mode 100644 third_party/move/tools/move-package/tests/test_sources/compilation/std-lib-override/sources/A.move diff --git a/aptos-move/framework/src/aptos.rs b/aptos-move/framework/src/aptos.rs index fd4c6457cd6725..ed0ab0e7ac0ffc 100644 --- a/aptos-move/framework/src/aptos.rs +++ b/aptos-move/framework/src/aptos.rs @@ -106,7 +106,6 @@ impl ReleaseTarget { with_source_maps: false, with_error_map: true, named_addresses: Default::default(), - override_std: None, install_dir: None, with_docs: true, docgen_options: Some(DocgenOptions { diff --git a/aptos-move/framework/src/built_package.rs b/aptos-move/framework/src/built_package.rs index 44ef45eca2a749..38fa59c2b829e4 100644 --- a/aptos-move/framework/src/built_package.rs +++ b/aptos-move/framework/src/built_package.rs @@ -26,10 +26,7 @@ use move_model::{ }; use move_package::{ compilation::{compiled_package::CompiledPackage, package_layout::CompiledPackageLayout}, - source_package::{ - manifest_parser::{parse_move_manifest_string, parse_source_manifest}, - std_lib::StdVersion, - }, + source_package::manifest_parser::{parse_move_manifest_string, parse_source_manifest}, BuildConfig, CompilerConfig, ModelConfig, }; use serde::{Deserialize, Serialize}; @@ -76,9 +73,6 @@ pub struct BuildOptions { pub install_dir: Option, #[clap(skip)] // TODO: have a parser for this; there is one in the CLI buts its downstream pub named_addresses: BTreeMap, - /// Whether to override the standard library with the given version. - #[clap(long, value_parser)] - pub override_std: Option, #[clap(skip)] pub docgen_options: Option, #[clap(long)] @@ -110,7 +104,6 @@ impl Default for BuildOptions { with_docs: false, install_dir: None, named_addresses: Default::default(), - override_std: None, docgen_options: None, // This is false by default, because it could accidentally pull new dependencies // while in a test (and cause some havoc) @@ -154,7 +147,6 @@ pub fn build_model( full_model_generation: false, install_dir: None, test_mode: false, - override_std: None, force_recompilation: false, fetch_deps_only: false, skip_fetch_latest_git_deps: true, @@ -198,7 +190,6 @@ impl BuiltPackage { full_model_generation: options.check_test_code, install_dir: options.install_dir.clone(), test_mode: false, - override_std: options.override_std.clone(), force_recompilation: false, fetch_deps_only: false, skip_fetch_latest_git_deps: options.skip_fetch_latest_git_deps, diff --git a/crates/aptos/src/common/types.rs b/crates/aptos/src/common/types.rs index 496bc523dae724..78a0ddcc61af25 100644 --- a/crates/aptos/src/common/types.rs +++ b/crates/aptos/src/common/types.rs @@ -53,7 +53,6 @@ use move_core_types::{ account_address::AccountAddress, language_storage::TypeTag, vm_status::VMStatus, }; use move_model::metadata::{CompilerVersion, LanguageVersion}; -use move_package::source_package::std_lib::StdVersion; use serde::{Deserialize, Serialize}; #[cfg(unix)] use std::os::unix::fs::OpenOptionsExt; @@ -1049,10 +1048,6 @@ pub struct MovePackageDir { #[clap(long, value_parser = crate::common::utils::parse_map::, default_value = "")] pub(crate) named_addresses: BTreeMap, - /// Override the standard library version by mainnet/testnet/devnet - #[clap(long, value_parser)] - pub override_std: Option, - /// Skip pulling the latest git dependencies /// /// If you don't have a network connection, the compiler may fail due @@ -1093,7 +1088,6 @@ impl MovePackageDir { package_dir: Some(package_dir), output_dir: None, named_addresses: Default::default(), - override_std: None, skip_fetch_latest_git_deps: true, bytecode_version: None, compiler_version: None, diff --git a/crates/aptos/src/governance/mod.rs b/crates/aptos/src/governance/mod.rs index 883e06fa9f2c1f..9f5c60681c2508 100644 --- a/crates/aptos/src/governance/mod.rs +++ b/crates/aptos/src/governance/mod.rs @@ -1001,7 +1001,6 @@ impl CliCommand<()> for GenerateUpgradeProposal { move_options.dev, move_options.skip_fetch_latest_git_deps, move_options.named_addresses(), - move_options.override_std, move_options.bytecode_version, move_options.compiler_version, move_options.language_version, diff --git a/crates/aptos/src/move_tool/mod.rs b/crates/aptos/src/move_tool/mod.rs index d5dee099d6d2e2..5d31321d96c058 100644 --- a/crates/aptos/src/move_tool/mod.rs +++ b/crates/aptos/src/move_tool/mod.rs @@ -50,10 +50,7 @@ use move_cli::{self, base::test::UnitTestResult}; use move_command_line_common::env::MOVE_HOME; use move_core_types::{identifier::Identifier, language_storage::ModuleId, u256::U256}; use move_model::metadata::{CompilerVersion, LanguageVersion}; -use move_package::{ - source_package::{layout::SourcePackageLayout, std_lib::StdVersion}, - BuildConfig, CompilerConfig, -}; +use move_package::{source_package::layout::SourcePackageLayout, BuildConfig, CompilerConfig}; use move_unit_test::UnitTestingConfig; pub use package_hooks::*; use serde::{Deserialize, Serialize}; @@ -334,7 +331,6 @@ impl CliCommand> for CompilePackage { self.move_options.dev, self.move_options.skip_fetch_latest_git_deps, self.move_options.named_addresses(), - self.move_options.override_std.clone(), self.move_options.bytecode_version, self.move_options.compiler_version, self.move_options.language_version, @@ -398,7 +394,6 @@ impl CompileScript { self.move_options.dev, self.move_options.skip_fetch_latest_git_deps, self.move_options.named_addresses(), - self.move_options.override_std.clone(), self.move_options.bytecode_version, self.move_options.compiler_version, self.move_options.language_version, @@ -616,7 +611,6 @@ impl CliCommand<&'static str> for DocumentPackage { with_docs: true, install_dir: None, named_addresses: move_options.named_addresses(), - override_std: move_options.override_std.clone(), docgen_options: Some(docgen_options), skip_fetch_latest_git_deps: move_options.skip_fetch_latest_git_deps, bytecode_version: move_options.bytecode_version, @@ -688,7 +682,6 @@ impl TryInto for &PublishPackage { self.move_options.dev, self.move_options.skip_fetch_latest_git_deps, self.move_options.named_addresses(), - self.move_options.override_std.clone(), self.move_options.bytecode_version, self.move_options.compiler_version, self.move_options.language_version, @@ -760,7 +753,6 @@ impl IncludedArtifacts { dev: bool, skip_fetch_latest_git_deps: bool, named_addresses: BTreeMap, - override_std: Option, bytecode_version: Option, compiler_version: Option, language_version: Option, @@ -777,7 +769,6 @@ impl IncludedArtifacts { // Always enable error map bytecode injection with_error_map: true, named_addresses, - override_std, skip_fetch_latest_git_deps, bytecode_version, compiler_version, @@ -794,7 +785,6 @@ impl IncludedArtifacts { with_source_maps: false, with_error_map: true, named_addresses, - override_std, skip_fetch_latest_git_deps, bytecode_version, compiler_version, @@ -811,7 +801,6 @@ impl IncludedArtifacts { with_source_maps: true, with_error_map: true, named_addresses, - override_std, skip_fetch_latest_git_deps, bytecode_version, compiler_version, @@ -934,7 +923,6 @@ impl CliCommand for CreateObjectAndPublishPackage { self.move_options.dev, self.move_options.skip_fetch_latest_git_deps, self.move_options.named_addresses(), - self.move_options.override_std.clone(), self.move_options.bytecode_version, self.move_options.compiler_version, self.move_options.language_version, @@ -1012,7 +1000,6 @@ impl CliCommand for UpgradeObjectPackage { self.move_options.dev, self.move_options.skip_fetch_latest_git_deps, self.move_options.named_addresses(), - self.move_options.override_std.clone(), self.move_options.bytecode_version, self.move_options.compiler_version, self.move_options.language_version, @@ -1138,7 +1125,6 @@ impl CliCommand for CreateResourceAccountAndPublishPackage { move_options.dev, move_options.skip_fetch_latest_git_deps, move_options.named_addresses(), - move_options.override_std, move_options.bytecode_version, move_options.compiler_version, move_options.language_version, @@ -1291,7 +1277,6 @@ impl CliCommand<&'static str> for VerifyPackage { self.move_options.dev, self.move_options.skip_fetch_latest_git_deps, self.move_options.named_addresses(), - self.move_options.override_std.clone(), self.move_options.bytecode_version, self.move_options.compiler_version, self.move_options.language_version, diff --git a/crates/aptos/src/move_tool/show.rs b/crates/aptos/src/move_tool/show.rs index 1a910b322d70f0..bb763334dab608 100644 --- a/crates/aptos/src/move_tool/show.rs +++ b/crates/aptos/src/move_tool/show.rs @@ -63,7 +63,6 @@ impl CliCommand> for ShowAbi { self.move_options.dev, self.move_options.skip_fetch_latest_git_deps, self.move_options.named_addresses(), - self.move_options.override_std.clone(), self.move_options.bytecode_version, self.move_options.compiler_version, self.move_options.language_version, diff --git a/crates/aptos/src/test/mod.rs b/crates/aptos/src/test/mod.rs index e1ac8e8adea69a..b85f55ff7d8d09 100644 --- a/crates/aptos/src/test/mod.rs +++ b/crates/aptos/src/test/mod.rs @@ -1090,7 +1090,6 @@ impl CliTestFramework { package_dir: Some(self.move_dir()), output_dir: None, named_addresses: Self::named_addresses(account_strs), - override_std: None, skip_fetch_latest_git_deps: true, bytecode_version: None, compiler_version: None, diff --git a/third_party/move/tools/move-package/src/lib.rs b/third_party/move/tools/move-package/src/lib.rs index 263123c15c8eef..89ded94d5a966a 100644 --- a/third_party/move/tools/move-package/src/lib.rs +++ b/third_party/move/tools/move-package/src/lib.rs @@ -28,7 +28,7 @@ use move_model::{ model, }; use serde::{Deserialize, Serialize}; -use source_package::{layout::SourcePackageLayout, std_lib::StdVersion}; +use source_package::layout::SourcePackageLayout; use std::{ collections::{BTreeMap, BTreeSet}, fmt, @@ -109,10 +109,6 @@ pub struct BuildConfig { #[clap(name = "test-mode", long = "test", global = true)] pub test_mode: bool, - /// Whether to override the standard library with the given version. - #[clap(long = "override-std", global = true, value_parser)] - pub override_std: Option, - /// Generate documentation for packages #[clap(name = "generate-docs", long = "doc", global = true)] pub generate_docs: bool, diff --git a/third_party/move/tools/move-package/src/resolution/resolution_graph.rs b/third_party/move/tools/move-package/src/resolution/resolution_graph.rs index 45223e632edd6a..49b763e4e38951 100644 --- a/third_party/move/tools/move-package/src/resolution/resolution_graph.rs +++ b/third_party/move/tools/move-package/src/resolution/resolution_graph.rs @@ -12,7 +12,6 @@ use crate::{ Dependencies, Dependency, FileName, NamedAddress, PackageDigest, PackageName, SourceManifest, SubstOrRename, }, - std_lib::{StdLib, StdVersion}, }, BuildConfig, }; @@ -108,22 +107,14 @@ impl ResolvingGraph { } let mut resolution_graph = Self { root_package_path: root_package_path.clone(), - build_options: build_options.clone(), + build_options, root_package: root_package.clone(), graph: DiGraphMap::new(), package_table: BTreeMap::new(), }; - let override_std = &build_options.override_std; - resolution_graph - .build_resolution_graph( - root_package.clone(), - root_package_path, - true, - override_std, - writer, - ) + .build_resolution_graph(root_package.clone(), root_package_path, true, writer) .with_context(|| { format!( "Unable to resolve packages for package '{}'", @@ -208,7 +199,6 @@ impl ResolvingGraph { package: SourceManifest, package_path: PathBuf, is_root_package: bool, - override_std: &Option, writer: &mut W, ) -> Result<()> { let package_name = package.package.name; @@ -247,17 +237,12 @@ impl ResolvingGraph { BTreeMap::new() }; - for (dep_name, mut dep) in package + for (dep_name, dep) in package .dependencies .clone() .into_iter() .chain(additional_deps.into_iter()) { - if let Some(std_version) = &override_std { - if let Some(std_lib) = StdLib::from_package_name(dep_name) { - dep = std_lib.dependency(std_version); - } - } let dep_node_id = self.get_or_add_node(dep_name).with_context(|| { format!( "Cycle between packages {} and {} found", @@ -267,7 +252,7 @@ impl ResolvingGraph { self.graph.add_edge(package_node_id, dep_node_id, ()); let (dep_renaming, dep_resolution_table) = self - .process_dependency(dep_name, dep, package_path.clone(), override_std, writer) + .process_dependency(dep_name, dep, package_path.clone(), writer) .with_context(|| { format!( "While resolving dependency '{}' in package '{}'", @@ -408,7 +393,6 @@ impl ResolvingGraph { dep_name_in_pkg: PackageName, dep: Dependency, root_path: PathBuf, - override_std: &Option, writer: &mut W, ) -> Result<(Renaming, ResolvingTable)> { Self::download_and_update_if_remote( @@ -420,14 +404,10 @@ impl ResolvingGraph { let (dep_package, dep_package_dir) = Self::parse_package_manifest(&dep, &dep_name_in_pkg, root_path) .with_context(|| format!("While processing dependency '{}'", dep_name_in_pkg))?; - self.build_resolution_graph( - dep_package.clone(), - dep_package_dir, - false, - override_std, - writer, - ) - .with_context(|| format!("Unable to resolve package dependency '{}'", dep_name_in_pkg))?; + self.build_resolution_graph(dep_package.clone(), dep_package_dir, false, writer) + .with_context(|| { + format!("Unable to resolve package dependency '{}'", dep_name_in_pkg) + })?; if dep_name_in_pkg != dep_package.package.name { bail!("Name of dependency declared in package '{}' does not match dependency's package name '{}'", diff --git a/third_party/move/tools/move-package/src/source_package/manifest_parser.rs b/third_party/move/tools/move-package/src/source_package/manifest_parser.rs index 384724e6669444..9a6bb2322c8d7e 100644 --- a/third_party/move/tools/move-package/src/source_package/manifest_parser.rs +++ b/third_party/move/tools/move-package/src/source_package/manifest_parser.rs @@ -355,6 +355,7 @@ fn parse_dependency(dep_name: &str, tval: TV) -> Result { }) }, (None, Some(git), None) => { + let move_home = MOVE_HOME.clone(); let rev_name = match table.remove("rev") { None => bail!("Git revision not supplied for dependency"), Some(r) => Symbol::from( @@ -366,7 +367,11 @@ fn parse_dependency(dep_name: &str, tval: TV) -> Result { let git_url = git .as_str() .ok_or_else(|| anyhow::anyhow!("Git URL not a string"))?; - let local_path = git_repo_cache_path(git_url, rev_name.as_str()); + let local_path = PathBuf::from(move_home).join(format!( + "{}_{}", + url_to_file_name(git_url), + rev_name.replace('/', "__") + )); let subdir = PathBuf::from(match table.remove("subdir") { None => "".to_string(), Some(path) => path @@ -566,13 +571,3 @@ fn check_for_required_field_names( Ok(()) } - -/// Gets the local path to download the package from a git repo -pub fn git_repo_cache_path(git_url: &str, rev_name: &str) -> PathBuf { - let move_home = MOVE_HOME.clone(); - PathBuf::from(move_home).join(format!( - "{}_{}", - url_to_file_name(git_url), - rev_name.replace('/', "__") - )) -} diff --git a/third_party/move/tools/move-package/src/source_package/mod.rs b/third_party/move/tools/move-package/src/source_package/mod.rs index c3819ef1938f46..a3829eaea18c15 100644 --- a/third_party/move/tools/move-package/src/source_package/mod.rs +++ b/third_party/move/tools/move-package/src/source_package/mod.rs @@ -5,4 +5,3 @@ pub mod layout; pub mod manifest_parser; pub mod parsed_manifest; -pub mod std_lib; diff --git a/third_party/move/tools/move-package/src/source_package/std_lib.rs b/third_party/move/tools/move-package/src/source_package/std_lib.rs deleted file mode 100644 index 4dfd8c6f6f8a02..00000000000000 --- a/third_party/move/tools/move-package/src/source_package/std_lib.rs +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) Aptos Foundation -// SPDX-License-Identifier: Apache-2.0 - -use crate::{ - manifest_parser::git_repo_cache_path, - source_package::parsed_manifest::{Dependency, GitInfo}, -}; -use clap::ValueEnum; -use move_symbol_pool::symbol::Symbol; -use serde::{Deserialize, Serialize}; -use std::{fmt::Display, path::PathBuf}; - -/// Represents a standard library. -pub enum StdLib { - AptosFramework, - AptosStdlib, - MoveStdlib, -} - -impl StdLib { - /// The well-known git URL for the standard library. - const STD_GIT_URL: &'static str = "https://github.com/aptos-labs/aptos-core.git"; - - /// Returns the dependency for the standard library with the given version. - pub fn dependency(&self, version: &StdVersion) -> Dependency { - let local = git_repo_cache_path(Self::STD_GIT_URL, version.rev()); - Dependency { - local: local.join(self.sub_dir()), - subst: None, - version: None, - digest: None, - git_info: Some(GitInfo { - git_url: Symbol::from(StdLib::STD_GIT_URL), - git_rev: Symbol::from(version.rev()), - subdir: PathBuf::from(self.sub_dir()), - download_to: local, - }), - node_info: None, - } - } - - /// Returns the name of the standard library. - pub fn as_str(&self) -> &'static str { - match self { - StdLib::AptosFramework => "AptosFramework", - StdLib::AptosStdlib => "AptosStdlib", - StdLib::MoveStdlib => "MoveStdlib", - } - } - - /// Returns the standard library from the given package name, or `None` if the package name is not a standard library. - pub fn from_package_name(package_name: Symbol) -> Option { - match package_name.as_str() { - "AptosFramework" => Some(StdLib::AptosFramework), - "AptosStdlib" => Some(StdLib::AptosStdlib), - "MoveStdlib" => Some(StdLib::MoveStdlib), - _ => None, - } - } - - /// Returns the subdirectory of the standard library in the git repository. - fn sub_dir(&self) -> &'static str { - match self { - StdLib::AptosFramework => "aptos-move/framework/aptos-framework", - StdLib::AptosStdlib => "aptos-move/framework/aptos-stdlib", - StdLib::MoveStdlib => "aptos-move/framework/move-stdlib", - } - } -} - -/// Represents a standard library version. -#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq, PartialOrd, ValueEnum)] -#[clap(rename_all = "lower")] -pub enum StdVersion { - Mainnet, - Testnet, - Devnet, -} - -impl StdVersion { - const DEVNET: &'static str = "devnet"; - const MAINNET: &'static str = "mainnet"; - const TESTNET: &'static str = "testnet"; - - /// Returns the rev name of the standard library version. - pub fn rev(&self) -> &'static str { - match self { - StdVersion::Mainnet => StdVersion::MAINNET, - StdVersion::Testnet => StdVersion::TESTNET, - StdVersion::Devnet => StdVersion::DEVNET, - } - } - - /// Returns the standard library version from the given rev name, or `None` if the string is not a standard library version. - pub fn from_rev(version: &str) -> Option { - match version { - StdVersion::MAINNET => Some(Self::Mainnet), - StdVersion::TESTNET => Some(Self::Testnet), - StdVersion::DEVNET => Some(Self::Devnet), - _ => None, - } - } -} - -impl Display for StdVersion { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{}", self.rev()) - } -} diff --git a/third_party/move/tools/move-package/tests/test_runner.rs b/third_party/move/tools/move-package/tests/test_runner.rs index 43f831e63838db..486959f756b71a 100644 --- a/third_party/move/tools/move-package/tests/test_runner.rs +++ b/third_party/move/tools/move-package/tests/test_runner.rs @@ -10,12 +10,12 @@ use move_compiler::shared::known_attributes::KnownAttribute; use move_model::metadata::{CompilerVersion, LanguageVersion}; use move_package::{ compilation::{build_plan::BuildPlan, model_builder::ModelBuilder}, - package_hooks::{self, PackageHooks}, + package_hooks, + package_hooks::PackageHooks, resolution::resolution_graph as RG, source_package::{ manifest_parser as MP, parsed_manifest::{CustomDepInfo, PackageDigest}, - std_lib::StdVersion, }, BuildConfig, CompilerConfig, ModelConfig, }; @@ -29,7 +29,6 @@ use tempfile::tempdir; const COMPILE_EXT: &str = "compile"; const MODEL_EXT: &str = "model"; -const OVERRIDE_EXT: &str = "override"; fn run_test_impl( path: &Path, @@ -40,15 +39,6 @@ fn run_test_impl( ..Default::default() }; compiler_config.compiler_version = Some(compiler_version); - let override_path = path.with_extension(OVERRIDE_EXT); - let override_std = if override_path.is_file() { - Some( - StdVersion::from_rev(&fs::read_to_string(override_path)?) - .expect("one of mainnet/testnet/devnet"), - ) - } else { - None - }; let should_compile = path.with_extension(COMPILE_EXT).is_file(); let should_model = path.with_extension(MODEL_EXT).is_file(); let contents = fs::read_to_string(path)?; @@ -61,7 +51,6 @@ fn run_test_impl( BuildConfig { dev_mode: true, test_mode: false, - override_std, generate_docs: false, generate_abis: false, install_dir: Some(tempdir().unwrap().path().to_path_buf()), diff --git a/third_party/move/tools/move-package/tests/test_sources/compilation/basic_no_deps/Move.exp b/third_party/move/tools/move-package/tests/test_sources/compilation/basic_no_deps/Move.exp index 501dd2071410ff..c7db84b07c6425 100644 --- a/third_party/move/tools/move-package/tests/test_sources/compilation/basic_no_deps/Move.exp +++ b/third_party/move/tools/move-package/tests/test_sources/compilation/basic_no_deps/Move.exp @@ -7,7 +7,6 @@ CompiledPackageInfo { build_flags: BuildConfig { dev_mode: true, test_mode: false, - override_std: None, generate_docs: false, generate_abis: false, generate_move_model: false, diff --git a/third_party/move/tools/move-package/tests/test_sources/compilation/basic_no_deps_address_assigned/Move.exp b/third_party/move/tools/move-package/tests/test_sources/compilation/basic_no_deps_address_assigned/Move.exp index a25228bfd0cb3e..7719a13c2b504e 100644 --- a/third_party/move/tools/move-package/tests/test_sources/compilation/basic_no_deps_address_assigned/Move.exp +++ b/third_party/move/tools/move-package/tests/test_sources/compilation/basic_no_deps_address_assigned/Move.exp @@ -9,7 +9,6 @@ CompiledPackageInfo { build_flags: BuildConfig { dev_mode: true, test_mode: false, - override_std: None, generate_docs: false, generate_abis: false, generate_move_model: false, diff --git a/third_party/move/tools/move-package/tests/test_sources/compilation/basic_no_deps_address_not_assigned_with_dev_assignment/Move.exp b/third_party/move/tools/move-package/tests/test_sources/compilation/basic_no_deps_address_not_assigned_with_dev_assignment/Move.exp index 1b4846e5d0b192..de543cb5e59955 100644 --- a/third_party/move/tools/move-package/tests/test_sources/compilation/basic_no_deps_address_not_assigned_with_dev_assignment/Move.exp +++ b/third_party/move/tools/move-package/tests/test_sources/compilation/basic_no_deps_address_not_assigned_with_dev_assignment/Move.exp @@ -9,7 +9,6 @@ CompiledPackageInfo { build_flags: BuildConfig { dev_mode: true, test_mode: false, - override_std: None, generate_docs: false, generate_abis: false, generate_move_model: false, diff --git a/third_party/move/tools/move-package/tests/test_sources/compilation/basic_no_deps_test_mode/Move.exp b/third_party/move/tools/move-package/tests/test_sources/compilation/basic_no_deps_test_mode/Move.exp index 3c3d15e1b41d60..ead9bb2d6164d5 100644 --- a/third_party/move/tools/move-package/tests/test_sources/compilation/basic_no_deps_test_mode/Move.exp +++ b/third_party/move/tools/move-package/tests/test_sources/compilation/basic_no_deps_test_mode/Move.exp @@ -9,7 +9,6 @@ CompiledPackageInfo { build_flags: BuildConfig { dev_mode: true, test_mode: false, - override_std: None, generate_docs: false, generate_abis: false, generate_move_model: false, diff --git a/third_party/move/tools/move-package/tests/test_sources/compilation/diamond_problem_backflow_resolution/Move.exp b/third_party/move/tools/move-package/tests/test_sources/compilation/diamond_problem_backflow_resolution/Move.exp index 52bc9bddb60b92..14caf20ea4a78c 100644 --- a/third_party/move/tools/move-package/tests/test_sources/compilation/diamond_problem_backflow_resolution/Move.exp +++ b/third_party/move/tools/move-package/tests/test_sources/compilation/diamond_problem_backflow_resolution/Move.exp @@ -10,7 +10,6 @@ CompiledPackageInfo { build_flags: BuildConfig { dev_mode: true, test_mode: false, - override_std: None, generate_docs: false, generate_abis: false, generate_move_model: false, diff --git a/third_party/move/tools/move-package/tests/test_sources/compilation/diamond_problem_no_conflict/Move.exp b/third_party/move/tools/move-package/tests/test_sources/compilation/diamond_problem_no_conflict/Move.exp index 52bc9bddb60b92..14caf20ea4a78c 100644 --- a/third_party/move/tools/move-package/tests/test_sources/compilation/diamond_problem_no_conflict/Move.exp +++ b/third_party/move/tools/move-package/tests/test_sources/compilation/diamond_problem_no_conflict/Move.exp @@ -10,7 +10,6 @@ CompiledPackageInfo { build_flags: BuildConfig { dev_mode: true, test_mode: false, - override_std: None, generate_docs: false, generate_abis: false, generate_move_model: false, diff --git a/third_party/move/tools/move-package/tests/test_sources/compilation/multiple_deps_rename/Move.exp b/third_party/move/tools/move-package/tests/test_sources/compilation/multiple_deps_rename/Move.exp index ba5ef893226d3e..08b31aacb2e40f 100644 --- a/third_party/move/tools/move-package/tests/test_sources/compilation/multiple_deps_rename/Move.exp +++ b/third_party/move/tools/move-package/tests/test_sources/compilation/multiple_deps_rename/Move.exp @@ -11,7 +11,6 @@ CompiledPackageInfo { build_flags: BuildConfig { dev_mode: true, test_mode: false, - override_std: None, generate_docs: false, generate_abis: false, generate_move_model: false, diff --git a/third_party/move/tools/move-package/tests/test_sources/compilation/multiple_deps_rename_one/Move.exp b/third_party/move/tools/move-package/tests/test_sources/compilation/multiple_deps_rename_one/Move.exp index 171021215b190e..4951314aa0ea8b 100644 --- a/third_party/move/tools/move-package/tests/test_sources/compilation/multiple_deps_rename_one/Move.exp +++ b/third_party/move/tools/move-package/tests/test_sources/compilation/multiple_deps_rename_one/Move.exp @@ -11,7 +11,6 @@ CompiledPackageInfo { build_flags: BuildConfig { dev_mode: true, test_mode: false, - override_std: None, generate_docs: false, generate_abis: false, generate_move_model: false, diff --git a/third_party/move/tools/move-package/tests/test_sources/compilation/one_dep/Move.exp b/third_party/move/tools/move-package/tests/test_sources/compilation/one_dep/Move.exp index 992a1e15a01fb3..6197567116d6a3 100644 --- a/third_party/move/tools/move-package/tests/test_sources/compilation/one_dep/Move.exp +++ b/third_party/move/tools/move-package/tests/test_sources/compilation/one_dep/Move.exp @@ -9,7 +9,6 @@ CompiledPackageInfo { build_flags: BuildConfig { dev_mode: true, test_mode: false, - override_std: None, generate_docs: false, generate_abis: false, generate_move_model: false, diff --git a/third_party/move/tools/move-package/tests/test_sources/compilation/one_dep_assigned_address/Move.exp b/third_party/move/tools/move-package/tests/test_sources/compilation/one_dep_assigned_address/Move.exp index 53324c0029187e..b739c18644d23d 100644 --- a/third_party/move/tools/move-package/tests/test_sources/compilation/one_dep_assigned_address/Move.exp +++ b/third_party/move/tools/move-package/tests/test_sources/compilation/one_dep_assigned_address/Move.exp @@ -9,7 +9,6 @@ CompiledPackageInfo { build_flags: BuildConfig { dev_mode: true, test_mode: false, - override_std: None, generate_docs: false, generate_abis: false, generate_move_model: false, diff --git a/third_party/move/tools/move-package/tests/test_sources/compilation/one_dep_renamed/Move.exp b/third_party/move/tools/move-package/tests/test_sources/compilation/one_dep_renamed/Move.exp index 992a1e15a01fb3..6197567116d6a3 100644 --- a/third_party/move/tools/move-package/tests/test_sources/compilation/one_dep_renamed/Move.exp +++ b/third_party/move/tools/move-package/tests/test_sources/compilation/one_dep_renamed/Move.exp @@ -9,7 +9,6 @@ CompiledPackageInfo { build_flags: BuildConfig { dev_mode: true, test_mode: false, - override_std: None, generate_docs: false, generate_abis: false, generate_move_model: false, diff --git a/third_party/move/tools/move-package/tests/test_sources/compilation/one_dep_with_scripts/Move.exp b/third_party/move/tools/move-package/tests/test_sources/compilation/one_dep_with_scripts/Move.exp index 992a1e15a01fb3..6197567116d6a3 100644 --- a/third_party/move/tools/move-package/tests/test_sources/compilation/one_dep_with_scripts/Move.exp +++ b/third_party/move/tools/move-package/tests/test_sources/compilation/one_dep_with_scripts/Move.exp @@ -9,7 +9,6 @@ CompiledPackageInfo { build_flags: BuildConfig { dev_mode: true, test_mode: false, - override_std: None, generate_docs: false, generate_abis: false, generate_move_model: false, diff --git a/third_party/move/tools/move-package/tests/test_sources/compilation/std-lib-override/Move.compile b/third_party/move/tools/move-package/tests/test_sources/compilation/std-lib-override/Move.compile deleted file mode 100644 index e69de29bb2d1d6..00000000000000 diff --git a/third_party/move/tools/move-package/tests/test_sources/compilation/std-lib-override/Move.exp b/third_party/move/tools/move-package/tests/test_sources/compilation/std-lib-override/Move.exp deleted file mode 100644 index 162057ccc613ff..00000000000000 --- a/third_party/move/tools/move-package/tests/test_sources/compilation/std-lib-override/Move.exp +++ /dev/null @@ -1,55 +0,0 @@ -CompiledPackageInfo { - package_name: "std-lib-conflicts", - address_alias_instantiation: { - "A": 0000000000000000000000000000000000000000000000000000000000000042, - "B": 0000000000000000000000000000000000000000000000000000000000000043, - "Extensions": 0000000000000000000000000000000000000000000000000000000000000001, - "aptos_framework": 0000000000000000000000000000000000000000000000000000000000000001, - "aptos_fungible_asset": 000000000000000000000000000000000000000000000000000000000000000a, - "aptos_std": 0000000000000000000000000000000000000000000000000000000000000001, - "aptos_token": 0000000000000000000000000000000000000000000000000000000000000003, - "core_resources": 000000000000000000000000000000000000000000000000000000000a550c18, - "std": 0000000000000000000000000000000000000000000000000000000000000001, - "vm": 0000000000000000000000000000000000000000000000000000000000000000, - "vm_reserved": 0000000000000000000000000000000000000000000000000000000000000000, - }, - source_digest: Some( - "ELIDED_FOR_TEST", - ), - build_flags: BuildConfig { - dev_mode: true, - test_mode: false, - override_std: Some( - Devnet, - ), - generate_docs: false, - generate_abis: false, - generate_move_model: false, - full_model_generation: false, - install_dir: Some( - "ELIDED_FOR_TEST", - ), - force_recompilation: false, - additional_named_addresses: {}, - architecture: None, - fetch_deps_only: false, - skip_fetch_latest_git_deps: false, - compiler_config: CompilerConfig { - bytecode_version: None, - known_attributes: { - "bytecode_instruction", - "deprecated", - "expected_failure", - "native_interface", - "test", - "test_only", - "verify_only", - }, - skip_attribute_checks: false, - compiler_version: Some( - V1, - ), - language_version: None, - }, - }, -} diff --git a/third_party/move/tools/move-package/tests/test_sources/compilation/std-lib-override/Move.override b/third_party/move/tools/move-package/tests/test_sources/compilation/std-lib-override/Move.override deleted file mode 100644 index ff693d99966be2..00000000000000 --- a/third_party/move/tools/move-package/tests/test_sources/compilation/std-lib-override/Move.override +++ /dev/null @@ -1 +0,0 @@ -devnet \ No newline at end of file diff --git a/third_party/move/tools/move-package/tests/test_sources/compilation/std-lib-override/deps_only/Move.toml b/third_party/move/tools/move-package/tests/test_sources/compilation/std-lib-override/deps_only/Move.toml deleted file mode 100644 index c056666dea12d5..00000000000000 --- a/third_party/move/tools/move-package/tests/test_sources/compilation/std-lib-override/deps_only/Move.toml +++ /dev/null @@ -1,16 +0,0 @@ -[package] -name = "B" -version = "1.0.0" -authors = [] - -[addresses] -B = "0x43" - -[dev-addresses] - -[dependencies.AptosFramework] -git = "https://github.com/aptos-labs/aptos-core.git" -rev = "mainnet" -subdir = "aptos-move/framework/aptos-framework" - -[dev-dependencies] diff --git a/third_party/move/tools/move-package/tests/test_sources/compilation/std-lib-override/deps_only/sources/B.move b/third_party/move/tools/move-package/tests/test_sources/compilation/std-lib-override/deps_only/sources/B.move deleted file mode 100644 index 6167a02cb4ac2c..00000000000000 --- a/third_party/move/tools/move-package/tests/test_sources/compilation/std-lib-override/deps_only/sources/B.move +++ /dev/null @@ -1,3 +0,0 @@ -module B::B { - public fun foo() {} -} diff --git a/third_party/move/tools/move-package/tests/test_sources/compilation/std-lib-override/sources/A.move b/third_party/move/tools/move-package/tests/test_sources/compilation/std-lib-override/sources/A.move deleted file mode 100644 index 52551bda99f850..00000000000000 --- a/third_party/move/tools/move-package/tests/test_sources/compilation/std-lib-override/sources/A.move +++ /dev/null @@ -1,6 +0,0 @@ -module A::A { - use B::B; - public fun foo() { - B::foo(); - } -} diff --git a/third_party/move/tools/move-package/tests/test_sources/compilation/test_symlinks/Move.exp b/third_party/move/tools/move-package/tests/test_sources/compilation/test_symlinks/Move.exp index a25228bfd0cb3e..7719a13c2b504e 100644 --- a/third_party/move/tools/move-package/tests/test_sources/compilation/test_symlinks/Move.exp +++ b/third_party/move/tools/move-package/tests/test_sources/compilation/test_symlinks/Move.exp @@ -9,7 +9,6 @@ CompiledPackageInfo { build_flags: BuildConfig { dev_mode: true, test_mode: false, - override_std: None, generate_docs: false, generate_abis: false, generate_move_model: false, diff --git a/third_party/move/tools/move-package/tests/test_sources/parsing/invalid_identifier_package_name/Move.exp b/third_party/move/tools/move-package/tests/test_sources/parsing/invalid_identifier_package_name/Move.exp index c87bbd940d46a2..7e24cce41b5873 100644 --- a/third_party/move/tools/move-package/tests/test_sources/parsing/invalid_identifier_package_name/Move.exp +++ b/third_party/move/tools/move-package/tests/test_sources/parsing/invalid_identifier_package_name/Move.exp @@ -3,7 +3,6 @@ ResolutionGraph { build_options: BuildConfig { dev_mode: true, test_mode: false, - override_std: None, generate_docs: false, generate_abis: false, generate_move_model: false, diff --git a/third_party/move/tools/move-package/tests/test_sources/parsing/minimal_manifest/Move.exp b/third_party/move/tools/move-package/tests/test_sources/parsing/minimal_manifest/Move.exp index 2694e4a88dc36f..d9a9a2eb113441 100644 --- a/third_party/move/tools/move-package/tests/test_sources/parsing/minimal_manifest/Move.exp +++ b/third_party/move/tools/move-package/tests/test_sources/parsing/minimal_manifest/Move.exp @@ -3,7 +3,6 @@ ResolutionGraph { build_options: BuildConfig { dev_mode: true, test_mode: false, - override_std: None, generate_docs: false, generate_abis: false, generate_move_model: false, diff --git a/third_party/move/tools/move-package/tests/test_sources/resolution/basic_no_deps/Move.exp b/third_party/move/tools/move-package/tests/test_sources/resolution/basic_no_deps/Move.exp index f9a75f042a00cc..c7a32db3709329 100644 --- a/third_party/move/tools/move-package/tests/test_sources/resolution/basic_no_deps/Move.exp +++ b/third_party/move/tools/move-package/tests/test_sources/resolution/basic_no_deps/Move.exp @@ -3,7 +3,6 @@ ResolutionGraph { build_options: BuildConfig { dev_mode: true, test_mode: false, - override_std: None, generate_docs: false, generate_abis: false, generate_move_model: false, diff --git a/third_party/move/tools/move-package/tests/test_sources/resolution/basic_no_deps_address_assigned/Move.exp b/third_party/move/tools/move-package/tests/test_sources/resolution/basic_no_deps_address_assigned/Move.exp index aa4691c3f5ff8f..f2173a630b7aeb 100644 --- a/third_party/move/tools/move-package/tests/test_sources/resolution/basic_no_deps_address_assigned/Move.exp +++ b/third_party/move/tools/move-package/tests/test_sources/resolution/basic_no_deps_address_assigned/Move.exp @@ -3,7 +3,6 @@ ResolutionGraph { build_options: BuildConfig { dev_mode: true, test_mode: false, - override_std: None, generate_docs: false, generate_abis: false, generate_move_model: false, diff --git a/third_party/move/tools/move-package/tests/test_sources/resolution/basic_no_deps_address_not_assigned_with_dev_assignment/Move.exp b/third_party/move/tools/move-package/tests/test_sources/resolution/basic_no_deps_address_not_assigned_with_dev_assignment/Move.exp index 1c0fcac0cd0400..8323aebec23be2 100644 --- a/third_party/move/tools/move-package/tests/test_sources/resolution/basic_no_deps_address_not_assigned_with_dev_assignment/Move.exp +++ b/third_party/move/tools/move-package/tests/test_sources/resolution/basic_no_deps_address_not_assigned_with_dev_assignment/Move.exp @@ -3,7 +3,6 @@ ResolutionGraph { build_options: BuildConfig { dev_mode: true, test_mode: false, - override_std: None, generate_docs: false, generate_abis: false, generate_move_model: false, diff --git a/third_party/move/tools/move-package/tests/test_sources/resolution/dep_good_digest/Move.exp b/third_party/move/tools/move-package/tests/test_sources/resolution/dep_good_digest/Move.exp index f2ee2ddcbbc2a4..14d3339915f563 100644 --- a/third_party/move/tools/move-package/tests/test_sources/resolution/dep_good_digest/Move.exp +++ b/third_party/move/tools/move-package/tests/test_sources/resolution/dep_good_digest/Move.exp @@ -3,7 +3,6 @@ ResolutionGraph { build_options: BuildConfig { dev_mode: true, test_mode: false, - override_std: None, generate_docs: false, generate_abis: false, generate_move_model: false, diff --git a/third_party/move/tools/move-package/tests/test_sources/resolution/diamond_problem_backflow_resolution/Move.exp b/third_party/move/tools/move-package/tests/test_sources/resolution/diamond_problem_backflow_resolution/Move.exp index 1c044fe40dbdab..daeee0be6a2b41 100644 --- a/third_party/move/tools/move-package/tests/test_sources/resolution/diamond_problem_backflow_resolution/Move.exp +++ b/third_party/move/tools/move-package/tests/test_sources/resolution/diamond_problem_backflow_resolution/Move.exp @@ -3,7 +3,6 @@ ResolutionGraph { build_options: BuildConfig { dev_mode: true, test_mode: false, - override_std: None, generate_docs: false, generate_abis: false, generate_move_model: false, diff --git a/third_party/move/tools/move-package/tests/test_sources/resolution/diamond_problem_no_conflict/Move.exp b/third_party/move/tools/move-package/tests/test_sources/resolution/diamond_problem_no_conflict/Move.exp index f384d6feadde82..7a12b7249fe8eb 100644 --- a/third_party/move/tools/move-package/tests/test_sources/resolution/diamond_problem_no_conflict/Move.exp +++ b/third_party/move/tools/move-package/tests/test_sources/resolution/diamond_problem_no_conflict/Move.exp @@ -3,7 +3,6 @@ ResolutionGraph { build_options: BuildConfig { dev_mode: true, test_mode: false, - override_std: None, generate_docs: false, generate_abis: false, generate_move_model: false, diff --git a/third_party/move/tools/move-package/tests/test_sources/resolution/multiple_deps_rename/Move.exp b/third_party/move/tools/move-package/tests/test_sources/resolution/multiple_deps_rename/Move.exp index fdf01a960606a1..930b16d46aef9e 100644 --- a/third_party/move/tools/move-package/tests/test_sources/resolution/multiple_deps_rename/Move.exp +++ b/third_party/move/tools/move-package/tests/test_sources/resolution/multiple_deps_rename/Move.exp @@ -3,7 +3,6 @@ ResolutionGraph { build_options: BuildConfig { dev_mode: true, test_mode: false, - override_std: None, generate_docs: false, generate_abis: false, generate_move_model: false, diff --git a/third_party/move/tools/move-package/tests/test_sources/resolution/one_dep/Move.exp b/third_party/move/tools/move-package/tests/test_sources/resolution/one_dep/Move.exp index 41e627061a229b..d27f5a7a508ae5 100644 --- a/third_party/move/tools/move-package/tests/test_sources/resolution/one_dep/Move.exp +++ b/third_party/move/tools/move-package/tests/test_sources/resolution/one_dep/Move.exp @@ -3,7 +3,6 @@ ResolutionGraph { build_options: BuildConfig { dev_mode: true, test_mode: false, - override_std: None, generate_docs: false, generate_abis: false, generate_move_model: false, diff --git a/third_party/move/tools/move-package/tests/test_sources/resolution/one_dep_assigned_address/Move.exp b/third_party/move/tools/move-package/tests/test_sources/resolution/one_dep_assigned_address/Move.exp index 49f4cfe1df1634..3d7ded2cd6d62f 100644 --- a/third_party/move/tools/move-package/tests/test_sources/resolution/one_dep_assigned_address/Move.exp +++ b/third_party/move/tools/move-package/tests/test_sources/resolution/one_dep_assigned_address/Move.exp @@ -3,7 +3,6 @@ ResolutionGraph { build_options: BuildConfig { dev_mode: true, test_mode: false, - override_std: None, generate_docs: false, generate_abis: false, generate_move_model: false, diff --git a/third_party/move/tools/move-package/tests/test_sources/resolution/one_dep_multiple_of_same_name/Move.exp b/third_party/move/tools/move-package/tests/test_sources/resolution/one_dep_multiple_of_same_name/Move.exp index cf16366be8c253..75a513d49cea01 100644 --- a/third_party/move/tools/move-package/tests/test_sources/resolution/one_dep_multiple_of_same_name/Move.exp +++ b/third_party/move/tools/move-package/tests/test_sources/resolution/one_dep_multiple_of_same_name/Move.exp @@ -3,7 +3,6 @@ ResolutionGraph { build_options: BuildConfig { dev_mode: true, test_mode: false, - override_std: None, generate_docs: false, generate_abis: false, generate_move_model: false, diff --git a/third_party/move/tools/move-package/tests/test_sources/resolution/one_dep_reassigned_address/Move.exp b/third_party/move/tools/move-package/tests/test_sources/resolution/one_dep_reassigned_address/Move.exp index eebb6dbbcfe768..a35b649a978374 100644 --- a/third_party/move/tools/move-package/tests/test_sources/resolution/one_dep_reassigned_address/Move.exp +++ b/third_party/move/tools/move-package/tests/test_sources/resolution/one_dep_reassigned_address/Move.exp @@ -3,7 +3,6 @@ ResolutionGraph { build_options: BuildConfig { dev_mode: true, test_mode: false, - override_std: None, generate_docs: false, generate_abis: false, generate_move_model: false, diff --git a/third_party/move/tools/move-package/tests/test_sources/resolution/one_dep_unification_across_local_renamings/Move.exp b/third_party/move/tools/move-package/tests/test_sources/resolution/one_dep_unification_across_local_renamings/Move.exp index 879427f0818022..29f0a821f714c1 100644 --- a/third_party/move/tools/move-package/tests/test_sources/resolution/one_dep_unification_across_local_renamings/Move.exp +++ b/third_party/move/tools/move-package/tests/test_sources/resolution/one_dep_unification_across_local_renamings/Move.exp @@ -3,7 +3,6 @@ ResolutionGraph { build_options: BuildConfig { dev_mode: true, test_mode: false, - override_std: None, generate_docs: false, generate_abis: false, generate_move_model: false,