Skip to content
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

Inhibit aggressive resource file name mangling. #884

Merged
merged 3 commits into from
Aug 29, 2018

Conversation

ucbjrl
Copy link
Contributor

@ucbjrl ucbjrl commented Aug 28, 2018

Related issue: #883.

Type of change: bug report

Impact: API modification
Although this should have minimal impact on existing code, it is observable.

Development Phase: implementation

Release Notes
Minimize the name mangling of output resource files.

@ucbjrl ucbjrl requested review from ducky64 and colinschmidt August 28, 2018 17:14
@ucbjrl ucbjrl added release issue Bugfix Fixes a bug, will be included in release notes labels Aug 28, 2018
@ucbjrl ucbjrl added this to the 3.1.3 milestone Aug 28, 2018
@ucbjrl ucbjrl requested a review from edwardcwang August 28, 2018 17:31
Copy link
Contributor

@edwardcwang edwardcwang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

val additionalVFiles = additionalVResources.map((name: String) => {
val mangledResourceName = name.replace("/", "_")
// Don't convert a leading '/' to an '_'. Just skip the leading '/'.
val nameWithoutLeadingSlash = if (name(0) == '/') name.substring(1) else name
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a big deal but you could just use name.stripPrefix("/")

@ucbjrl
Copy link
Contributor Author

ucbjrl commented Aug 28, 2018

To ensure that we use the same file names for explicitly included resources and those discovered by the BlackBoxSourceHelper, I'm updating this to use a common method. This PR will then depend on chipsalliance/firrtl#882 and shouldn't be merged until that FIRRTL PR is merged.

@ucbjrl
Copy link
Contributor Author

ucbjrl commented Aug 29, 2018

retest this please

@ucbjrl ucbjrl merged commit 7da0d5f into master Aug 29, 2018
@ucbjrl ucbjrl modified the milestones: 3.1.3, 3.2.0 Sep 7, 2018
@ucbjrl ucbjrl deleted the reduceresourcenamemangling branch November 1, 2018 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bugfix Fixes a bug, will be included in release notes release issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants