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

Compile example contracts failed on Windows #3130

Closed
zhutoulala opened this issue Jan 1, 2022 · 14 comments
Closed

Compile example contracts failed on Windows #3130

zhutoulala opened this issue Jan 1, 2022 · 14 comments
Assignees

Comments

@zhutoulala
Copy link
Contributor

I was able to do a local dev build of starcoin on Windows 10, but running into below error when following the tutorial to compile example contracts. Perhaps due to the different line ending?

starcoin% dev compile -o examples examples
�[0m�[1m�[38;5;9merror[E01001]�[0m�[1m: invalid character�[0m
  �[0m�[36m┌─�[0m C:\Users\peter\AppData\Local\Temp\e5f468ac479d3806f90bbd40ac032011\Account.move:1:14
  �[0m�[36m│�[0m
�[0m�[36m1�[0m �[0m�[36m│�[0m address 0x1 {
' found when reading file. Only ASCII printable characters, tabs (\t), and line endings (\n) are permitted.�[0m

�[0m�[1m�[38;5;9merror[E01001]�[0m�[1m: invalid character�[0m
  �[0m�[36m┌─�[0m C:\Users\peter\AppData\Local\Temp\e5f468ac479d3806f90bbd40ac032011\AccountScripts.move:1:14
  �[0m�[36m│�[0m
�[0m�[36m1�[0m �[0m�[36m│�[0m address 0x1 {
' found when reading file. Only ASCII printable characters, tabs (\t), and line endings (\n) are permitted.�[0m

�[0m�[1m�[38;5;9merror[E01001]�[0m�[1m: invalid character�[0m
  �[0m�[36m┌─�[0m C:\Users\peter\AppData\Local\Temp\e5f468ac479d3806f90bbd40ac032011\Authenticator.move:1:1
  �[0m�[36m│�[0m
�[0m�[36m1�[0m �[0m�[36m│�[0m
' found when reading file. Only ASCII printable characters, tabs (\t), and line endings (\n) are permitted.�[0m
...
@jolestar
Copy link
Member

jolestar commented Jan 1, 2022

Maybe the windows file encode problem, @welbon did you solve the same problem?

@jolestar
Copy link
Member

jolestar commented Jan 1, 2022

We need to support Move windows develop environment. #3131

@zhutoulala
Copy link
Contributor Author

The problem is solved by using dos2unix to convert all move files under stdlib folder and example folder. I guess the compiler could add such conversation when reading move files on Windows.

@zhutoulala
Copy link
Contributor Author

Just created a small PR #3135 for this issue. Fairly new to Rust, kindly let me know if anything needs to be changed

yubing744 added a commit to yubing744/move that referenced this issue May 1, 2022
yubing744 added a commit to yubing744/move that referenced this issue May 5, 2022
wrwg pushed a commit to move-language/move that referenced this issue May 6, 2022
* [move-compiler] Support CRLF as newline for Move files

Fix issue: starcoinorg/starcoin#3130

* feat: validate crlf in source

* [move-compiler] Support CRLF as newline for Move files

Fix issue: starcoinorg/starcoin#3130

* feat: fix test-ci fail
@yubing744
Copy link

@jolestar Can help sync the latest code from https://github.com/move-language/move to https://github.com/starcoinorg/move

jolestar pushed a commit to starcoinorg/move that referenced this issue May 7, 2022
)

* [move-compiler] Support CRLF as newline for Move files

Fix issue: starcoinorg/starcoin#3130

* feat: validate crlf in source

* [move-compiler] Support CRLF as newline for Move files

Fix issue: starcoinorg/starcoin#3130

* feat: fix test-ci fail
@jolestar
Copy link
Member

jolestar commented May 7, 2022

@jolestar Can help sync the latest code from https://github.com/move-language/move to https://github.com/starcoinorg/move

@yubing744 I release a alpha version https://github.com/starcoinorg/starcoin/releases/tag/v1.11.8-alpha

@yubing744
Copy link

I tested v1.11.8-alpha, found new error:

image

@yubing744
Copy link

The bad case is \t\r\n

image

@jolestar
Copy link
Member

jolestar commented May 8, 2022

The bad case is \t\r\n

image

Does we just need to fix the examples?

@yubing744
Copy link

The bad case is \t\r\n
image

Does we just need to fix the examples?

No, I submited a new PR to handle this.

@yubing744
Copy link

@jolestar The PR has been merged, can help sync the latest code from https://github.com/move-language/move to https://github.com/starcoinorg/move again.

@jolestar
Copy link
Member

@jolestar The PR has been merged, can help sync the latest code from https://github.com/move-language/move to https://github.com/starcoinorg/move again.

release a new alpha version https://github.com/starcoinorg/starcoin/releases/tag/v1.11.9-alpha

@yubing744
Copy link

@jolestar The PR has been merged, can help sync the latest code from https://github.com/move-language/move to https://github.com/starcoinorg/move again.

release a new alpha version https://github.com/starcoinorg/starcoin/releases/tag/v1.11.9-alpha

I tested v1.11.9-alpha and the move file is now compatible with both LF and CRLF line breaks, but there are two other issues:

  1. There is no environment variable HOME by default on the Windows platform, and executing mpm package build will prompt an error that the HOME environment variable cannot be found.
    image

  2. Executing the integration test on the Windows platform will cause the verification failure due to the newline of the exp file being replaced by CRLF
    image

I have raised two issues:
#3400
#3401

villesundell pushed a commit to villesundell/move that referenced this issue Jul 7, 2022
)

* [move-compiler] Support CRLF as newline for Move files

Fix issue: starcoinorg/starcoin#3130

* feat: validate crlf in source

* [move-compiler] Support CRLF as newline for Move files

Fix issue: starcoinorg/starcoin#3130

* feat: fix test-ci fail
@jolestar
Copy link
Member

resolved

sahithiacn pushed a commit to sahithiacn/move that referenced this issue Jan 11, 2023
* [move-compiler] Support CRLF as newline for Move files

Fix issue: starcoinorg/starcoin#3130

* feat: validate crlf in source

* [move-compiler] Support CRLF as newline for Move files

Fix issue: starcoinorg/starcoin#3130

* feat: fix test-ci fail

Signed-off-by: sahithiacn <sahithi.kalakonda@accenture.com>
bors-diem pushed a commit to diem/move that referenced this issue Jan 11, 2023
* [move-compiler] Support CRLF as newline for Move files

Fix issue: starcoinorg/starcoin#3130

* feat: validate crlf in source

* [move-compiler] Support CRLF as newline for Move files

Fix issue: starcoinorg/starcoin#3130

* feat: fix test-ci fail

Signed-off-by: sahithiacn <sahithi.kalakonda@accenture.com>
Closes: #328
bors-diem pushed a commit to diem/move that referenced this issue Jan 11, 2023
* [move-compiler] Support CRLF as newline for Move files

Fix issue: starcoinorg/starcoin#3130

* feat: validate crlf in source

* [move-compiler] Support CRLF as newline for Move files

Fix issue: starcoinorg/starcoin#3130

* feat: fix test-ci fail

Signed-off-by: sahithiacn <sahithi.kalakonda@accenture.com>
Closes: #328
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