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

Unable to build on Windows #3

Open
1 of 2 tasks
xJonathanLEI opened this issue Jan 12, 2022 · 8 comments
Open
1 of 2 tasks

Unable to build on Windows #3

xJonathanLEI opened this issue Jan 12, 2022 · 8 comments

Comments

@xJonathanLEI
Copy link
Owner

xJonathanLEI commented Jan 12, 2022

After the macOS build issue was resolved, it's discovered that the library also fails to build on Windows, for both x86_64-pc-windows-gnu and x86_64-pc-windows-msvc targets.

Target triples to fix:

  • x86_64-pc-windows-msvc
  • x86_64-pc-windows-gnu
@xJonathanLEI
Copy link
Owner Author

Building for x86_64-pc-windows-gnu seems to work under MinGW-w64 after dealing with the endian.h issue, but x86_64-pc-windows-msvc continues to not work.

@xJonathanLEI
Copy link
Owner Author

It seems that #5 has made the library compile for x86_64-pc-windows-gnu. The only target left is x86_64-pc-windows-msvc.

@milancermak
Copy link

I just noticed that starkware-libs/crypto-cpp#8 contains more fancy endian.h, maybe it supports the MSVC Win version?

@xJonathanLEI
Copy link
Owner Author

Interesting! Will definitely look into it.

However, for the endian.h part, as mentioned in #4, I actually removed that on purpose for all platforms for the sake of saving library users from thinking about host endianess for good.

Unfortunately, that repository doesn't seem to be monitored by Starkware lol.

@xJonathanLEI
Copy link
Owner Author

Just tried using the PR branch to build with MSVC. No luck.

I think right now the issue is mostly about the lack of 128-bit integer support. Maybe we can try replacing that with Boost?

@milancermak
Copy link

The only thing I know about Boost is that I'm scared of it 😆

@xJonathanLEI
Copy link
Owner Author

I just tried replacing __int128_t with boost::multiprecision::uint128_t, and most of the errors are now gone. I'm still having issue with __builtin_clzll though. Making progress.

@xJonathanLEI
Copy link
Owner Author

xJonathanLEI commented Jan 19, 2022

Made some further changes and now it compiles on MSVC. FINALLY.

However, one of the tests is failing. Not sure why:

warning: cl : Command line warning D9002 : ignoring unknown option '-static'
warning: cl : Command line warning D9002 : ignoring unknown option '-static'
warning: cl : Command line warning D9002 : ignoring unknown option '-static'
warning: cl : Command line warning D9002 : ignoring unknown option '-static'
warning: cl : Command line warning D9002 : ignoring unknown option '-static'
warning: cl : Command line warning D9002 : ignoring unknown option '-static'
warning: cl : Command line warning D9002 : ignoring unknown option '-static'
    Finished test [unoptimized + debuginfo] target(s) in 0.09s
     Running unittests (target\debug\deps\starkware_crypto_sys-e779f33c123515e6.exe)

running 5 tests
test tests::test_hash ... ok
test tests::test_verify_invalid_message ... FAILED
test tests::test_verify_valid_message ... ok
test tests::test_get_public_key ... ok
test tests::test_sign ... ok

failures:

---- tests::test_verify_invalid_message stdout ----
thread 'tests::test_verify_invalid_message' panicked at 'assertion failed: `(left == right)`
  left: `true`,
 right: `false`', src\lib.rs:261:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    tests::test_verify_invalid_message

test result: FAILED. 4 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 3.56s

error: test failed, to rerun pass '--lib'

Looking into the issue now.

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