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

[SCons] Remove MAXLINELENGTH override for MSVC #97458

Conversation

Faless
Copy link
Collaborator

@Faless Faless commented Sep 25, 2024

It's not clear what is the actual max value that Windows support, but despite their claim of it being 8191 we have been seeing failure with just 8150.

@@ -390,7 +390,12 @@ def configure_msvc(env: "SConsEnvironment", vcvars_msvc_config):
env.AppendUnique(CPPDEFINES=["R128_STDC_ONLY"])
env.extra_suffix = ".llvm" + env.extra_suffix

env["MAXLINELENGTH"] = 8192 # Windows Vista and beyond, so always applicable.
env["MAXLINELENGTH"] = 2048 # Same as SCons default
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default MAXLINELENGTH for Windows was to accommodate versions earlier than Vista; we don't need to use it. However, this value being here in the first place was due to an old implementation of silence_msvc, which is no longer relevant. I'd either revert this change, or remove the line entirely.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default MAXLINELENGTH for Windows was to accommodate versions earlier than Vista; we don't need to use it. However, this value being here in the first place was due to an old implementation of silence_msvc, which is no longer relevant. I'd either revert this change, or remove the line entirely.

The old value (8192) was causing #96394 to fail due to "line too long" on a 8150 chars line, so it seems windows doesn't doesn't really support 8191 chars as they claim.

Maybe it's something due to wide chars, the terminal config in GH actions, I don't know, but a 8150 chars line is enough to make MSVC fail.

See this run for example:

lib /nologo /OUT:modules\module_mbedtls.windows.template_release.x86_64.lib thirdparty\mbedtls\library\aes.windows.template_release.x86_64.obj thirdparty\mbedtls\library\aesce.windows.template_release.x86_64.obj thirdparty\mbedtls\library\aesni.windows.template_release.x86_64.obj thirdparty\mbedtls\library\aria.windows.template_release.x86_64.obj thirdparty\mbedtls\library\asn1parse.windows.template_release.x86_64.obj thirdparty\mbedtls\library\asn1write.windows.template_release.x86_64.obj thirdparty\mbedtls\library\base64.windows.template_release.x86_64.obj thirdparty\mbedtls\library\bignum.windows.template_release.x86_64.obj thirdparty\mbedtls\library\bignum_core.windows.template_release.x86_64.obj thirdparty\mbedtls\library\bignum_mod_raw.windows.template_release.x86_64.obj thirdparty\mbedtls\library\camellia.windows.template_release.x86_64.obj thirdparty\mbedtls\library\ccm.windows.template_release.x86_64.obj thirdparty\mbedtls\library\chacha20.windows.template_release.x86_64.obj thirdparty\mbedtls\library\chachapoly.windows.template_release.x86_64.obj thirdparty\mbedtls\library\cipher.windows.template_release.x86_64.obj thirdparty\mbedtls\library\cipher_wrap.windows.template_release.x86_64.obj thirdparty\mbedtls\library\cmac.windows.template_release.x86_64.obj thirdparty\mbedtls\library\constant_time.windows.template_release.x86_64.obj thirdparty\mbedtls\library\ctr_drbg.windows.template_release.x86_64.obj thirdparty\mbedtls\library\debug.windows.template_release.x86_64.obj thirdparty\mbedtls\library\des.windows.template_release.x86_64.obj thirdparty\mbedtls\library\dhm.windows.template_release.x86_64.obj thirdparty\mbedtls\library\ecdh.windows.template_release.x86_64.obj thirdparty\mbedtls\library\ecdsa.windows.template_release.x86_64.obj thirdparty\mbedtls\library\ecjpake.windows.template_release.x86_64.obj thirdparty\mbedtls\library\ecp.windows.template_release.x86_64.obj thirdparty\mbedtls\library\ecp_curves.windows.template_release.x86_64.obj thirdparty\mbedtls\library\entropy.windows.template_release.x86_64.obj thirdparty\mbedtls\library\entropy_poll.windows.template_release.x86_64.obj thirdparty\mbedtls\library\error.windows.template_release.x86_64.obj thirdparty\mbedtls\library\gcm.windows.template_release.x86_64.obj thirdparty\mbedtls\library\hkdf.windows.template_release.x86_64.obj thirdparty\mbedtls\library\hmac_drbg.windows.template_release.x86_64.obj thirdparty\mbedtls\library\md.windows.template_release.x86_64.obj thirdparty\mbedtls\library\md5.windows.template_release.x86_64.obj thirdparty\mbedtls\library\memory_buffer_alloc.windows.template_release.x86_64.obj thirdparty\mbedtls\library\mps_reader.windows.template_release.x86_64.obj thirdparty\mbedtls\library\mps_trace.windows.template_release.x86_64.obj thirdparty\mbedtls\library\net_sockets.windows.template_release.x86_64.obj thirdparty\mbedtls\library\nist_kw.windows.template_release.x86_64.obj thirdparty\mbedtls\library\oid.windows.template_release.x86_64.obj thirdparty\mbedtls\library\padlock.windows.template_release.x86_64.obj thirdparty\mbedtls\library\pem.windows.template_release.x86_64.obj thirdparty\mbedtls\library\pk.windows.template_release.x86_64.obj thirdparty\mbedtls\library\pk_ecc.windows.template_release.x86_64.obj thirdparty\mbedtls\library\pk_wrap.windows.template_release.x86_64.obj thirdparty\mbedtls\library\pkcs12.windows.template_release.x86_64.obj thirdparty\mbedtls\library\pkcs5.windows.template_release.x86_64.obj thirdparty\mbedtls\library\pkcs7.windows.template_release.x86_64.obj thirdparty\mbedtls\library\pkparse.windows.template_release.x86_64.obj thirdparty\mbedtls\library\pkwrite.windows.template_release.x86_64.obj thirdparty\mbedtls\library\platform.windows.template_release.x86_64.obj thirdparty\mbedtls\library\platform_util.windows.template_release.x86_64.obj thirdparty\mbedtls\library\poly1305.windows.template_release.x86_64.obj thirdparty\mbedtls\library\psa_crypto.windows.template_release.x86_64.obj thirdparty\mbedtls\library\psa_crypto_aead.windows.template_release.x86_64.obj thirdparty\mbedtls\library\psa_crypto_cipher.windows.template_release.x86_64.obj thirdparty\mbedtls\library\psa_crypto_client.windows.template_release.x86_64.obj thirdparty\mbedtls\library\psa_crypto_driver_wrappers_no_static.windows.template_release.x86_64.obj thirdparty\mbedtls\library\psa_crypto_ecp.windows.template_release.x86_64.obj thirdparty\mbedtls\library\psa_crypto_ffdh.windows.template_release.x86_64.obj thirdparty\mbedtls\library\psa_crypto_hash.windows.template_release.x86_64.obj thirdparty\mbedtls\library\psa_crypto_mac.windows.template_release.x86_64.obj thirdparty\mbedtls\library\psa_crypto_pake.windows.template_release.x86_64.obj thirdparty\mbedtls\library\psa_crypto_rsa.windows.template_release.x86_64.obj thirdparty\mbedtls\library\psa_crypto_se.windows.template_release.x86_64.obj thirdparty\mbedtls\library\psa_crypto_slot_management.windows.template_release.x86_64.obj thirdparty\mbedtls\library\psa_crypto_storage.windows.template_release.x86_64.obj thirdparty\mbedtls\library\psa_its_file.windows.template_release.x86_64.obj thirdparty\mbedtls\library\psa_util.windows.template_release.x86_64.obj thirdparty\mbedtls\library\ripemd160.windows.template_release.x86_64.obj thirdparty\mbedtls\library\rsa.windows.template_release.x86_64.obj thirdparty\mbedtls\library\rsa_alt_helpers.windows.template_release.x86_64.obj thirdparty\mbedtls\library\sha1.windows.template_release.x86_64.obj thirdparty\mbedtls\library\sha3.windows.template_release.x86_64.obj thirdparty\mbedtls\library\sha256.windows.template_release.x86_64.obj thirdparty\mbedtls\library\sha512.windows.template_release.x86_64.obj thirdparty\mbedtls\library\ssl_cache.windows.template_release.x86_64.obj thirdparty\mbedtls\library\ssl_ciphersuites.windows.template_release.x86_64.obj thirdparty\mbedtls\library\ssl_client.windows.template_release.x86_64.obj thirdparty\mbedtls\library\ssl_cookie.windows.template_release.x86_64.obj thirdparty\mbedtls\library\ssl_debug_helpers_generated.windows.template_release.x86_64.obj thirdparty\mbedtls\library\ssl_msg.windows.template_release.x86_64.obj thirdparty\mbedtls\library\ssl_ticket.windows.template_release.x86_64.obj thirdparty\mbedtls\library\ssl_tls.windows.template_release.x86_64.obj thirdparty\mbedtls\library\ssl_tls12_client.windows.template_release.x86_64.obj thirdparty\mbedtls\library\ssl_tls12_server.windows.template_release.x86_64.obj thirdparty\mbedtls\library\ssl_tls13_client.windows.template_release.x86_64.obj thirdparty\mbedtls\library\ssl_tls13_generic.windows.template_release.x86_64.obj thirdparty\mbedtls\library\ssl_tls13_keys.windows.template_release.x86_64.obj thirdparty\mbedtls\library\ssl_tls13_server.windows.template_release.x86_64.obj thirdparty\mbedtls\library\threading.windows.template_release.x86_64.obj thirdparty\mbedtls\library\timing.windows.template_release.x86_64.obj thirdparty\mbedtls\library\version.windows.template_release.x86_64.obj thirdparty\mbedtls\library\version_features.windows.template_release.x86_64.obj thirdparty\mbedtls\library\x509.windows.template_release.x86_64.obj thirdparty\mbedtls\library\x509_create.windows.template_release.x86_64.obj thirdparty\mbedtls\library\x509_crl.windows.template_release.x86_64.obj thirdparty\mbedtls\library\x509_crt.windows.template_release.x86_64.obj thirdparty\mbedtls\library\x509_csr.windows.template_release.x86_64.obj thirdparty\mbedtls\library\x509write.windows.template_release.x86_64.obj thirdparty\mbedtls\library\x509write_crt.windows.template_release.x86_64.obj thirdparty\mbedtls\library\x509write_csr.windows.template_release.x86_64.obj modules\mbedtls\crypto_mbedtls.windows.template_release.x86_64.obj modules\mbedtls\dtls_server_mbedtls.windows.template_release.x86_64.obj modules\mbedtls\packet_peer_mbed_dtls.windows.template_release.x86_64.obj modules\mbedtls\register_types.windows.template_release.x86_64.obj modules\mbedtls\stream_peer_mbedtls.windows.template_release.x86_64.obj modules\mbedtls\tls_context_mbedtls.windows.template_release.x86_64.obj modules\mbedtls\tests\test_crypto_mbedtls.windows.template_release.x86_64.obj
The command line is too long.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated the PR to completely remove our MAXLINELENGTH override, which seems to work for #96394 .

