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 Compile relatively large directory on 32bit #122

Closed
Billy-Sheppard opened this issue Sep 1, 2020 · 3 comments
Closed

Unable to Compile relatively large directory on 32bit #122

Billy-Sheppard opened this issue Sep 1, 2020 · 3 comments

Comments

@Billy-Sheppard
Copy link

First of all I must say this is a wonderful library and super useful.

I was just wondering if there was a solution to this issue. It works perfectly with the target dir (1.67gb) on 64bit however it falls over on 32bit Windows. Smaller directories do work on 32bit.

memory allocation of 268435456 bytes failed
error: could not compile `rust-app`.

Caused by:
  process didn't exit successfully: `rustc 
  --crate-name rust-app 
  --edition=2018 'src\main.rs' 
  --error-format=json 
  --json=diagnostic-rendered-ansi 
  --crate-type bin 
  --emit=dep-info,link -C opt-level=3 -Cembed-bitcode=no -C metadata=345c59f1de03c671 
  --out-dir 'C:\Users\Windows 10\rust-app\target\release\deps' -L 'dependency=C:\Users\Windows 10\rust-app\target\release\deps' 
  --extern 'anyhow=C:\Users\Windows 10\rust-app\target\release\deps\libanyhow-81d11210865f139d.rlib' 
  --extern 'colored=C:\Users\Windows 10\rust-app\target\release\deps\libcolored-281bf2267e4ccfdd.rlib' 
  --extern 'directories=C:\Users\Windows 10\rust-app\target\release\deps\libdirectories-5d39413c84ebaf88.rlib' 
  --extern 'env_logger=C:\Users\Windows 10\rust-app\target\release\deps\libenv_logger-a9c0cc6acbbd7be9.rlib' 
  --extern 'handlebars=C:\Users\Windows 10\rust-app\target\release\deps\libhandlebars-fc5435020b8a70d1.rlib' 
  --extern 'log=C:\Users\Windows 10\rust-app\target\release\deps\liblog-b2d727585ed1d5c6.rlib' 
  --extern 'log4rs=C:\Users\Windows 10\rust-app\target\release\deps\liblog4rs-57bcfd4a121948b2.rlib' 
  --extern 'nfd=C:\Users\Windows 10\rust-app\target\release\deps\libnfd-94e8c979ced76b97.rlib' 
  --extern 'os_info=C:\Users\Windows 10\rust-app\target\release\deps\libos_info-e651b3ff8d25c487.rlib' 
  --extern 'percent_encoding=C:\Users\Windows 10\rust-app\target\release\deps\libpercent_encoding-3cbf8e614ed085b1.rlib' 
  --extern 'rust_embed=C:\Users\Windows 10\rust-app\target\release\deps\librust_embed-9a51e5bb4530be39.rlib' 
  --extern 'serde=C:\Users\Windows 10\rust-app\target\release\deps\libserde-76e8dffa49d7eef4.rlib' 
  --extern 'serde_json=C:\Users\Windows 10\rust-app\target\release\deps\libserde_json-f9a3e604e66f0ea7.rlib' 
  --extern 'thiserror=C:\Users\Windows 10\rust-app\target\release\deps\libthiserror-0379caa49415ece3.rlib' 
  --extern 'tokio=C:\Users\Windows 10\rust-app\target\release\deps\libtokio-d72a2780b02cc2c9.rlib' 
  --extern 'uuid=C:\Users\Windows 10\rust-app\target\release\deps\libuuid-f251e1b544840b0c.rlib' 
  --extern 'walkdir=C:\Users\Windows 10\rust-app\target\release\deps\libwalkdir-f18e5126743ac1ac.rlib' 
  --extern 'warp=C:\Users\Windows 10\rust-app\target\release\deps\libwarp-d3a942d0d09096e7.rlib' 
  --extern 'webbrowser=C:\Users\Windows 10\rust-app\target\release\deps\libwebbrowser-7b176aaf3553d218.rlib' -L 'native=C:\Users\Windows 10\rust-app\target\release\build\nfd-034d066d68758654\out'` 
(exit code: 0xc0000409, STATUS_STACK_BUFFER_OVERRUN)```
@pyrossh
Copy link
Owner

pyrossh commented Sep 1, 2020

Seems like a memory issue for 32bit for large directories. rust-lang/rust#72084 (comment). Don't know if its possible to batch the writes.

@Durfsurn
Copy link

Durfsurn commented Sep 1, 2020

Interesting - without being intimately familiar with the code nor being an excellent programmer myself I'm not sure if this is untenable but perhaps the generate_assets function could batch its processing of the files with the quote! macro on a count of files. Understandably this is somewhat of an edge case but I might give a go at getting a custom version of it to work locally myself.

Thanks for that rust-lang issue I hadn't come across that before, and thanks for your reply.

@pyrossh
Copy link
Owner

pyrossh commented Aug 31, 2021

Closing this as there is a work around,

using x64 rustc host to cross-compile 32 bit binary.
here rust-lang/rust#72084 (comment)

@Billy-Sheppard if that doesn't work please feel free to reopen the issue.

@pyrossh pyrossh closed this as completed Aug 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants