Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails on Windows #226

Closed
sunce86 opened this issue May 24, 2022 · 5 comments
Closed

Build fails on Windows #226

sunce86 opened this issue May 24, 2022 · 5 comments

Comments

@sunce86
Copy link
Contributor

sunce86 commented May 24, 2022

Currently, build fails on Windows OS. Some of the smart contract json files fail to parse with the following error:

error: failed to run custom build command for contracts v0.1.0 (C:\Users\lenas\work\backend\main\crates\contracts)

Caused by:
process didn't exit successfully: C:\Users\lenas\work\backend\main\target\debug\build\contracts-edc0b80862fececf\build-script-build (exit code: 101)
--- stdout
cargo:rerun-if-changed=build.rs
cargo:rerun-if-changed=C:\Users\lenas\work\backend\main\crates\contracts\artifacts\BalancerV2Authorizer.json
cargo:rerun-if-changed=C:\Users\lenas\work\backend\main\crates\contracts\artifacts\BalancerV2BasePool.json
cargo:rerun-if-changed=C:\Users\lenas\work\backend\main\crates\contracts\artifacts\BalancerV2BasePoolFactory.json
cargo:rerun-if-changed=C:\Users\lenas\work\backend\main\crates\contracts\artifacts\BalancerV2Vault.json
cargo:rerun-if-changed=C:\Users\lenas\work\backend\main\crates\contracts\artifacts\BalancerV2WeightedPoolFactory.json
cargo:rerun-if-changed=C:\Users\lenas\work\backend\main\crates\contracts\artifacts\BalancerV2WeightedPool2TokensFactory.json
cargo:rerun-if-changed=C:\Users\lenas\work\backend\main\crates\contracts\artifacts\BalancerV2StablePoolFactory.json
cargo:rerun-if-changed=C:\Users\lenas\work\backend\main\crates\contracts\artifacts\BalancerV2LiquidityBootstrappingPoolFactory.json

--- stderr
error[internal]: left behind trailing whitespace
--> :1684:1684:16
|
1684 | pub
| ^
|

warning: rustfmt has failed to format. See previous 1 errors.

thread 'main' panicked at 'called Result::unwrap() on an Err value: Json(Error("expected value", line: 1, column: 1))', crates\contracts\build.rs:296:10

@sunce86
Copy link
Contributor Author

sunce86 commented May 24, 2022

Workaround for now is to manually fix the smart contract files. For example, file https://github.com/cowprotocol/services/blob/d68f45720c50c775057b899cc6ae973328ad8220/crates/contracts/artifacts/BalancerV2NoProtocolFeeLiquidityBootstrappingPoolFactory.json

from BalancerV2LiquidityBootstrappingPoolFactory.json
to {"key":"BalancerV2LiquidityBootstrappingPoolFactory.json"}

This needs to be done for all files containing only name of the json file. Currently, those are:

crates/contracts/artifacts/BalancerV2NoProtocolFeeLiquidityBootstrappingPoolFactory.json
crates/contracts/artifacts/BaoswapFactory.json
crates/contracts/artifacts/BaoswapRouter.json
crates/contracts/artifacts/HoneyswapFactory.json
crates/contracts/artifacts/HoneyswapRouter.json
crates/contracts/artifacts/SushiSwapFactory.json
crates/contracts/artifacts/SushiSwapRouter.json
crates/contracts/artifacts/SwaprFactory.json
crates/contracts/artifacts/SwaprRouter.json

@nlordell
Copy link
Contributor

Ah! Its a symbolic link issue.

Maybe there is a Git setting to do this automatically?

@nlordell
Copy link
Contributor

Quick googling suggests that symbolic links in Git aren't portable, so maybe we should stop using them.

@sunce86
Copy link
Contributor Author

sunce86 commented May 24, 2022

When resolved. this PR should be reverted: #228

Copy link

This issue has been marked as stale because it has been inactive a while. Please update this issue or it will be automatically closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants