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

Print the Ruby and compiler info or the command itself before compiling. #630

Merged
merged 1 commit into from Jun 1, 2023

Conversation

junaruga
Copy link
Member

@junaruga junaruga commented May 31, 2023

This PR is for a preparation of the #626.


Print the Ruby and compiler info or the command itself before compiling.

The new task "debug_compiler" to print the Ruby and compiler version or,
compiler command itself for the debugging purpose. The task name is aligning
with the "debug" task that is to print the info in the Ruby OpenSSL binding for
the debugging purpose.

The compiler version info is useful when we hit the issues coming from the
newly updated compilers on the CI, and we find the cause.

The new task "debug_compiler" to print the Ruby and compiler version or,
compiler command itself for the debugging purpose. The task name is aligning
with the "debug" task that is to print the info in the Ruby OpenSSL binding for
the debugging purpose.

The compiler version info is useful when we hit the issues coming from the
newly updated compilers on the CI, and we find the cause.
@junaruga junaruga force-pushed the wip/print-compiler-version branch from 5954a15 to 8aee873 Compare May 31, 2023 17:08
@junaruga junaruga changed the title Add a Rake task to print the compiler version or the command itself. Print the Ruby and compiler info or the command itself before compiling. May 31, 2023
@junaruga
Copy link
Member Author

junaruga commented May 31, 2023

In the "windows-latest ucrt" case, the compiler x86_64-w64-mingw32-cc is used.
https://github.com/junaruga/openssl/actions/runs/5135566994/jobs/9241230184#step:6:139

In the "windows-latest mswin" case, the compiler cl -nologo is used.
https://github.com/junaruga/openssl/actions/runs/5135566994/jobs/9241230324#step:6:216

The latest commits for the Windows cases are by @MSP-Greg. do you know how to print the compiler version info by those compilers? And do you know the cl command official document link? I don't know what it is.

9c24dccf
0fb8d1b4

when 'gcc', 'clang'
sh "#{compiler} --version"
else
puts "Compiler: #{RbConfig::CONFIG['CC']}"
Copy link
Member Author

Choose a reason for hiding this comment

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

Note that I considered if this part should be Compiler: (the first letter is uppercase "C") or compiler: by checking how the items are printed in other cases below. It was a difficult choice. But I chose the Compiler:.

$ lscpu 
Architecture:            x86_64
  CPU op-mode(s):        32-bit, 64-bit
...
$ lsusb | head -3
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 0bda:0328 Realtek Semiconductor Corp. USB3.0-CRW
$ openssl version -a
OpenSSL 3.0.8 7 Feb 2023 (Library: OpenSSL 3.0.8 7 Feb 2023)
built on: Thu Feb  9 00:00:00 2023 UTC
platform: linux-x86_64
options:  bn(64,64)
compiler: gcc -fPIC -pthread -m64 -Wa,--noexecstack -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Wa,--noexecstack -Wa,--generate-missing-build-notes=yes -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -specs=/usr/lib/rpm/redhat/redhat-package-notes -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_BUILDING_OPENSSL -DZLIB -DNDEBUG -DPURIFY -DDEVRANDOM="\"/dev/urandom\"" -DSYSTEM_CIPHERS_FILE="/etc/crypto-policies/back-ends/openssl.config"
OPENSSLDIR: "/etc/pki/tls"
ENGINESDIR: "/usr/lib64/engines-3"
MODULESDIR: "/usr/lib64/ossl-modules"
Seeding source: os-specific
CPUINFO: OPENSSL_ia32cap=0x7ffaf3ffffebffff:0x29c67af
$ podman info | head -3
host:
  arch: amd64
  buildahVersion: 1.30.0

$ podman info | tail -3
  OsArch: linux/amd64
  Version: 4.5.0

@junaruga junaruga merged commit 01f06fd into ruby:master Jun 1, 2023
42 checks passed
@junaruga junaruga deleted the wip/print-compiler-version branch June 1, 2023 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant