Acala icon indicating copy to clipboard operation
Acala copied to clipboard

Building with CARGO_TARGET_DIR doesn't work

Open Juanito87 opened this issue 2 years ago • 2 comments

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

  • Node version: 20.5.1
  • OS: Pop 22.04
  • Command line options:
  • Relevant transaction hash:
  • Relevant account address:
  • Logs. Please format it as code blocks

Juanito87 avatar May 13 '24 14:05 Juanito87

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 avatar May 13 '24 23:05 zjb0807

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

zjb0807 avatar May 14 '24 00:05 zjb0807