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

Revise FixPath build function #2459

Merged
merged 3 commits into from
Dec 31, 2021
Merged

Revise FixPath build function #2459

merged 3 commits into from
Dec 31, 2021

Conversation

mikee47
Copy link
Contributor

@mikee47 mikee47 commented Dec 30, 2021

Translates "" into "/" which is not only wrong but can do weird things in Windows.

Let's just check various path permutations to make sure they're handled correctly.
Test script:

define Check
$(info FixPath "$1": "$(call FixPath,$1)")
endef

$(call Check,)
$(call Check,C:\test)
$(call Check,test)
$(call Check,./test)
$(call Check,/c/test)
$(call Check,c:/test)
$(call Check,c:/path with spaces)

Run from Basic_Blink sample directory, we previously get this:

FixPath "": "/"
FixPath "C:\test": "/C/test"
FixPath "test": "/test"
FixPath "./test": "/./test"
FixPath "/c/test": "/c/test"
FixPath "c:/test": "/c/test"
FixPath "c:/path with spaces": "/c/path with spaces"

With this commit:

FixPath "": ""
FixPath "C:\test": "/C/test"
FixPath "test": "/s/sandboxes/sming-tmp/samples/Basic_Blink/test"
FixPath "./test": "/s/sandboxes/sming-tmp/samples/Basic_Blink/test"
FixPath "/c/test": "/c/test"
FixPath "c:/test": "/c/test"
FixPath "c:/path with spaces": "/c/path with spaces"

Translates "" into "/" which is not only wrong but can do weird things in Windows.

Let's just check various path permutations to make sure they're handled correctly.
Test script:

```
define Check
$(info FixPath "$1": "$(call FixPath,$1)")
endef

$(call Check,)
$(call Check,C:\test)
$(call Check,test)
$(call Check,./test)
$(call Check,/c/test)
$(call Check,c:/test)
```

Run from `Basic_Blink` sample directory, we previously get this:

```
FixPath "": "/"
FixPath "C:\test": "/C/test"
FixPath "test": "/test"
FixPath "./test": "/./test"
FixPath "/c/test": "/c/test"
FixPath "c:/test": "/c/test"
```

With this commit:

```
FixPath "": ""
FixPath "C:\test": "/C/test"
FixPath "test": "/s/sandboxes/sming-tmp/samples/Basic_Blink/test"
FixPath "./test": "/s/sandboxes/sming-tmp/samples/Basic_Blink/test"
FixPath "/c/test": "/c/test"
FixPath "c:/test": "/c/test"
```
```
Fetching submodule 'jerryscript' ...
rm: cannot lstat `jerryscript/jerry-core/api': Permission denied
rm: cannot lstat `jerryscript/jerry-core/debugger': Permission denied
rm: cannot lstat `jerryscript/jerry-core/ecma': Permission denied
fatal: cannot create directory at 'jerry-core/api': Permission denied
Unable to checkout 'd69ac0e070a97babb4b8e4c116db765f47c3eb02' in submodule path 'jerryscript'
```

This seems to be happening because jerryscript/jerryscript is already pulled in.
Cannot explain why the above failure occurs, but avoiding recursive clone means the offending
directories are not present and the fault disappears.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants