Konstantin8105 / c4go

Transpiling C code to Go code
MIT License
365 stars 38 forks source link

README.md Installation section needs update #509

Closed texadactyl closed 6 months ago

texadactyl commented 6 months ago

Environment: go version go1.21.6 linux/amd64 Linux installation: Ubuntu 22.04.4 LTS C-compiler: 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)

Executing go get -u github.com/Konstantin8105/c4go:

go: downloading github.com/Konstantin8105/c4go v0.0.0-20230816131851-c5400a76df0f
go: downloading github.com/Konstantin8105/errors v0.1.0
go: downloading github.com/Konstantin8105/tree v0.1.1
go: added github.com/Konstantin8105/c4go v0.0.0-20230816131851-c5400a76df0f
go: added github.com/Konstantin8105/errors v0.1.0
go: added github.com/Konstantin8105/tree v0.1.1

(no errors reported)

But, cd $GOPATH/src/github.com/Konstantin8105/c4go references a non-existent directory and I cannot find a "Konstantin8105" directory anywhere under $GOPATH.

I found a directory called !konstantin8105/c4go@v0.0.0-20230816131851-c5400a76df0f under $GOPATH/pkg/mod/github.com/ whose contents is as follows:

dr-xr-xr-x  2 elkins elkins 16384 May  3 10:11 ast
-r--r--r--  1 elkins elkins   425 May  3 10:11 bind_test.go
-r--r--r--  1 elkins elkins  1517 May  3 10:11 cli_test.go
-r--r--r--  1 elkins elkins   313 May  3 10:11 codecov.yml
-r--r--r--  1 elkins elkins  8627 May  3 10:11 cstd_test.go
-r--r--r--  1 elkins elkins 16220 May  3 10:11 debug.go
dr-xr-xr-x  2 elkins elkins  4096 May  3 10:11 examples
-r--r--r--  1 elkins elkins   448 May  3 10:11 go.mod
-r--r--r--  1 elkins elkins  2056 May  3 10:11 go.sum
-r--r--r--  1 elkins elkins  1093 May  3 10:11 LICENSE
-r--r--r--  1 elkins elkins 19589 May  3 10:11 main.go
-r--r--r--  1 elkins elkins 26671 May  3 10:11 main_test.go
dr-xr-xr-x  2 elkins elkins  4096 May  3 10:11 noarch
-r--r--r--  1 elkins elkins 20001 May  3 10:11 other_test.go
dr-xr-xr-x  2 elkins elkins  4096 May  3 10:11 preprocessor
dr-xr-xr-x  2 elkins elkins  4096 May  3 10:11 program
-r--r--r--  1 elkins elkins 14865 May  3 10:11 README.md
dr-xr-xr-x  2 elkins elkins  4096 May  3 10:11 scripts
dr-xr-xr-x 10 elkins elkins  4096 May  3 10:11 tests
dr-xr-xr-x  2 elkins elkins  4096 May  3 10:11 transpiler
dr-xr-xr-x  2 elkins elkins  4096 May  3 10:11 types
-r--r--r--  1 elkins elkins  2265 May  3 10:11 unused.go
dr-xr-xr-x  2 elkins elkins  4096 May  3 10:11 util
dr-xr-xr-x  2 elkins elkins  4096 May  3 10:11 version

When positioned in that directory, go generate -v ./... executes for awhile and then incurs an error which is not obvious as to why:

bind_test.go
cli_test.go
cstd_test.go
debug.go
main.go
other_test.go
unused.go
ast/access_spec_decl.go
ast/access_spec_decl_test.go
ast/aligned_attr.go
ast/aligned_attr_test.go
ast/alloc_align_attr.go
ast/alloc_align_attr_test.go
ast/alloc_size_attr.go
ast/alloc_size_attr_test.go
ast/always_inline_attr.go
ast/always_inline_attr_test.go
ast/annotate_attr.go
ast/annotate_attr_test.go
ast/array_filler.go
ast/array_filler_test.go
ast/array_subscript_expr.go
ast/array_subscript_expr_test.go
ast/asm_label_attr.go
ast/asm_label_attr_test.go
ast/ast.go
ast/ast_test.go
ast/attributed_type.go
ast/attributed_type_test.go
ast/availability_attr.go
ast/availability_attr_test.go
ast/binary_conditional_operator.go
ast/binary_conditional_operator_test.go
ast/binary_operator.go
ast/binary_operator_test.go
ast/block_command_comment.go
ast/block_command_comment_test.go
ast/break_stmt.go
ast/break_stmt_test.go
ast/builtin_attr.go
ast/builtin_attr_test.go
ast/builtin_type.go
ast/builtin_type_test.go
ast/c11_no_return_attr.go
ast/c11_no_return_attr_test.go
ast/c4go_error_node.go
ast/c4go_error_node_test.go
ast/c_style_cast_expr.go
ast/c_style_cast_expr_test.go
ast/call_expr.go
ast/call_expr_test.go
ast/case_stmt.go
ast/case_stmt_test.go
ast/character_literal.go
ast/character_literal_test.go
ast/compound_assign_operator.go
ast/compound_assign_operator_test.go
ast/compound_literal_expr.go
ast/compound_literal_expr_test.go
ast/compound_stmt.go
ast/compound_stmt_test.go
ast/conditional_operator.go
ast/conditional_operator_test.go
ast/const_attr.go
ast/const_attr_test.go
ast/constant_array_type.go
ast/constant_array_type_test.go
ast/constant_expr.go
ast/constant_expr_test.go
ast/continue_stmt.go
ast/continue_stmt_test.go
ast/cxx_construct_expr.go
ast/cxx_construct_expr_test.go
ast/cxx_constructor_decl.go
ast/cxx_constructor_decl_test.go
ast/cxx_member_call_expr.go
ast/cxx_member_call_expr_test.go
ast/cxx_method_decl.go
ast/cxx_method_decl_test.go
ast/cxx_record.go
ast/cxx_record_decl.go
ast/cxx_record_decl_test.go
ast/cxx_record_test.go
ast/cxx_this_expr.go
ast/cxx_this_expr_test.go
ast/decayed_type.go
ast/decayed_type_test.go
ast/decl_ref_expr.go
ast/decl_ref_expr_test.go
ast/decl_stmt.go
ast/decl_stmt_test.go
ast/default_stmt.go
ast/default_stmt_test.go
ast/deprecated_attr.go
ast/deprecated_attr_test.go
ast/disable_tail_calls_attr.go
ast/disable_tail_calls_attr_test.go
ast/do_stmt.go
ast/do_stmt_test.go
ast/elaborated_type.go
ast/elaborated_type_test.go
ast/empty_decl.go
ast/empty_decl_test.go
ast/enable_if_attr.go
ast/enable_if_attr_test.go
ast/enum.go
ast/enum_constant_decl.go
ast/enum_constant_decl_test.go
ast/enum_decl.go
ast/enum_decl_test.go
ast/enum_test.go
ast/enum_type.go
ast/enum_type_test.go
ast/field.go
ast/field_decl.go
ast/field_decl_test.go
ast/field_test.go
ast/floating_literal.go
ast/floating_literal_test.go
ast/for_stmt.go
ast/for_stmt_test.go
ast/format_arg_attr.go
ast/format_arg_attr_test.go
ast/format_attr.go
ast/format_attr_test.go
ast/full_comment.go
ast/full_comment_test.go
ast/function_decl.go
ast/function_decl_test.go
ast/function_no_proto_type.go
ast/function_no_proto_type_test.go
ast/function_proto_type.go
ast/function_proto_type_test.go
ast/gcc_asm_stmt.go
ast/gcc_asm_stmt_test.go
ast/generic_selection_expr.go
ast/generic_selection_expr_test.go
ast/go_stmt.go
ast/go_stmt_test.go
ast/html_end_tag_comment.go
ast/html_end_tag_comment_test.go
ast/html_start_tag_comment.go
ast/html_start_tag_comment_test.go
ast/if_stmt.go
ast/if_stmt_test.go
ast/implicit_cast_expr.go
ast/implicit_cast_expr_test.go
ast/implicit_value_init_expr.go
ast/implicit_value_init_expr_test.go
ast/incomplete_array_type.go
ast/incomplete_array_type_test.go
ast/indirect_field_decl.go
ast/indirect_field_decl_test.go
ast/init_list_expr.go
ast/init_list_expr_test.go
ast/inline_command_comment.go
ast/inline_command_comment_test.go
ast/integer_literal.go
ast/integer_literal_test.go
ast/label_stmt.go
ast/label_stmt_test.go
ast/linkage_spec_decl.go
ast/linkage_spec_decl_test.go
ast/malloc_attr.go
ast/malloc_attr_test.go
ast/max_field_alignment_attr.go
ast/max_field_alignment_attr_test.go
ast/member_expr.go
ast/member_expr_test.go
ast/mode_attr.go
ast/mode_attr_test.go
ast/no_alias_attr.go
ast/no_alias_attr_test.go
ast/no_inline_attr.go
ast/no_inline_attr_test.go
ast/no_throw_attr.go
ast/no_throw_attr_test.go
ast/non_null_attr.go
ast/non_null_attr_test.go
ast/not_tail_called_attr.go
ast/not_tail_called_attr_test.go
ast/offset_of_expr.go
ast/offset_of_expr_test.go
ast/opaque_value_expr.go
ast/opaque_value_expr_test.go
ast/overloadable_attr.go
ast/overloadable_attr_test.go
ast/packed_attr.go
ast/packed_attr_test.go
ast/paragraph_comment.go
ast/paragraph_comment_test.go
ast/param_command_comment.go
ast/param_command_comment_test.go
ast/paren_expr.go
ast/paren_expr_test.go
ast/paren_type.go
ast/paren_type_test.go
ast/parm_var_decl.go
ast/parm_var_decl_test.go
ast/pointer_type.go
ast/pointer_type_test.go
ast/position.go
ast/position_test.go
ast/predefined_expr.go
ast/predefined_expr_test.go
ast/pure_attr.go
ast/pure_attr_test.go
ast/qual_type.go
ast/qual_type_test.go
ast/record.go
ast/record_decl.go
ast/record_decl_test.go
ast/record_test.go
ast/record_type.go
ast/record_type_test.go
ast/restrict_attr.go
ast/restrict_attr_test.go
ast/return_stmt.go
ast/return_stmt_test.go
ast/returns_twice_attr.go
ast/returns_twice_attr_test.go
ast/sentinel_attr.go
ast/sentinel_attr_test.go
ast/static_assert_decl.go
ast/static_assert_decl_test.go
ast/stmt_expr.go
ast/stmt_expr_test.go
ast/string_literal.go
ast/string_literal_test.go
ast/switch_stmt.go
ast/switch_stmt_test.go
ast/text_comment.go
ast/text_comment_test.go
ast/translation_unit_decl.go
ast/translation_unit_decl_test.go
ast/transparent_union_attr.go
ast/transparent_union_attr_test.go
ast/traverse.go
ast/typedef.go
ast/typedef_decl.go
ast/typedef_decl_test.go
ast/typedef_test.go
ast/typedef_type.go
ast/typedef_type_test.go
ast/unary_expr_or_type_trait_expr.go
ast/unary_expr_or_type_trait_expr_test.go
ast/unary_operator.go
ast/unary_operator_test.go
ast/unused_attr.go
ast/unused_attr_test.go
ast/used_attr.go
ast/used_attr_test.go
ast/util.go
ast/util_test.go
ast/va_arg_expr.go
ast/va_arg_expr_test.go
ast/var_decl.go
ast/var_decl_test.go
ast/verbatim_block_comment.go
ast/verbatim_block_comment_test.go
ast/verbatim_block_line_comment.go
ast/verbatim_block_line_comment_test.go
ast/verbatim_line_comment.go
ast/verbatim_line_comment_test.go
ast/visibility_attr.go
ast/visibility_attr_test.go
ast/warn_unused_result_attr.go
ast/warn_unused_result_attr_test.go
ast/weak_attr.go
ast/weak_attr_test.go
ast/while_stmt.go
ast/while_stmt_test.go
noarch/ctype.go
noarch/errno.go
noarch/fcntl.go
noarch/ioctl.go
noarch/locale.go
noarch/noarch.go
noarch/signal.go
noarch/stddef.go
noarch/stdio.go
noarch/stdlib.go
noarch/string.go
noarch/sys_resource.go
noarch/sys_time.go
noarch/termios.go
noarch/time.go
noarch/unistd.go
noarch/util.go
noarch/util_test.go
noarch/wchar.go
preprocessor/compiler.go
preprocessor/parse_comments_test.go
preprocessor/parse_include_list.go
preprocessor/parse_include_list_test.go
preprocessor/parse_include_preprocessor_line.go
preprocessor/parse_include_preprocessor_line_test.go
preprocessor/preprocessor.go
preprocessor/preprocessor_test.go
program/cstd.go
program/definition_function.go
program/definition_struct.go
program/definition_type.go
program/definition_variable.go
program/import.go
program/program.go
program/struct.go
program/warnings.go
tests/raylib/raygui.go
transpiler/binary.go
transpiler/bind.go
transpiler/branch.go
transpiler/call.go
transpiler/cast.go
transpiler/declarations.go
transpiler/enum.go
transpiler/functions.go
transpiler/goto.go
transpiler/literals.go
transpiler/literals_test.go
transpiler/offset.go
transpiler/operators.go
transpiler/scope.go
transpiler/switch.go
transpiler/translation_unit.go
transpiler/transpiler.go
transpiler/unary.go
transpiler/union.go
transpiler/util.go
transpiler/vaarg.go
transpiler/value_to_pointer.go
transpiler/variables.go
types/binary_operator.go
types/binary_operator_test.go
types/cast.go
types/cast_test.go
types/dereference.go
types/dereference_test.go
types/resolve.go
types/sizeof.go
types/resolve_test.go
types/sizeof_test.go
util/diff.go
util/diff_test.go
util/errors.go
util/errors_test.go
util/goast.go
util/goast_test.go
util/regexp.go
util/util.go
util/util_test.go
version/version.go
make_versionexit status 128
exit status 1

Attached is a zip of the version directory.

version.zip

Konstantin8105 commented 6 months ago

Please try go get github.com/Konstantin8105/c4go

texadactyl commented 6 months ago

Same result.

The following (or equivalent) belongs in the Install section of README.md:

Then, find where Konstantin8105/c4go is installed. On my machine, it was $HOME/go/pkg/mod/github.com/!konstantin8105/c4go@v0.0.0-20230816131851-c5400a76df0f/

Sorry, but it fails the same way as described above. If you think that I messed up, please enlighten me with better instructions than my guessing. Thanks.

I would dig into this but I am in the middle of group project and they need me this weekend.

Konstantin8105 commented 6 months ago
$ go get github.com/Konstantin8105/c4go
go: go.mod file not found in current directory or any parent directory.
    'go get' is no longer supported outside a module.

Please try:

git clone https://github.com/Konstantin8105/c4go.git

texadactyl commented 6 months ago

That is what the Installation section should say: git clone https://github.com/Konstantin8105/c4go.

So, here is the proposed replacement for the current Installation section:

Sample c4go version console output:

Build time: May  4 20:41:31 2024 UTC
Git hash:   "c5400a76df0f5157f234547bef3ae8fb7b692685"
Konstantin8105 commented 6 months ago

Do you want prepare the pull request with that information?

Konstantin8105 commented 6 months ago

Thank you for PR.

texadactyl commented 6 months ago

Пожалуйста