Git Product home page Git Product logo

protoc-gen-lua's People

Contributors

sean-lin avatar

Watchers

 avatar

protoc-gen-lua's Issues

--lua_out: protoc-gen-lua

What steps will reproduce the problem?
1. While trying to compile to produce Lua ouput using protoc.exe, getting the 
error - --lua_out: protoc-gen-lua, The system cannot find the file specified
2.
3.

What is the expected output? What do you see instead?
Expected output is to get the Lua files from proto file

What version of the product are you using? On what operating system?
Windows 7. protoc-2.5.0-win32

Please provide any additional information below.

Have set the path where protoc-gen-lua is located using setpath command

Original issue reported on code.google.com by [email protected] on 25 Jun 2014 at 6:14

Attachments:

Invalid reference to wire_format.ZigZagEncode in encoder.lua

The reference should probably be to wire_format.ZigZagEncode32 instead.

I got the following error before fixing this:

lua: /home/asgaut/protoc-gen-lua/protobuf/encoder.lua:98: attempt to call 
upvalue 'modify_value' (a nil value)
stack traceback:
    /home/asgaut/protoc-gen-lua/protobuf/encoder.lua:98: in function '_sizer'

Original issue reported on code.google.com by [email protected] on 24 Aug 2012 at 1:53

Skipping unknown field bug

What steps will reproduce the problem?
1. Create proto file 
2. Pack any message 
3. Remove field from proto file
4. Unpack message

What is the expected output? What do you see instead?

*19 lua entry thread aborted: runtime error: ...decoder.lua:295: Truncated 
message.

Patch:

--- a/decoder.lua   2013-06-06 14:26:28.065925711 +0400
+++ b/decoder.lua   2013-06-06 14:28:47.493925698 +0400
@@ -277,6 +277,9 @@
 end

 function _SkipVarint(buffer, pos, pend)
+  local value
+  value, pos = _DecodeVarint(buffer, pos)
+  return pos
 end

 function _SkipFixed64(buffer, pos, pend)
@@ -326,7 +329,7 @@
     local sub = string.sub

     return function (buffer, pos, pend, tag_bytes)
-        local wire_type = ord(sub(buffer, 1, 1)) % 8 + 1
+        local wire_type = ord(sub(tag_bytes, 1, 1)) % 8 + 1
         return WIRETYPE_TO_SKIPPER[wire_type](buffer, pos, pend)
     end
 end

Original issue reported on code.google.com by [email protected] on 6 Jun 2013 at 10:33

Attachments:

Bool datatype giving error

What steps will reproduce the problem?
set the value for a field of a protobuf message which is of data type bool.

What is the expected output? What do you see instead?
setting the value

What version of the product are you using? On what operating system?
Ubuntu 10.04

Please provide any additional information below.

lua: ...lua-protobuf-master/madhu/protobuf/type_checkers.lua:30: bad argument 
#2 to 'format' (string expected, got boolean)
stack traceback:
    [C]: in function 'format'
    ...lua-protobuf-master/madhu/protobuf/type_checkers.lua:30: in function 'type_checker'
    ...oads/lua-protobuf-master/madhu/protobuf/protobuf.lua:389: in function 's'
    ...oads/lua-protobuf-master/madhu/protobuf/protobuf.lua:861: in function <...oads/lua-protobuf-master/madhu/protobuf/protobuf.lua:858>
    test.lua:14: in main chunk
    [C]: ?



Original issue reported on code.google.com by [email protected] on 5 Aug 2013 at 11:02

Can't construct nested messages

Trying to assign values for nested message gives the " Assignment not allowed 
to repeated field "XXX" in protocol message object." is it not supported by the 
library yet or is there an api to assign nested message?

Original issue reported on code.google.com by dolzenko on 2 Apr 2012 at 4:50

  • Merged into: #11

Optional fields causing truncated message

What steps will reproduce the problem?
1. compile following proto file

message A_msg {
      required double price                    = 1;   
      required string id                       = 2;   
      required string cookie                   = 3;   
      required string sym                      = 4;   
      required string side                     = 5;   
}

message B_msg {
        required int32 b = 1;

}

message C_msg {
        required int32 c = 1;

}

message D_msg {
        required string name = 1;
        required string date = 2;
        required double value = 3;
}


message Msg {
        enum Type
        {
                A   = 1;
                B   = 2;
                C   = 3;
                D   = 4;
        }
        required Type         type  = 1;
        optional A_msg        a   = 2;
        optional B_msg        b   = 3;
        optional C_msg        c   = 4;
        optional D_msg        d   = 5;
}



2.

package.path = package.path .. ';../protobuf/?.lua'
package.cpath = package.cpath .. ';../protobuf/?.so'

require 'test_sub_pb'


local msg = test_sub_pb.Msg()
msg.type=test_sub_pb.Msg.A
msg.a.price = 100.2
msg.a.id    =  "dasdas"
msg.a.cookie = "rara"
msg.a.sym    = "test"
msg.a.side   = "s"


