Comments (4)
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.
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.
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.
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)
- There are many deficiencies HOT 6
- Hitting `no case clause matching: :group_end` in Elixir app using Exprotobuf/gpb HOT 8
- Add preprocessor check around no_underspec? HOT 3
- Optional added back to proto3 HOT 3
- Outdated example HOT 3
- Unset `google.protobuf.StringValue` map values are decoded as empty strings instead of empty values HOT 3
- proposal for performance improvements HOT 9
- Performance improvement for encoding protos with unchanged data HOT 7
- -spec for enum generated code is incorrect HOT 3
- For gpb 5: Drop support for Erlang versions before 19
- How can i call gpb from my rebar.config? HOT 2
- [enhancement] support for gpb text format HOT 1
- I think the generated file is too big HOT 7
- -mapfields-as-maps and -json possible incompability HOT 2
- Trying to ecode a float into a uint64 field results in a badarith exception instead of gpb_type_error HOT 2
- Enums are not defined as macros HOT 7
- Fix for warning on float 0.0 HOT 5
- to_json encodes `uint64` as an integer instead of a string HOT 1
- Add a @generated tag HOT 1
- Excessive File Size in Generated Protobuf Files HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gpb.