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

Fix compile family detection: Use C macros instead of $compiler -v #1000

Merged
merged 15 commits into from
Mar 17, 2024

Conversation

NobodyXu
Copy link
Collaborator

@NobodyXu NobodyXu commented Mar 7, 2024

Fixed #958

NobodyXu added 10 commits March 8, 2024 01:02
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
which is more robust than checking output of `$compiler -v`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
When expanding the file, the compiler prints a lot of information to stderr
that it is not an error, but related to expanding itself.

cc would have to disable warning here to prevent generation of too many warnings.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
…utput is enabled

It's good to have the output for debugging.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
…abled

Can help find issues related to compiler family detection.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Fallback to create `NamedTempfile` in `std::env::temp_dir()`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
@NobodyXu NobodyXu marked this pull request as ready for review March 8, 2024 07:51
It's not necessary.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
src/tool.rs Show resolved Hide resolved
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
src/tempfile.rs Outdated Show resolved Hide resolved
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Copy link
Member

@workingjubilee workingjubilee left a comment

Choose a reason for hiding this comment

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

Seems to work locally. Can't attest to Windows correctness, but we'll find out very quickly if it isn't.

@NobodyXu NobodyXu merged commit f36d6a7 into main Mar 17, 2024
42 checks passed
@NobodyXu NobodyXu deleted the fix/compile-family-detection branch March 17, 2024 22:05
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

Successfully merging this pull request may close these issues.

Compiler version doesn't include clang or GCC: "cc" "--version"
3 participants