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

What's the command line equivalent of compiling in VS Code? #51

Open
naddison36 opened this issue Feb 19, 2018 · 12 comments
Open

What's the command line equivalent of compiling in VS Code? #51

naddison36 opened this issue Feb 19, 2018 · 12 comments

Comments

@naddison36
Copy link
Contributor

I've tried the following but that doesn't give me the json files in the /bin/contracts folder
solc --bin --abi --optimize -o ./bin/contracts --overwrite ./contracts/*.sol

I tried adding the --standard-json option but it just hangs solc

My motivation is to have something like the following in my package.json file so developers who are not using VS Code can still compile my project.

"scripts": {
    "buildSol": "solc --bin --abi --optimize -o ./bin/contracts --overwrite ./contracts/*.sol",
    "buildJS": "tsc",
    "test": "jest"
  },
@juanfranblanco
Copy link
Owner

You need the full library as it is modified to include different inheritances and paths.

@cameel
Copy link

cameel commented May 30, 2021

I see this issue is pretty old but it's still open so here are some answers from compiler's perspective in case it gets picked up later:

I tried adding the --standard-json option but it just hangs solc

If you do not supply a file name after --standard-json, the compiler expects its content on standard input.

My motivation is to have something like the following in my package.json file so developers who are not using VS Code can still compile my project.

This would not be very straightforward. I expect that, as with most Solidity tools, solc is only a part of the compilation pipeline here. The extension uses prepares JSON input that contains compilation settings and a copy of all the source code and solc spits out JSON output that contains error messages, bytecode, ASTs, metadata and anything else the extension might request. There are many different ways you could prepare the input and the output likely needs additional processing. The extension would basically have to provide a command to give you the exact input it gives the compiler. And another command that takes the output JSON and processes it the way it usually does (at the very least extracts the bytecode and puts it in the right files).

As an aside, such a feature would also be useful for reproducing issues with solc alone and reporting them. It would make it easier to figure out if a particular bug is in the extension or in the compiler. This is a pretty niche use case though.

@juanfranblanco
Copy link
Owner

juanfranblanco commented May 31, 2021

@cameel Thanks for this, and in general all the comments you have made across yesterday, I think overall most of the issues come down to the need of having a common solidity project standard. Everything has kept evolving and we could have solved this if everyone had implemented this EIP ethereum/EIPs#82, or evolve it to a common standard that was agreed.

On the topic, the json could be created as an overriding input parameter, on vscode settings, but this make the evolution even harder. But yes it would change also the pipeline process.

Edit: Maybe is time to restart A project standard. I keep saying that :)

@cameel
Copy link

cameel commented Jun 3, 2021

No problem! I'm currently working on the path resolution in the compiler and as a part of that I'm researching how various tools and frameworks deal with them so I thought I'd look for related issues in the bug tracker here :)

On the topic of EIP 82, I think it might actually be a great time to restart the initiative. There are many established frameworks/tools now and each one basically has its own config file format so the need is definitely there. There's just no coordination. Wanting to seamlessly switch between VS Code or Remix IDE and a framework seems pretty common to me. The coordination problem can be solved by gathering many interested people in one place and we recently did just that - we launched a Solidity forum and many people working on tooling are there so it might be a good place to propose and discuss it in a wider community.

BTW, maybe you'd also like to join our new solc-tooling channel on Matrix or Telegram? We created it to have a more direct line of communication with projects affected by changes in the compiler. Our recent survey has shown that like 50% of Solidity developers use VS Code so it would be great to have your feedback there.

@juanfranblanco
Copy link
Owner

Yes for sure!! Ill join now.

@juanfranblanco
Copy link
Owner

@cameel I'm actually cc(d) there, but I never got the invite.

@cameel
Copy link

cameel commented Jun 4, 2021

You mean #solc-tooling? Pinging @franzihei.

@cameel
Copy link

cameel commented Jun 4, 2021

Just to make sure, I'm assuming you prefer Telegram? On the Matrix side an invite is not required.

@juanfranblanco
Copy link
Owner

juanfranblanco commented Jun 4, 2021

Ah, Ill try Matrix then, although I am in Telegram already (edit)

@juanfranblanco
Copy link
Owner

Thanks @franzihei !

@franzihei
Copy link

Deleted the invite links again to keep bots out but feel free to invite other people who should be in there (in case somebody is missing). The only reason the Telegram side isn't public is because Telegram is flooded with bots etc. :(

@juanfranblanco
Copy link
Owner

Yes I thought that myself, good call.

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

4 participants