Uh oh!
There was an error while loading. Please reload this page.
gh-78274: Produce consistent output from marshal.dumps(). - #28379
gh-78274: Produce consistent output from marshal.dumps().#28379ericsnowcurrently wants to merge 8 commits into
Conversation
ericsnowcurrently
commented
Sep 16, 2021
@gvanrossum, is something like this what you had in mind? |
gvanrossum
left a comment
There was a problem hiding this comment.
Probably, but I'm probably not going to be able to review it before Monday.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
126d491 to
8f9ba8dCompare| Indicates the data format that dumps should use. | ||
| / | ||
| * | ||
| stable: bool = True |
There was a problem hiding this comment.
It would probably make sense to default to False for now, so users would effectively opt-in to the performance penalty. (The same goes for marshal.dump().)
As I noted in [bpo-34093](https://bugs.python.org/issue34093#msg402244), we could take a different approach to get the same stable output without having to call |
ericsnowcurrently
commented
Sep 20, 2021
This PR should probably also add a flag to determine if the import machinery would use |
This PR is stale because it has been open for 30 days with no activity. |
gvanrossum
commented
Oct 21, 2021
via email
Maybe just close this? We no longer require marshal output to be stable for
the freezing project, because we don't commit the files to git any more. |
methane
commented
Oct 21, 2021
We need to this to support "reproducible build" in downstream. |
iritkatriel
left a comment
There was a problem hiding this comment.
This has merge conflicts now.
bedevere-bot
commented
Nov 25, 2022
When you're done making the requested changes, leave the comment: |
encukou
commented
Mar 26, 2024
Closing; see discussion in the issue. |
The result on debug vs. non-debug builds were slightly different. This PR fixes that by making an additional pass over the object to ensure "refs" are used more than once. Consequently,
marshal.dumps()is substantially slower. To mitigate this, I've added to it a keyword-only arg, "stable", to allow folks to opt out.FYI, I discovered gh-8293 after the fact, which turns out to have a lot of similarities to this PR.