Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upChange name when outputting staticlibs on Windows #29520
Conversation
rust-highfive
assigned
alexcrichton
Nov 2, 2015
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
I'm a little worried about this being a breaking change to existing tooling, for example this will break Cargo and presumably any existing scripts and such used on Windows today, such as some tests we have as well. I sympathize though in that the "best name" here is probably |
This comment has been minimized.
This comment has been minimized.
|
I'm not really sure what's a good way to handle the transition. Would Cargo have to first be modified to handle both cases? I could also change this PR so it only affects -msvc and not all of Windows, which wouldn't break all the people using msys and mingw. I'll look into fixing up the tests in the meantime though. |
This comment has been minimized.
This comment has been minimized.
|
Ideally on the Cargo side of things it would support both names to run with older and future compilers, but it would unfortunately still break all older Cargo instances working with newer compilers (which currently works today). I never really fully understood these naming conventions for MinGW/MSYS, there certainly seem to be a lot of |
This comment has been minimized.
This comment has been minimized.
|
With -msvc, when creating a dylib it'll produce a For -gnu, when creating dylibs, no import library is produced. This means that we have several choices, |
This comment has been minimized.
This comment has been minimized.
|
cc @vadimcn, @brson, curious on your thoughts here as well. I'm fine leaving |
This comment has been minimized.
This comment has been minimized.
|
My first reaction is that I don't like the direction this takes us in terms of increasing the rift between Would it be feasible to tweak names of the import libraries instead? |
This comment has been minimized.
This comment has been minimized.
|
It is possible to tweak the name of the import library that is created. I went with the |
This comment has been minimized.
This comment has been minimized.
|
What I don't like about |
This comment has been minimized.
This comment has been minimized.
|
Any transformation which applies to all platforms would just cause a significant amount of breakage. I'd prefer if this only affected Windows platforms to minimize that. |
This comment has been minimized.
This comment has been minimized.
Yeah, I am not really proposing doing that, but hypothetically that would be one way to fix the problem and keep all platforms consistent. Since implibs exist only on Windows, IMO it makes more sense to rename them, not normal libs. We should also consider changing the |
This comment has been minimized.
This comment has been minimized.
|
What naming convention do you propose for the import library? |
This comment has been minimized.
This comment has been minimized.
|
How about one of these?: |
This comment has been minimized.
This comment has been minimized.
|
Of those options, I feel least opposed to |
retep998
force-pushed the
retep998:staticlib-naming-fiasco
branch
from
6d59d98
to
6f28456
Dec 5, 2015
This comment has been minimized.
This comment has been minimized.
|
I've updated the PR to now make static libraries |
retep998
force-pushed the
retep998:staticlib-naming-fiasco
branch
from
6f28456
to
bb63b15
Dec 5, 2015
This comment has been minimized.
This comment has been minimized.
|
Okay, it seems to be working now. Feel free to bikeshed some more if you think this isn't the way to do it. |
retep998
force-pushed the
retep998:staticlib-naming-fiasco
branch
from
bb63b15
to
3e315d0
Dec 5, 2015
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
lgtm |
This comment has been minimized.
This comment has been minimized.
|
Now to fix all the tests that expect things to have a different name... |
This comment has been minimized.
This comment has been minimized.
|
Tagging this with T-tools to ensure this comes up during triage, I fear there are ramifications here that need to be handled beyond "just renaming artifacts" and I'd just want to make sure to get a few extra opinions. |
alexcrichton
added
the
T-tools
label
Dec 11, 2015
This comment has been minimized.
This comment has been minimized.
|
We talked about this in the tools triage meeting today and the conclusion was to move forward with this. @retep998 feel free to ping when the tests are passing. |
alexcrichton
removed
the
T-tools
label
Dec 16, 2015
retep998
force-pushed the
retep998:staticlib-naming-fiasco
branch
2 times, most recently
from
9d55090
to
1188ae0
Jan 14, 2016
This comment has been minimized.
This comment has been minimized.
|
I have tests passing for |
retep998
added some commits
Dec 5, 2015
retep998
force-pushed the
retep998:staticlib-naming-fiasco
branch
from
51f8131
to
1b0064e
Jan 16, 2016
This comment has been minimized.
This comment has been minimized.
|
@alexcrichton Tests are passing on both targets locally. I've rebased and squashed the commits nicely. r? |
alexcrichton
reviewed
Jan 19, 2016
|
|
||
| fn build_dylib(&mut self, out_filename: &Path) { | ||
| self.cmd.arg("/DLL"); | ||
| let mut arg: OsString = "/IMPLIB:".into(); |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
As I mentioned above as well I'm still worried that this patch will break Cargo, and after reviewing some of the related code I can confirm that it will indeed break Cargo on basically any MSVC build with a I think that we'll need to figure out how to mitigate that breakage before we land this patch to the compiler. |
retep998
added a commit
to retep998/cargo
that referenced
this pull request
Jan 20, 2016
retep998
referenced this pull request
Jan 20, 2016
Merged
Support static libraries with names other than libfoo.a #2299
bors
added a commit
to rust-lang/cargo
that referenced
this pull request
Jan 21, 2016
This comment has been minimized.
This comment has been minimized.
|
Ok, with rust-lang/cargo#2299 proposed I'll just want to hold off on merging this until after the release, then this should ride the trains normally into the stable release just fine. |


retep998 commentedNov 2, 2015
I'm not sure if this was the best way to go about it, but it seems to work.
Fixes #29508
r? @alexcrichton