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

MSYS2 build failed: file too small to be an archive #426

Closed
abcfy2 opened this issue Jul 27, 2020 · 11 comments
Closed

MSYS2 build failed: file too small to be an archive #426

abcfy2 opened this issue Jul 27, 2020 · 11 comments

Comments

@abcfy2
Copy link

abcfy2 commented Jul 27, 2020

Windows 10 x64 using MSYS2.

# pacman -S mingw-w64-x86_64-rust
# cargo install deno --verbose
# ... SNIP ...
     Running `C:\Users\abcfy\AppData\Local\Temp\cargo-installHL2kUR\release\build\rusty_v8-994b3b26aa8c6950\build-script-build`
     Running `rustc --crate-name rusty_v8 --edition=2018 C:\Users\abcfy\.cargo\registry\src\mirrors.sjtug.sjtu.edu.cn-4f7dbcce21e258a2\rusty_v8-0.7.0\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C metadata=3f85fa453429514e -C extra-filename=-3f85fa453429514e --out-dir C:\Users\abcfy\AppData\Local\Temp\cargo-installHL2kUR\release\deps -L dependency=C:\Users\abcfy\AppData\Local\Temp\cargo-installHL2kUR\release\deps --extern bitflags=C:\Users\abcfy\AppData\Local\Temp\cargo-installHL2kUR\release\deps\libbitflags-652fbca4a9a2b259.rmeta --extern lazy_static=C:\Users\abcfy\AppData\Local\Temp\cargo-installHL2kUR\release\deps\liblazy_static-a7bdb4faba14fa47.rmeta --extern libc=C:\Users\abcfy\AppData\Local\Temp\cargo-installHL2kUR\release\deps\liblibc-5905678cb33dff26.rmeta --cap-lints allow -L C:\Users\abcfy\AppData\Local\Temp\cargo-installHL2kUR\release\gn_out\obj -l static=rusty_v8 -l dylib=winmm -l dylib=dbghelp`
   Compiling swc_visit v0.1.0
     Running `rustc --crate-name swc_visit --edition=2018 C:\Users\abcfy\.cargo\registry\src\mirrors.sjtug.sjtu.edu.cn-4f7dbcce21e258a2\swc_visit-0.1.0\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C metadata=7b29a806369777c6 -C extra-filename=-7b29a806369777c6 --out-dir C:\Users\abcfy\AppData\Local\Temp\cargo-installHL2kUR\release\deps -L dependency=C:\Users\abcfy\AppData\Local\Temp\cargo-installHL2kUR\release\deps --extern either=C:\Users\abcfy\AppData\Local\Temp\cargo-installHL2kUR\release\deps\libeither-9d06d2f0b349566c.rmeta --extern swc_visit_macros=C:\Users\abcfy\AppData\Local\Temp\cargo-installHL2kUR\release\deps\swc_visit_macros-606251da8794bb79.dll --cap-lints allow`
error: failed to add native library C:\Users\abcfy\AppData\Local\Temp\cargo-installHL2kUR\release\gn_out\obj\rusty_v8.lib: file too small to be an archive

error: aborting due to previous error

error: could not compile `rusty_v8`.

Caused by:
  process didn't exit successfully: `rustc --crate-name rusty_v8 --edition=2018 C:\Users\abcfy\.cargo\registry\src\mirrors.sjtug.sjtu.edu.cn-4f7dbcce21e258a2\rusty_v8-0.7.0\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C metadata=3f85fa453429514e -C extra-filename=-3f85fa453429514e --out-dir C:\Users\abcfy\AppData\Local\Temp\cargo-installHL2kUR\release\deps -L dependency=C:\Users\abcfy\AppData\Local\Temp\cargo-installHL2kUR\release\deps --extern bitflags=C:\Users\abcfy\AppData\Local\Temp\cargo-installHL2kUR\release\deps\libbitflags-652fbca4a9a2b259.rmeta --extern lazy_static=C:\Users\abcfy\AppData\Local\Temp\cargo-installHL2kUR\release\deps\liblazy_static-a7bdb4faba14fa47.rmeta --extern libc=C:\Users\abcfy\AppData\Local\Temp\cargo-installHL2kUR\release\deps\liblibc-5905678cb33dff26.rmeta --cap-lints allow -L C:\Users\abcfy\AppData\Local\Temp\cargo-installHL2kUR\release\gn_out\obj -l static=rusty_v8 -l dylib=winmm -l dylib=dbghelp` (exit code: 1)
warning: build failed, waiting for other jobs to finish...
error: failed to compile `deno v1.2.1`, intermediate artifacts can be found at `C:\Users\abcfy\AppData\Local\Temp\cargo-installHL2kUR`

Caused by:
  build failed
@sv158
Copy link

sv158 commented Aug 22, 2020

same problem while compiling to i686 target:

error: failed to add native library C:\Users\e\AppData\Local\Temp\cargo-installmEJj2T\i686-pc-windows-msvc\release\gn_out\obj\rusty_v8.lib: file too small to be an archive

error: aborting due to previous error

error: could not compile `rusty_v8`.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
    Building [===================================================>   ] 410/427: rusty_v8(build)

build command:

set RUSTFLAGS=-Ctarget-feature=+crt-static -Clink-args=/subsystem:console,5.01
cargo install deno --target i686-pc-windows-msvc

@piscisaureus
Copy link
Member

@abcfy2 Something went wrong downloading the pre-built rusty_v8.lib.

Try to remove the directory C:\Users\abcfy\AppData\Local\Temp\cargo-installHL2kUR\release\gn_outand try again.

@piscisaureus
Copy link
Member

piscisaureus commented Aug 22, 2020

@v3470 i686 windows targets are not supported and never will be supported. Build x64 instead.

Reasons:

@piscisaureus
Copy link
Member

piscisaureus commented Aug 22, 2020

@abcfy2 I'm closing this issue, feel free to open a new one if this remains a problem.

@abcfy2
Copy link
Author

abcfy2 commented Aug 23, 2020

Still not fixed.

error: failed to add native library C:\Users\abcfy\AppData\Local\Temp\cargo-installBJ9Giy\release\gn_out\obj\rusty_v8.lib: file too small to be an archive

error: aborting due to previous error

error: could not compile `rusty_v8`.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `deno v1.3.1`, intermediate artifacts can be found at `C:\Users\abcfy\AppData\Local\Temp\cargo-installBJ9Giy`

Caused by:
  build failed

And:

 cat /c/Users/abcfy/AppData/Local/Temp/cargo-installBJ9Giy/release/gn_out/obj/rusty_v8.lib
Not Found

@abcfy2
Copy link
Author

abcfy2 commented Sep 7, 2020

   Compiling tracing-futures v0.2.4
     Running `rustc --crate-name tracing_futures --edition=2018 'C:\Users\abcfy\.cargo\registry\src\github.com-1ecc6299db9ec823\tracing-futures-0.2.4\src\lib.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 --cfg 'feature="pin-project"' --cfg 'feature="std-future"' -C metadata=1f1e0c5653c4eefa -C extra-filename=-1f1e0c5653c4eefa --out-dir 'C:\Users\abcfy\AppData\Local\Temp\cargo-installJipJ7Y\release\deps' -L 'dependency=C:\Users\abcfy\AppData\Local\Temp\cargo-installJipJ7Y\release\deps' --extern 'pin_project=C:\Users\abcfy\AppData\Local\Temp\cargo-installJipJ7Y\release\deps\libpin_project-947e80dd813bbea2.rmeta' --extern 'tracing=C:\Users\abcfy\AppData\Local\Temp\cargo-installJipJ7Y\release\deps\libtracing-7b1fe942143b4522.rmeta' --cap-lints allow`
     Running `rustc --crate-name rusty_v8 --edition=2018 'C:\Users\abcfy\.cargo\registry\src\github.com-1ecc6299db9ec823\rusty_v8-0.9.1\src\lib.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C metadata=3a27730a96a1c863 -C extra-filename=-3a27730a96a1c863 --out-dir 'C:\Users\abcfy\AppData\Local\Temp\cargo-installJipJ7Y\release\deps' -L 'dependency=C:\Users\abcfy\AppData\Local\Temp\cargo-installJipJ7Y\release\deps' --extern 'bitflags=C:\Users\abcfy\AppData\Local\Temp\cargo-installJipJ7Y\release\deps\libbitflags-652fbca4a9a2b259.rmeta' --extern 'lazy_static=C:\Users\abcfy\AppData\Local\Temp\cargo-installJipJ7Y\release\deps\liblazy_static-a7bdb4faba14fa47.rmeta' --extern 'libc=C:\Users\abcfy\AppData\Local\Temp\cargo-installJipJ7Y\release\deps\liblibc-5a96e0dad9755a00.rmeta' --cap-lints allow -L 'C:\Users\abcfy\AppData\Local\Temp\cargo-installJipJ7Y\release\gn_out\obj' -l static=rusty_v8 -l dylib=winmm -l dylib=dbghelp`
     Running `rustc --crate-name serde 'C:\Users\abcfy\.cargo\registry\src\github.com-1ecc6299db9ec823\serde-1.0.115\src\lib.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 --cfg 'feature="default"' --cfg 'feature="derive"' --cfg 'feature="serde_derive"' --cfg 'feature="std"' -C metadata=ac56e72b4cfa681a -C extra-filename=-ac56e72b4cfa681a --out-dir 'C:\Users\abcfy\AppData\Local\Temp\cargo-installJipJ7Y\release\deps' -L 'dependency=C:\Users\abcfy\AppData\Local\Temp\cargo-installJipJ7Y\release\deps' --extern 'serde_derive=C:\Users\abcfy\AppData\Local\Temp\cargo-installJipJ7Y\release\deps\serde_derive-c3ea5127e7031b7e.dll' --cap-lints allow --cfg ops_bound --cfg core_reverse --cfg de_boxed_c_str --cfg de_boxed_path --cfg de_rc_dst --cfg core_duration --cfg integer128 --cfg range_inclusive --cfg num_nonzero --cfg core_try_from --cfg num_nonzero_signed --cfg std_atomic64 --cfg std_atomic`
error: failed to add native library C:\Users\abcfy\AppData\Local\Temp\cargo-installJipJ7Y\release\gn_out\obj\rusty_v8.lib: file too small to be an archive

error: aborting due to previous error

error: could not compile `rusty_v8`.

Caused by:
  process didn't exit successfully: `rustc --crate-name rusty_v8 --edition=2018 'C:\Users\abcfy\.cargo\registry\src\github.com-1ecc6299db9ec823\rusty_v8-0.9.1\src\lib.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C metadata=3a27730a96a1c863 -C extra-filename=-3a27730a96a1c863 --out-dir 'C:\Users\abcfy\AppData\Local\Temp\cargo-installJipJ7Y\release\deps' -L 'dependency=C:\Users\abcfy\AppData\Local\Temp\cargo-installJipJ7Y\release\deps' --extern 'bitflags=C:\Users\abcfy\AppData\Local\Temp\cargo-installJipJ7Y\release\deps\libbitflags-652fbca4a9a2b259.rmeta' --extern 'lazy_static=C:\Users\abcfy\AppData\Local\Temp\cargo-installJipJ7Y\release\deps\liblazy_static-a7bdb4faba14fa47.rmeta' --extern 'libc=C:\Users\abcfy\AppData\Local\Temp\cargo-installJipJ7Y\release\deps\liblibc-5a96e0dad9755a00.rmeta' --cap-lints allow -L 'C:\Users\abcfy\AppData\Local\Temp\cargo-installJipJ7Y\release\gn_out\obj' -l static=rusty_v8 -l dylib=winmm -l dylib=dbghelp` (exit code: 1)
warning: build failed, waiting for other jobs to finish...
error: failed to compile `deno v1.3.3`, intermediate artifacts can be found at `C:\Users\abcfy\AppData\Local\Temp\cargo-installJipJ7Y`

Caused by:
  build failed

@piscisaureus
Copy link
Member

piscisaureus commented Sep 7, 2020 via email

@abcfy2
Copy link
Author

abcfy2 commented Sep 7, 2020

Install from recommended way is working:

 rustup show
Default host: x86_64-pc-windows-msvc
rustup home:  C:\Users\abcfy\.rustup

stable-x86_64-pc-windows-msvc (default)
rustc 1.46.0 (04488afe3 2020-08-24)

Seems that x86_64-pc-windows-msvc is working. MSYS2 rust package is building under mingw64, which will cause this failure.

@aircloud
Copy link

aircloud commented Mar 4, 2021

@v3470 i686 windows targets are not supported and never will be supported. Build x64 instead.

Reasons:

  • stable rust does not support the "thiscall" calling convention, and it looks like it never will - rust-lang/rust#42202
  • i686 is dead anyway

@piscisaureus Hello, I am now using this project to build an experimental program, first thank you very much.

However, I need to build 32-bit products (i686-pc-windows-msvc), I want to know if I use the nightly Rust, is it possible to build successfully (because you said "stable rust does not support the "thiscall" calling convention"), Can you give me some guidance or help?

@pedropaulosuzuki
Copy link

@v3470 i686 windows targets are not supported and never will be supported. Build x64 instead.

Reasons:

  • stable rust does not support the "thiscall" calling convention, and it looks like it never will - rust-lang/rust#42202
  • i686 is dead anyway

While I agree that stable Rust doesn't support the "syscall" calling convention, I disagree on i686 being dead. Many people rely on old hardware because new hardware can get quite expensive on some countries, which lead them to not be capable of running some software because devs tend to have higher specs and believe some tech is "dead". I understand the reason for Deno not being able to run on i686, but saying it is dead is not a good argument. But again, not criticizing the decision, I understand not supporting i686 because it can get very tricky.

@bnoordhuis
Copy link
Contributor

Our hand is forced here by V8, it doesn't support i686 (i.e., x86 without SSE2.)

x86 with SSE2 still works (for now) but you probably can't build it natively anymore (takes too much memory to link) and cross-compiling V8 is a big hassle.

I don't think there's a big enough user base anymore to make it a worthwhile cost/benefit tradeoff. Architecture support is not a trivial undertaking with V8.

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

6 participants