This is an archive of the discontinued Mercurial Phabricator instance.

distutils_rust: teach distutils to look for windows libs
ClosedPublic

Authored by ikostia on Dec 5 2017, 7:10 AM.
Tags
None
Subscribers

Details

Summary

Make sure that we can build Rust extensions on Windows.

Test Plan
  • set USERUST=1
  • run FB build script, which invokes fb-hgext's setup.py
  • see it not failing

Diff Detail

Repository
rFBHGX Facebook Mercurial Extensions
Branch
default
Lint
Lint OK
Unit
Unit Test Errors

Event Timeline

ikostia created this revision.Dec 5 2017, 7:10 AM
Herald added a reviewer: Restricted Project. · View Herald TranscriptDec 5 2017, 7:10 AM
quark added a subscriber: quark.Dec 5 2017, 3:39 PM
quark added inline comments.
distutils_rust/__init__.py
78–82

This feels duplicated with line 87. Could you do something like:

if platform.startswith('win-'):
    name = '%s.dll' % ext.name
else if platform.startswith('macosx'):
    name = 'lib%s.dylib' % ext.name
else:
    name = 'lib%s.so' % ext.name

return os.path.join(..., name)
ikostia updated this revision to Diff 4126.Dec 5 2017, 3:57 PM

address Jun's comment

ikostia marked an inline comment as done.Dec 5 2017, 3:58 PM
quark accepted this revision.Dec 5 2017, 4:01 PM
This revision is now accepted and ready to land.Dec 5 2017, 4:01 PM
This revision was automatically updated to reflect the committed changes.