Giter VIP home page Giter VIP logo

Comments (4)

tomas-abrahamsson avatar tomas-abrahamsson commented on July 30, 2024

Hmm.. By default, gpb reads but ignores the package statement. When using gpb_compile:file/2, there is a use_packages option. This option does not exist from the command line (though it should). But even when using the use_packages option, it won't work, because of another bug. Sorry about this, packages is a feature not much used with gpb. I'm considering those bugs that need fixing.

from gpb.

tomas-abrahamsson avatar tomas-abrahamsson commented on July 30, 2024

Hi again, both issues should now be fixed in the 3.17.3 version pushed just a few minutes ago:

  • From the command line (with protoc-erl), you need to use the (new) -pkgs option for files like these, so the package name gets prepended.
  • The second issue with use_packages turned out to be rather easy to fix: the package name now gets applied/prepended on a per file basis. Previously, it by mistake got applied/prepended only after all imports had been processed and merged, which was all wrong, but has now been fixed.

from gpb.

yueyoum avatar yueyoum commented on July 30, 2024

great work! 👍

It works well with the git clone version.
But when I download the tar.gz file from releases https://github.com/tomas-abrahamsson/gpb/releases

then, tar zxf FILE && cd gpb-3.17.3 && make , an error occurred:

wang[10:47][/tmp/gpb-3.17.3]$ make
Generating include/gpb_version.hrl...
fatal: Not a git repository (or any of the parent directories): .git
erlc -Wall +debug_info -Iinclude -pa ebin -o ebin src/gpb_codegen.erl
erlc -Wall +debug_info -Iinclude -pa ebin -o ebin src/gpb_compile.erl
erlc -Wall +debug_info -Iinclude -pa ebin -o ebin src/gpb.erl
erlc -o src src/gpb_parse.yrl
erlc -Wall +debug_info -Iinclude -pa ebin -o ebin src/gpb_parse.erl
erlc -o src src/gpb_scan.xrl
erlc -Wall +debug_info -Iinclude -pa ebin -o ebin src/gpb_scan.erl
Proto-compiling the description definition...
{"init terminating in do_boot",{{invalid_version_format,[]},[{gpb,assert_version_format,1,[{file,"src/gpb.erl"},{line,97}]},{gpb,version_as_string,0,[{file,"src/gpb.erl"},{line,64}]},{gpb_compile,format_erl,4,[{file,"src/gpb_compile.erl"},{line,1306}]},{gpb_compile,do_proto_defs,4,[{file,"src/gpb_compile.erl"},{line,405}]},{gpb_compile,proto_defs,3,[{file,"src/gpb_compile.erl"},{line,375}]},{gpb_compile,'-c/2-lc$^0/1-0-',2,[{file,"src/gpb_compile.erl"},{line,707}]},{gpb_compile,c,2,[{file,"src/gpb_compile.erl"},{line,707}]},{init,start_it,1,[]},{init,start_em,1,[]}]}}

Crash dump was written to: erl_crash.dump
init terminating in do_boot ()
make: *** [descr_src/gpb_descriptor.erl] Error 1

I have located the reason:

include/gpb_version.hrl is generated by build/mk_version_hrl,
build/mk_version_hrl assume the current gpd directory is a git repo ,

So, the git clone version works well, but the downloaded version goes fail.

from gpb.

tomas-abrahamsson avatar tomas-abrahamsson commented on July 30, 2024

yes, it relies on the git tag for the version, an advantage with this is that there is always exactly one source for the version, the git tag, but a disadvantage is that when the files are taken out-of-context, with no git, like from the releases web page, then this does not work, so this is not supported at the moment.

from gpb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.