-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Resources: Avoid assuming that deps have a sane name #8696
Conversation
### Description The prior fix assume that the dependencies through `.lib` references would have a "sane" name. My definition of "sane" here is that the reference will have a path that starts with the path to the `.lib` file and _removes_ the `.lib` suffix. The online compiler does not remove the `.lib` suffix. Instead, it keeps it. This makes the string replacement in the prior PR fail. Also, this is faster, and simpler. ### Pull request type [x] Fix [ ] Refactor [ ] Target update [ ] Functionality change [ ] Docs update [ ] Test update [ ] Breaking change
d95e3d4
to
6e63aca
Compare
tools/resources/__init__.py
Outdated
@@ -254,35 +254,15 @@ def add_file_ref(self, file_type, file_name, file_path): | |||
ref = FileRef(file_name.replace(sep, self._sep), file_path) | |||
else: | |||
ref = FileRef(file_name, file_path) | |||
self._file_refs[file_type].add(ref) | |||
if file_type: | |||
self._file_refs[file_type].add(ref) |
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.
Is there any purpose of constructing the FileRef
if file_type
is falsey? If not, you might consider moving the file_type
check to the top, so something like this (I also suggested a few other changes/refactors, feel free to ignore them if they don't make sense):
def add_file_ref(self, file_type, file_name, file_path):
if not file_type:
return
if sep != self._sep:
file_name = file_name.replace(sep, self._sep)
self._file_refs[file_type].add(FileRef(file_name, file_path))
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.
There is not. I'll update it in a bit.
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.
Looks ok!
fc84d7b
to
3db1a8a
Compare
Fixes #8716 |
/morph build |
Build : SUCCESSBuild number : 3613 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 3217 |
Test : SUCCESSBuild number : 3392 |
Description
The prior fix assume that the dependencies through
.lib
referenceswould have a "sane" name. My definition of "sane" here is that the
reference will have a path that starts with the path to the
.lib
fileand removes the
.lib
suffix. The online compiler does not remove the.lib
suffix. Instead, it keeps it. This makes the string replacementin the prior PR fail.
Also, this is faster, and simpler.
Pull request type