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

doom specific hacks should be removed from c2v #127

Open
trollkarlen opened this issue May 9, 2023 · 4 comments
Open

doom specific hacks should be removed from c2v #127

trollkarlen opened this issue May 9, 2023 · 4 comments
Labels
Enhancement New feature or request

Comments

@trollkarlen
Copy link
Contributor

Also Test files for ci should be maintained in this project and not in doom project(https://github.com/vlang/doom/blob/master/build_whole_project.sh)

@ArtemkaKun ArtemkaKun added the Enhancement New feature or request label May 9, 2023
@medvednikov
Copy link
Member

we run it everywhere

here (https://github.com/vlang/c2v/blob/master/.github/workflows/doom_gfx_regressions.yml), vlang/v, vlang/doom

all hacks will be unnecessary of course, it's just not there yet

@trollkarlen
Copy link
Contributor Author

So lets keep this to track when all special cases for doom removed from this repo.

@trollkarlen
Copy link
Contributor Author

Maybe not not all of "fixes" are bugs but its definitely not an enhancement.

@trollkarlen
Copy link
Contributor Author

Info about:

c2v/src/c2v.v

Line 2106 in 811a8b7

if path.contains('/src/') {

When it does the conversion if it finds '/src/' somewhere on the path it chdir to that location to i guess find a headerfile that in the wrong location. So if the path was relative from the start then the new relative path will be wrong.

Example:

v translate banana/src/test.c

it will fail because it will chdir to banana/src and then try to convert the file banana/src/test.c but that file does not exist.
But if you have the abs path it works even thou it chdir to banana/src because you started it with an absolute path.

Full test and example:

$ mkdir tests/src
$ cp -a tests/test.c tests/src/
$ v run . tests/src/test.c/1.hello.c
C to V translator 0.3.1
  translating tests/src/test.c/1.hello.c ... sh: line 1: tests/src/test.c/1.hello.json: No such file or directory

The file tests/src/test.c/1.hello.c could not be parsed as a C source file.
$ v run . $(pwd)/tests/src/test.c/1.hello.c
C to V translator 0.3.1
  translating $HOME/c2v/tests/src/test.c/1.hello.c ... Reformatted file: $HOME/c2v/tests/src/test.c/1.hello.v
 took    94 ms ; output .v file: test.c/1.hello.v
Translated   1 files in    94 ms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants