question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RFE: Allow to --set-installer for custom INSTALLER value

See original GitHub issue

What’s the problem this feature will solve?

In Fedora, we use pip to install wheels during the build of RPM packages. We then replace pip with rpm in the INSTALLER file to indicate: This package has been actually installed trough rpm on the user systems (despite it being installed by pip in the build system).

The hash of the INSTALLER file is recorded in RECORD. When we change the value, we should also recalculate the hash and adjust RECORD.

This is getting fragile. I’d rather tell pip to put arbitrary value to INSTALLER than sed it afterwards.

Describe the solution you’d like

We’d like to have --set-installer option (or --installer etc.) for pip install that we would use like this:

pip install --set-installer=rpm ...

It would put the value (rpm in the example) to INSTALLER instead of pip and would put the correct hash to RECORD.

Alternative Solutions

The alternate solution is what we use now + sed-ing the hash:

pip install ...
sed -i s/pip/rpm/ ...dist-info/INSTALLER
sed -iE 's|(\.dist-info/INSTALLER,sha256=)[^,]+,|\1'$(sha256sum ...dist-info/INSTALLER | cut -f1 -d" ")',|' ...dist-info/RECORD

Additional context

https://discuss.python.org/t/pep-610-usage-guidelines-for-linux-distributions/4012/17

I’m happy to submit a PR for this if agreed upon.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
pradyunsgcommented, Apr 28, 2020

I wonder if a better overall solution would be to write a simple, but lower level wheel installer.

That’s what I imagine https://github.com/pradyunsg/installer would become eventually.

See https://github.com/pradyunsg/installer/issues/1 for context.

1reaction
hroncokcommented, Apr 29, 2020

I’d still like this feature, but I have realized our RECORD file is a mess anyway, so I’ll dig deeper into what needs to be done on our side to prevent that.

  • packagers tent to remove files or add them for compatibility reasons
  • we automatically mangle some shebangs
  • we ship different levels of bytecode cache
  • possibly more

I plan to look closer and we might very well just need to recalculate all hashes, drop all hashes or make RECORD optional for packages managed by external tools. When we go that way, setting installer via sed will be sufficient for us.

Can we keep this open for couple weeks and I’ll get back with more info?

Read more comments on GitHub >

github_iconTop Results From Across the Web

[RFE] Allow installer to override num_pulp_workers on Capsules
Run the satellite-installer and have the post-installation reflect the custom overridden value provided. 7. Is there already an existing RFE upstream or in ......
Read more >
Issue #4048: [RFE] Add mechanism to allow custom LDAP settings ...
#4048 [RFE] Add mechanism to allow custom LDAP settings during initial ... Make the value big during install and then set it back...
Read more >
sklearn.feature_selection.RFE
First, the estimator is trained on the initial set of features and the importance of each feature is obtained either through any specific...
Read more >
Create a custom action which msiexec will ignore its' error code
open the MSI with Orca · go to CustomAction table and find your custom action · add the msidbCustomActionTypeContinue flag to the existing...
Read more >
Create a Custom Installer Package
1. Create project · 2. Enter product details · 3. Set install parameters · 4. Add files and folders to your project ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found