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

builder: use ANSI .rsp file under Windows #22409

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

kbkpbot
Copy link
Contributor

@kbkpbot kbkpbot commented Oct 4, 2024

…nsi_not_null_terminated

As PR #22405 said, tcc will fail with non-ASCII filename under Windows 10.
So this PR try to make the .rsp file encoded in ANSI.
Also, builtin provide some new funcs help do the job UTF-8=>ANSI.

@kbkpbot
Copy link
Contributor Author

kbkpbot commented Oct 4, 2024

Some tests:

case 1. 测试.tmp.c.rsp encode in UTF-8

D:\v\v\v\thirdparty\tcc\tcc.exe @C:\Users\DDT\AppData\Local\Temp\v_0\测试.tmp.c.rsp
tcc: error: file 'C:\Users\DDT\AppData\Local\Temp\v_0\娴嬭瘯.tmp.c' not found

case 2. 测试.tmp.c.rsp encode in UTF-8-BOM

D:\v\v\v\thirdparty\tcc\tcc.exe @C:\Users\DDT\AppData\Local\Temp\v_0\测试.tmp.c.rsp
tcc: error: file '锘? not found

case 3. 测试.tmp.c.rsp encode in ANSI

D:\v\v\v\thirdparty\tcc\tcc.exe @C:\Users\DDT\AppData\Local\Temp\v_0\测试.tmp.c.rsp
C:/Users/DDT/AppData/Local/Temp/v_0/测试.tmp.c:526: warning: WINVER redefined
C:/Users/DDT/AppData/Local/Temp/v_0/测试.tmp.c:7009: warning: implicit declaration of function 'tcc_backtrace'
tcc: error: undefined symbol 'tcc_backtrace'

Copy link
Member

@spytheman spytheman left a comment

Choose a reason for hiding this comment

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

Excellent work.

unsafe { vmemcpy(str_to.data, s.str, s.len) }
return str_to
}
return []u8{} // TODO: remove this, bug?
Copy link
Member

Choose a reason for hiding this comment

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

just return [] should be enough (and removing lines 109-111)

Copy link
Member

Choose a reason for hiding this comment

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

(the cleanup can be done separately though - the CI has already passed a lot of the CI jobs, and I want to merge it ASAP)

@spytheman spytheman merged commit dc6a958 into vlang:master Oct 4, 2024
78 checks passed
@kbkpbot kbkpbot deleted the fix-windows-ansi-path-new branch October 4, 2024 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants