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

Can't build #2

Closed
igroykt opened this issue Mar 24, 2022 · 3 comments
Closed

Can't build #2

igroykt opened this issue Mar 24, 2022 · 3 comments

Comments

@igroykt
Copy link

igroykt commented Mar 24, 2022

Hello, @cg31. Looks like windows build tools can't build src/x64.S according to this thread RustCrypto/asm-hashes#17.

@cg31
Copy link
Owner

cg31 commented Mar 24, 2022

Just fixed it.

@igroykt
Copy link
Author

igroykt commented Mar 24, 2022

Just fixed it.

Thank for reply.
How u build it?) I didn't understand. If I use msvc it still gave me that error.
If I switch to target gnu (cargo build --target=x86_64-pc-windows-gnu --release) then on nightly build I got this error:

   Compiling winreg v0.7.0
error: no rules expected the token `aarch64_apple`
   --> C:\Users\igro\.cargo\registry\src\github.com-1ecc6299db9ec823\ring-0.16.20\src\cpu.rs:257:13
    |
165 |     macro_rules! features {
    |     --------------------- when calling this macro
...
257 |             aarch64_apple: true,
    |             ^^^^^^^^^^^^^ no rules expected this token in macro call

   Compiling hostname v0.3.1
error[E0425]: cannot find value `AES` in module `cpu::arm`
   --> C:\Users\igro\.cargo\registry\src\github.com-1ecc6299db9ec823\ring-0.16.20\src\aead\aes.rs:381:65
    |
381 |         if cpu::intel::AES.available(cpu_features) || cpu::arm::AES.available(cpu_features) {
    |                                                                 ^^^ not found in `cpu::arm`
    |
help: consider importing this constant
    |
15  | use crate::cpu::intel::AES;
    |

error[E0425]: cannot find value `PMULL` in module `cpu::arm`
   --> C:\Users\igro\.cargo\registry\src\github.com-1ecc6299db9ec823\ring-0.16.20\src\aead\gcm.rs:315:26
    |
315 |             || cpu::arm::PMULL.available(cpu_features)
    |                          ^^^^^ not found in `cpu::arm`

error[E0425]: cannot find value `ARMCAP_STATIC` in this scope
   --> C:\Users\igro\.cargo\registry\src\github.com-1ecc6299db9ec823\ring-0.16.20\src\cpu.rs:235:41
    |
235 |             if self.mask == self.mask & ARMCAP_STATIC {
    |                                         ^^^^^^^^^^^^^ not found in this scope

   Compiling time v0.1.43
For more information about this error, try `rustc --explain E0425`.
error: could not compile `ring` due to 4 previous errors
warning: build failed, waiting for other jobs to finish...
error: build failed

And this is what I get on stable:

rustup target add x86_64-pc-windows-gnu
info: downloading component 'rust-std' for 'x86_64-pc-windows-gnu'
info: installing component 'rust-std' for 'x86_64-pc-windows-gnu'
 24.2 MiB /  24.2 MiB (100 %)  11.4 MiB/s in  2s ETA:  0s

cargo build --target=x86_64-pc-windows-gnu --release
...
   Compiling native-windows-derive v1.0.4 (https://github.com/gabdube/native-windows-gui.git?branch=master#227c4b62)
   Compiling russ v0.1.1 (C:\projects\shadowsocks-windows-gui-rust)
error: failed to run custom build command for `russ v0.1.1 (C:\projects\shadowsocks-windows-gui-rust)`

Caused by:
  process didn't exit successfully: `c:\projects\shadowsocks-windows-gui-rust\target\release\build\russ-e4c30005efe55be6\build-script-build` (exit code: 1)
  --- stdout
  "C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.17763.0\\x64\\rc.exe"
  "C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.19041.0\\x64\\rc.exe"
warning: build failed, waiting for other jobs to finish...
error: build failed

Maybe add some documentation/howto/binary?)

systeminfo: Windows 10 Pro 10.0.19044

@cg31
Copy link
Owner

cg31 commented Mar 25, 2022

This macro_rules error seems relating to latest nightly toolchain, it is also reported here:
rust-lang/rust#95267

that is why I added a rust-toolchain to specify a earlier toolchain.

And I am using i686-pc-windows-msvc toolchain, never tried GNU toolchain on Windows.

@igroykt igroykt closed this as completed Sep 12, 2022
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