AcalaNetwork / Acala

Acala - cross-chain DeFi hub and stablecoin based on Substrate for Polkadot and Kusama.
https://acala.network
GNU General Public License v3.0
741 stars 456 forks source link

Building with CARGO_TARGET_DIR doesn't work #2760

Closed Juanito87 closed 3 months ago

Juanito87 commented 3 months ago

Describe the bug

If CARGO_TARGET_DIR variable is defined, build process fails

Expected Behavior

The build process should work with the vairable defined.

Current Behavior

It fails with the following error:

   Compiling coins-bip39 v0.7.0
error: failed to run custom build command for `acala-cli v2.24.0 (/home/juanito/repo/triton/Acala/node/cli)`

Caused by:
  process didn't exit successfully: `/home/juanito/repo/triton/Acala/test/debug/build/acala-cli-3489a94c48bb58da/build-script-build` (exit status: 101)
  --- stdout
  cargo:rustc-env=SUBSTRATE_CLI_COMMIT_HASH=89ef1e5b216
  cargo:rustc-env=SUBSTRATE_CLI_IMPL_VERSION=2.24.0-89ef1e5b216

  --- stderr
  thread 'main' panicked at /home/juanito/repo/triton/Acala/orml/build-script-utils/src/license.rs:43:13:
  The license in "../../test/debug/build/reed-solomon-novelpoly-c3e7686f9688934d/out/table_f2e16.rs" is either missing or it doesn't match the expected string!
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
make: *** [Makefile:38: build-full] Error 101

Steps to Reproduce

  1. export CARGO_TARGET_DIR=something
  2. make init
  3. make build-full

Additional context

zjb0807 commented 3 months ago

I tried the CARGO_TARGET_DIR and it worked for me.

The license in "../../test/debug/build/reed-solomon-novelpoly-c3e7686f9688934d/out/table_f2e16.rs" is either missing or it doesn't match the expected string! we check the license in the source files. Not sure why it checks for files outside the project, I haven't reproduced it, but you can delete the check in the code https://github.com/AcalaNetwork/Acala/blob/332b9c6a27ddfdb258af7d75d4fa7f54ed6bd7ce/node/cli/build.rs#L21-L33

zjb0807 commented 3 months ago

I see. You should change the CARGO_TARGET_DIR=test to CARGO_TARGET_DIR=.test This will avoid checking the license