Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

[[ Library ]] Try extension when loading module #6669

Open
wants to merge 1 commit into
base: develop-9.0
Choose a base branch
from

Conversation

montegoulding
Copy link
Member

This patch moves the extension append and try code from MCU_library_load into
the CreateWithNativePath implementaton of each __MCSLibraryHandle to allow
binding strings to be cross platfor.

This patch moves the extension append and try code from `MCU_library_load` into
the `CreateWithNativePath` implementaton of each `__MCSLibraryHandle` to allow
binding strings to be cross platfor.
@runrevmark
Copy link
Contributor

runrevmark commented Aug 31, 2018

On consideration I'm not sure that this logic is correct for MCSLibrary - perhaps MCScript? The rationale here is that MCSLibrary really should allow you to bind to a specific library, this patch breaks that. In contrast, we can make what happens to library names part of the specification of binding strings in LCB.

@montegoulding
Copy link
Member Author

How does it break binding to any library?

@runrevmark runrevmark added the WIP label Aug 31, 2018
@montegoulding
Copy link
Member Author

As in if extension wrangling fails it should in all cases try the original string

@runrevmark
Copy link
Contributor

If you have a foo.framework and a foo in the same folder - you can't load foo.

@montegoulding
Copy link
Member Author

hmm.. well in that case you can use an explicit extension and it will work I think... I can make that wok if it doesn't right now... let me check

{
t_last_component_end -= strlen(t_framework_ext);
}
else if (p_has_extension)
{
return false;
Copy link
Member Author

Choose a reason for hiding this comment

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

@runrevmark if there is an explicit extension and it's not framework the we back out here

Copy link
Contributor

Choose a reason for hiding this comment

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

Right - but if there is no explicit extension and you have 'foo' and 'foo.framework', the framework codepath will trigger and you'll only ever bind to foo.framework - never foo.

Copy link
Contributor

@runrevmark runrevmark Aug 31, 2018

Choose a reason for hiding this comment

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

The order of trying things could be inverted, but then I'd get 'foo.framework' if 'foo' isn't there - which might not be what I want. (Again, this is only a concern because this is meant to be a thin wrapper around system functionality).

@livecodepanos livecodepanos modified the milestones: 9.0.2-rc-1, 9.0.3-rc-1 Nov 13, 2018
@livecodepanos livecodepanos modified the milestones: 9.0.3-rc-1, 9.0.4-rc-1 Mar 12, 2019
@runrevmark runrevmark removed this from the 9.0.4-rc-1 milestone Mar 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants