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

Cannot build the contracts on macOS #1

Open
simonerom opened this issue Aug 2, 2021 · 3 comments
Open

Cannot build the contracts on macOS #1

simonerom opened this issue Aug 2, 2021 · 3 comments

Comments

@simonerom
Copy link
Member

simonerom commented Aug 2, 2021

Trying to build the contracts directory:

» nvm use 14
Now using node v14.16.1 (npm v6.14.12)

» npm install
...
» npm run build

the last command returns this:

» npm run build

> iott-example-contracts@0.1.0 build /Users/simone/Source/github/iotexproject/iott-dapp-example/contracts
> hardhat compile && find artifacts/contracts/**/*.json | grep -v 'dbg' | xargs -i cp {} abis/

Nothing to compile
xargs: illegal option -- i
usage: xargs [-0opt] [-E eofstr] [-I replstr [-R replacements] [-S replsize]]
             [-J replstr] [-L number] [-n number [-x]] [-P maxprocs]
             [-s size] [utility [argument ...]]
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! iott-example-contracts@0.1.0 build: `hardhat compile && find artifacts/contracts/**/*.json | grep -v 'dbg' | xargs -i cp {} abis/`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the iott-example-contracts@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/simone/.npm/_logs/2021-08-02T15_33_04_117Z-debug.log

Full log attached below:
debug.log

@simonerom
Copy link
Member Author

Possibly this is due to compiling on MacOS actually, let me try on Ubuntu...

@simonerom simonerom changed the title Cannot build the contracts Cannot build the contracts on macOS Aug 2, 2021
@simonerom
Copy link
Member Author

simonerom commented Aug 2, 2021

So the this error does not show up if I build onUbuntu. I'm renaming this as "Cannot build the contracts on macOS" and leave it open as a reminder for future support of macOS (if we want to support it, otherwise this can be closed)

@maswalker
Copy link
Contributor

find artifacts/contracts/**/*.json | grep -v 'dbg' | xargs -i cp {} abis/

This command is used to copy *.json files to abis directory except *.dbg.json, and it works correctlly on linux server.
I think the error was caused by the difference of ‘xargs’ command implemented on macOS and linux.
xargs -i

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