root icon indicating copy to clipboard operation
root copied to clipboard

TFile::k630forwardCompatibility does not apply to new files correctly

Open wdconinc opened this issue 1 year ago • 1 comments

Check duplicate issues.

  • [X] Checked for duplicates

Description

When setting TFile.v630forwardCompatibility to true in /etc/root/system.rootrc, there is still confusing behavior and new files can be written without compability. In particular, new files are not opened in compatibility mode (largely limiting the usefulness of the configuration flag).

Reproducer

gEnv->GetValue("TFile.v630forwardCompatibility", 0)

TFile file1 = TFile("file1.root","CREATE")
file1.TestBit(TFile::k630forwardCompatibility)
file1.Close()

TFile file2 = TFile("file1.root","READ")
file2.TestBit(TFile::k630forwardCompatibility)
file2.Close()

TFile* file3 = TFile::Open("file3.root","CREATE")
file3->TestBit(TFile::k630forwardCompatibility)
file3->Close()

TFile* file4 = TFile::Open("file3.root","READ")
file4->TestBit(TFile::k630forwardCompatibility)
file4->Close()

produces

$ root -l 
root [0] gEnv->GetValue("TFile.v630forwardCompatibility", 0)
(int) 1
root [1] 
root [1] TFile file1 = TFile("file1.root","CREATE")
(TFile &) Name: file1.root Title: 
root [2] file1.TestBit(TFile::k630forwardCompatibility)
(bool) false
root [3] file1.Close()
root [4] 
root [4] TFile file2 = TFile("file1.root","READ")
(TFile &) Name: file1.root Title: 
root [5] file2.TestBit(TFile::k630forwardCompatibility)
(bool) true
root [6] file2.Close()
root [7] 
root [7] TFile* file3 = TFile::Open("file3.root","CREATE")
(TFile *) 0x5650bd7edba0
root [8] file3->TestBit(TFile::k630forwardCompatibility)
(bool) false
root [9] file3->Close()
root [10] 
root [10] TFile* file4 = TFile::Open("file3.root","READ")
(TFile *) 0x5650bd584570
root [11] file4->TestBit(TFile::k630forwardCompatibility)
(bool) true
root [12] file4->Close()

ROOT version

   ------------------------------------------------------------------
  | Welcome to ROOT 6.30/02                        https://root.cern |
  | (c) 1995-2023, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for linuxx8664gcc on Aug 02 2024, 15:34:40                 |
  | From heads/master@tags/v6-30-02                                  |
  | With g++ (Debian 12.2.0-14) 12.2.0                               |
  | Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q'  |
   ------------------------------------------------------------------

Installation method

Spack

Operating system

Linux, debian

Additional context

Ref. #15006 .

wdconinc avatar Aug 07 '24 20:08 wdconinc

This issue came up again today in some analysis incompatibility in the EIC context. Has someone been able to reproduce this?

wdconinc avatar Oct 14 '24 23:10 wdconinc

Related forum post: https://root-forum.cern.ch/t/the-rootrc-key-tfile-v630forwardcompatibility-does-not-work-correctly/61636/3?u=ferhue

ferdymercury avatar Jan 17 '25 08:01 ferdymercury