Skip to content

Unable to compile contracts on Windows machine #689

Open
@afcharliekong

Description

Describe the bug

I'm facing a couple of issues when using Algo Builder to compile contracts on windows machine. I've attached the screenshots as shown below.

  1. This occurs because the framework uses python3 command to compile the contracts. I'm currently using anaconda python virtual environment on Windows 10. It uses python instead.

Screenshot 2022-05-20 at 6 37 28 PM

  1. This occurs after I've updated the file in node_modules/@algo-builder/runtime/build/lib/pycompile-op.js to use python instead of python3.

Screenshot 2022-05-20 at 6 40 20 PM

I believe issue 2 is because of the different error numbers used by nodeJS for mac and windows machines. I had to replace the e?.errno === -2 with e?.errno === -4058 on line number 103 so that framework can detect missing generated yaml files and continue the process of compilation. The file is located in /node_modules/@algo-builder/algob/build/lib/compile.js

Possible Solution

  1. Not sure if there's a way to try running the compilation with python3 or python or py.
  2. Maybe we can detect the OS and dynamically change the error number detection accordingly?

Steps to Reproduce

  1. Run yarn run algob compile on a new Algo Builder project on Windows 10.

Environment

  • OS: Windows 10, Windows 11
  • Node.js version: v16.15.0
  • algob version: 3.2.0
  • Python: 3.9.12 (using anaconda)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions