Project

General

Profile

Actions

Bug #21995

open

mkmf generates a non-deterministic log file

Bug #21995: mkmf generates a non-deterministic log file

Added by gemmaro (Gemma Kosaka) 26 days ago. Updated 1 day ago.

Status:
Assigned
Target version:
-
ruby -v:
ruby 4.1.0dev (2026-04-12T14:25:33Z master 6593cc52d6) +PRISM [x86_64-linux]
[ruby-core:125247]

Description

Hello,

When compiling Ruby's C extensions with mkmf, it can generate a mkmf.log file with non-deterministic content, especially at the line below:

ld: /tmp/rubytest.h8pay9/cc3fbuGm.o: in function `t':
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This can be problematic on some distributions/package-managers, since the mkmf.log file is included in the files generated by gem install.

example flow

background

To wrap up, I think the followings are desirable:

  • Conventional file locations should be kept as is on the RubyGems side.
    • Just deleting these files breaks compatibilities.
    • These might be helpful when users report issues to gem owners with detailed information.
  • It is helpful if generated file contents are as reproducible as possible.
    • In some contexts where reproducibility matters, this issue makes packaging Ruby gems a bit harder.
    • Luckily, workarounds are possible in distribution package recipes such as deleting these files.
  • -> the component that generates mkmf.log is mkmf, so it might be resolvable by modifying mkmf itself.

Thank you,
gemmaro.

Updated by gemmaro (Gemma Kosaka) 26 days ago Actions #1 [ruby-core:125248]

I created a pull request about this.

Updated by hsbt (Hiroshi SHIBATA) 1 day ago Actions #2 [ruby-core:125434]

  • Status changed from Open to Assigned
  • Assignee set to hsbt (Hiroshi SHIBATA)

I will look this.

Updated by gemmaro (Gemma Kosaka) 1 day ago Actions #3 [ruby-core:125435]

Thanks for the reply! I'm sorry -- this pull request #note-1 currently fails CI, and I'm still investigating why. It's not ready for review yet, so it would be appreciated if you could revisit when it is.

Updated by Hanmac (Hans Mackowiak) 1 day ago Actions #4 [ruby-core:125436]

i think the main question is:

Why is mkmf.log file is included in the files generated by gem install?

Shouldn't it be okay to skip these files?
Especially for distributions/package-managers?

Actions

Also available in: PDF Atom