Author vstinner
Recipients vstinner
Date 2018-07-03.15:46:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Follow up of bpo-29708: OpenSUSE uses a downstream patch for distutils to fix distutils-reproducible-compile.patch. I converted the patch as a PR: PR 8057.

Naoki INADA wrote:
Currently, marshal uses refcnt to determine using w_ref or not. Some immutable objects (especially, long and str) can be cached and reused. It may affects refcnt when byte compiling.

I think we should use more deterministic way instead of refcnt. Maybe, count all constants in the module before marshal, like we did in compiling function for co_consts and co_names.
As a bonus, it may reduce resource usage too by merging constants over functions.
(e.g. ('self',) co_varnames and (None,) co_consts)

Serhiy Storchaka added:
I think we need to understand the issue better before committing changes. When found the source of unstability of file names, we can find other similar sources and make them stable too. For example if the source is listdir() or glob(), we can consider sorting results of all listdir() or glob() in distutils and related methods.

On other side, if the problem is with reference counters in marshal, we can change the marshal module instead.
Date User Action Args
2018-07-03 15:46:25vstinnersetrecipients: + vstinner
2018-07-03 15:46:25vstinnersetmessageid: <>
2018-07-03 15:46:25vstinnerlinkissue34033 messages
2018-07-03 15:46:25vstinnercreate