-
Notifications
You must be signed in to change notification settings - Fork 119
Exclude test DLL's from published package #191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
During a dependency review we noticed that the libloading crate includes various dll files used for testing. These shouldn't be there as building the crate itself doesn't require these files. As of now they prevent any downstream user from enabling the `[bans.build.executable option]` option of cargo deny. I opted for using an explicit include list instead of an exclude list to prevent these files from being included in the published packages to make sure that everything that's included is an conscious choice.
|
Thanks. On one hand this makes some sense, on the other hand this presents a problem that the crate is no longer self-sufficient for development anymore, which can matter in e.g. vendoring scenarios. Picking breadcrumbs it may now be possible to compile the relevant test files from rust (ref. rust_libloading/tests/windows.rs Lines 6 to 14 in dab97c5
|
|
I pushed 23f9e31 which introduces a new Now I do not have access to a windows machine for development so I "only" run tests via As a side note: I did not add anything about ordinals or def files as mentioned in the comment, but the test still worked. So maybe rustc already generates a for the test good result there? |
f1dbad9 to
d7015f7
Compare
|
There's already a test helpers that we could use here with all the relevant compilation on demand infrastructure present: https://github.com/nagisa/rust_libloading/blob/master/src/test_helpers.rs and rust_libloading/tests/functions.rs Lines 16 to 39 in dab97c5
While I wouldn't be surprised if ordinals get assigned by default nowadays, I'm not quite sure if the order of those ordinals is going to be defined. IMO we should still specify a .def file, but that should actually be quite straightforward with just a Could you try doing it this way and seeing if it works? |
f064430 to
ef09ec3
Compare
|
Should be ready now. CI also passed in the fork |
nagisa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is amazing, thank you!
windows_test_dll/Cargo.toml
Outdated
| @@ -0,0 +1,9 @@ | |||
| [package] | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is no longer necessary, right?
This commit replaces the prebuild bin dlls with using a dll build at test time.
ef09ec3 to
a208a9c
Compare
During a dependency review we noticed that the libloading crate includes various dll files used for testing. These shouldn't be there as building the crate itself doesn't require these files. As of now they prevent any downstream user from enabling the
[bans.build.executable option]option of cargo deny.I opted for using an explicit include list instead of an exclude list to prevent these files from being included in the published packages to make sure that everything that's included is an conscious choice.