print(msg)
local data = msg:SerializeToString()
local m = test_sub_pb.Msg()
m:ParseFromString(data)
print(m)


3.

Fails on ParseFromString with following errors:

/tools/luajit/current/bin/luajit: ../protobuf/decoder.lua:180: Truncated string.
stack traceback:
        [C]: in function 'error'
        ../protobuf/decoder.lua:180: in function 'field_decoder'
        ../protobuf/protobuf.lua:684: in function '_InternalParse'
        ../protobuf/decoder.lua:272: in function 'field_decoder'
        ../protobuf/protobuf.lua:684: in function '_internal_parse'
        ../protobuf/protobuf.lua:693: in function 'merge_from_string'
        ../protobuf/protobuf.lua:702: in function 'ParseFromString'
        ntest.lua:23: in main chunk
        [C]: ?


What is the expected output? What do you see instead?
Expected output is correctly generated pb message

What version of the product are you using? On what operating system?
latest version, recent ubuntu


Please provide any additional information below.

Using float as the type does not fail but gives back junk as the value

a {
    sym: test
    price: 100.2
    id: dasdas
    side: s
    cookie: rara
}
type: 1

a {
    sym: test
    price: 1.4075776992926e+161
    id: dasdas
    side: s
    cookie: rara
}
type: 1



Original issue reported on code.google.com by [email protected] on 21 Nov 2011 at 7:52

SerializingToString with a buffer containing repeated string or message fields results in a truncated string - ParseFromString on the resulting string gives an error

What steps will reproduce the problem?

1. Create proto file

  message test {
  repeated int32 v = 1;
  repeated string x = 2;
}

2. protoc --lua_out ./ test.proto

3.

>pb=require("test_pb")
>test=pb.test()
>test.v:append(1)
>test.v:append(2)
> test.x:append("test1")
> test.x:append("test2")
> print(test)
v: 1
v: 2
x: test1
x: test2

> str=test:SerializeToString()
> new=pb.test()
> new:ParseFromString(str)
/home/3ps/protoc-gen-lua/protobuf/protobuf.lua:677: bad argument #2 to 
'ReadTag' (number expected, got nil)
stack traceback:
        [C]: in function 'ReadTag'
        /home/3ps/protoc-gen-lua/protobuf/protobuf.lua:677: in function '_internal_parse'
        /home/3ps/protoc-gen-lua/protobuf/protobuf.lua:695: in function 'merge_from_string'
        /home/3ps/protoc-gen-lua/protobuf/protobuf.lua:704: in function 'ParseFromString'
        stdin:1: in main chunk
        [C]: ?
>

What is the expected output? What do you see instead?

Expected output is original pbuffer message as a result of parsing the 
generated string

What version of the product are you using? On what operating system?

Using latest version on Linux

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 22 Jul 2011 at 5:02

error loading module 'pb'

What steps will reproduce the problem?
1.Executing test.lua


What is the expected output? What do you see instead?
Getting error while executing test.lua
Error : lua: ../protobuf/protobuf.lua:31: loop or previous error loading module 
'pb'
stack traceback:
    [C]: in function 'require'
    ../protobuf/protobuf.lua:31: in main chunk
    [C]: in function 'require'
    ../protobuf/protobuf.lua:31: in main chunk
    [C]: in function 'require'
    ./person_pb.lua:2: in main chunk
    [C]: in function 'require'
    test.lua:4: in main chunk
    [C]: ?

In protobuf.lua line 31, require "pb", is expecting a file pb.lua which is not 
there in the path.

What version of the product are you using? On what operating system?
cc8301b6a06b, Linux (Ubuntu 10.04)

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 29 Jul 2013 at 6:25

protobuf error while parsing data string

 Reported by [email protected], Today (6 minutes ago)

[email protected] - Tom Light
==============

What steps will reproduce the problem?
1. Create the lua protobuf files with 
https://developers.google.com/ad-exchange/rtb/downloads/realtime-bidding-proto.t
xt
2. run the following program on an protobuf data string
realtime = require 'realtime_bidding_pb'
bid_req = realtime.BidRequest()
bid_req:ParseFromString(content)


What is the expected output? What do you see instead?
The expected output is: an object parsed
The current output is: 
lua: ./decoder.lua:319: Truncated message.
stack traceback:
    [C]: in function 'error'
    ./decoder.lua:319: in function <./decoder.lua:314>
    (tail call): ?
    ./protobuf.lua:694: in function '_InternalParse'
    ./decoder.lua:273: in function 'field_decoder'
    ./protobuf.lua:701: in function '_internal_parse'
    ./protobuf.lua:710: in function 'merge_from_string'
    ./protobuf.lua:719: in function 'ParseFromString'
    a.lua:32: in main chunk
    [C]: ?


What version of the product are you using? On what operating system?
Linux CentOS
Lua 5.1.4
latest protobuf-net clone

Thanks for the help



Original issue reported on code.google.com by [email protected] on 23 Jun 2013 at 11:25

  • Merged into: #7

Attachments:

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.