I assume it's using 2048 which seems to be the SCons default when it properly detects win32

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me, values up to 8070 are working, 8191 limit probably include something we (and Scons) are not accounting for, like cwd or full path of lib binary. If a higher value is still needed for warning suppression, we probably can subtract MAX_PATH (or set it to 7K to be safe) instead of fully removing it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I'm not going to waste more time on Microsoft bs operating system.

If anyone has a better solution that works, I'll gladly rebase #96394 on top of that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this PR is fine as is, removing the explicit override seems to let SCons handle this properly.

If we need to increase the limit manually again, this can be looked into in a follow-up PR.

@Faless Faless force-pushed the fix/imagine_its_2024_and_your_os_cant_handle_few_kbs_of_text branch from 3e9e312 to 04e81a4 Compare September 26, 2024 07:06
@akien-mga akien-mga added the cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release label Sep 26, 2024
@akien-mga akien-mga changed the title [SCons] Apply long line fix to windows MSVC [SCons] Apply long line fix to Windows MSVC Sep 26, 2024
platform/windows/detect.py Outdated Show resolved Hide resolved
It's not clear what is the actual max value that windows support, but
despite their claim of it being 8191 we have been seeing failure with
just 8150.
@Faless Faless force-pushed the fix/imagine_its_2024_and_your_os_cant_handle_few_kbs_of_text branch from 04e81a4 to 395a4fc Compare September 26, 2024 10:19
@Faless Faless changed the title [SCons] Apply long line fix to Windows MSVC [SCons] Remove MAXLINELENGTH override for MSVC Sep 26, 2024
@akien-mga akien-mga merged commit a0d1ba4 into godotengine:master Sep 26, 2024
19 checks passed
@akien-mga
Copy link
Member

Thanks!

@Faless Faless deleted the fix/imagine_its_2024_and_your_os_cant_handle_few_kbs_of_text branch September 26, 2024 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release platform:windows topic:buildsystem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants