Skip to content

Commit d181135

Browse files
authored
add documentation for --override-std (#853)
1 parent 1c5c553 commit d181135

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

apps/nextra/pages/en/build/smart-contracts/book/packages.mdx

+25
Original file line numberDiff line numberDiff line change
@@ -409,3 +409,28 @@ Foo = { local = "../C" }
409409
```
410410

411411
Note that if both the bytecode and the source code of the same package exist in the search paths, the compiler will complain that the declaration is duplicated.
412+
413+
## Overriding the Standard Libraries
414+
When working with third-party packages, you might encounter issues where different versions of the Move and Aptos standard library packages are referenced.
415+
416+
This can lead to package resolution failures.
417+
418+
```
419+
"Error": "Move compilation failed:
420+
Unable to resolve packages for package 'C':
421+
While resolving dependency 'B' in package 'C':
422+
Unable to resolve package dependency 'B':
423+
While resolving dependency 'AptosFramework' in package 'B':
424+
Unable to resolve package dependency 'AptosFramework':
425+
Conflicting dependencies found: package 'AptosFramework' conflicts with 'AptosFramework'
426+
```
427+
To resolve this, you can override the standard library packages using a command-line option. This allows you to enforce a specific version of the standard libraries across your entire dependency tree.
428+
429+
You can apply the override to commands like `aptos move compile`, `aptos move run`, and others. Here is the syntax:
430+
```
431+
--override-std <network name>
432+
```
433+
Where `network_name` can be one of the following:
434+
- devnet
435+
- testnet
436+
- mainnet

0 commit comments

Comments
 (0)