Skip to content

A inifinit increasing size .tar.gz file created during smart contract compiling #11

@ZUOYANGDING

Description

@ZUOYANGDING

Problem Description

Building smart contract with docker mode, pchain-compile will create a temporary .tar.gz file to collect

  1. files inside smart contract source code directory
  2. manifests (dependencies)

and compress them, then copy them into docker container. It is possible, that pchain-compile the temporary .tar.gz become a infinite size growthing file until eats up all hard disc memory.

Problem analyzing

Source code files and manifest files are collected GZencoded, and copied by BFS on directory given by flag "--source". If run pchain-compile inside the smart-contract's source code directory, since final .tar.gz file will kept increasing during the whole compress file creation process,and itself is also file will be counted into the process, the whole prosess will not be stop forever.

Fix

  1. Good thing is the library "tar.rs" which we plugin to create the .tar.gz provide the Too many levels of symbolic links check inside. Therefore, we do not need to take care case, that circulation dependency in manifest or infinite loop caused symbolic links.
  2. Change the location where the temp file .tar.gz created, to avoid creating a infinite increasing file when user run pchian-compile insde the smart-contract's source code directory.
  3. "target" directory should not be collected, since it might make the .tar.gz become very large

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions