[jira] [Commented] (THRIFT-4662) Rust const string calls function at compile time

2018-11-09 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/THRIFT-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16682130#comment-16682130
 ] 

ASF GitHub Bot commented on THRIFT-4662:


jake-ruyi commented on a change in pull request #1624: THRIFT-4662: Rust const 
string calls function at compile time
URL: https://github.com/apache/thrift/pull/1624#discussion_r232434691
 
 

 ##
 File path: compiler/cpp/src/thrift/generate/t_rs_generator.cc
 ##
 @@ -673,15 +676,22 @@ void t_rs_generator::render_const_value_holder(const 
string& name, t_type* ttype
   f_gen_ << endl;
 }
 
-void t_rs_generator::render_const_value(t_type* ttype, t_const_value* tvalue) {
+void t_rs_generator::render_const_value(t_type* ttype, t_const_value* tvalue, 
bool isowned) {
   if (ttype->is_base_type()) {
 t_base_type* tbase_type = (t_base_type*)ttype;
 switch (tbase_type->get_base()) {
 case t_base_type::TYPE_STRING:
   if (tbase_type->is_binary()) {
-f_gen_ << "\"" << tvalue->get_string() << "\""<<  
".to_owned().into_bytes()";
+if (isowned) {
 
 Review comment:
   My goals were:
   1. Make `const binary` compile
   2. Preserve existing behavior
   
   Presently, neither `const string` nor `const binary` compiles. I'm more 
interested in getting our stuff compiling than addressing the semantics of 
`binary`. Should I revert the binary portion?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Rust const string calls function at compile time
> 
>
> Key: THRIFT-4662
> URL: https://issues.apache.org/jira/browse/THRIFT-4662
> Project: Thrift
>  Issue Type: Bug
>  Components: Rust - Compiler
>Affects Versions: 0.11.0
> Environment: C:\Users\jake>rustup show
> Default host: x86_64-pc-windows-msvc
> stable-x86_64-pc-windows-msvc (default)
> rustc 1.30.0 (da5f414c2 2018-10-24)
>Reporter: J W
>Assignee: Allen George
>Priority: Major
>
> *For this thrift:*
> const string broker_playback_message = "mmi.developer.playback"
> *Generates:*
> // thrift -gen rs -out ../rust/thrift/src const_string.thrift
> pub const BROKER_PLAYBACK_MESSAGE: String = 
> "mmi.developer.playback".to_owned();
> *Fails to compile:*
> error[E0015]: calls in constants are limited to tuple structs and tuple 
> variants
> note: a limited form of compile-time function evaluation is available on a 
> nightly compiler via `const fn`
> *Fix:*
> Probably want to output:
> pub const BROKER_PLAYBACK_MESSAGE: &str = "mmi.developer.playback";
>  
> Looking at render_const_value() it looks like byte arrays will have the same 
> issue.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Resolved] (THRIFT-4661) Rust enum name wrong case in generated structs

2018-11-09 Thread James E. King III (JIRA)


 [ 
https://issues.apache.org/jira/browse/THRIFT-4661?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James E. King III resolved THRIFT-4661.
---
   Resolution: Fixed
Fix Version/s: 1.0

> Rust enum name wrong case in generated structs
> --
>
> Key: THRIFT-4661
> URL: https://issues.apache.org/jira/browse/THRIFT-4661
> Project: Thrift
>  Issue Type: Bug
>  Components: Rust - Compiler
>Affects Versions: 0.11.0
> Environment: C:\Users\jake>rustup show
> Default host: x86_64-pc-windows-msvc
> stable-x86_64-pc-windows-msvc (default)
> rustc 1.30.0 (da5f414c2 2018-10-24)
>Reporter: J W
>Assignee: Allen George
>Priority: Major
> Fix For: 1.0
>
>
> *For this thrift (note lowercase "e" at beginning of enum name):*
> enum ePlatform
> { None = 0 }
> struct SettingItem
> { 1: ePlatform platform }
> *Generated with:*
> thrift -gen rs -out ../rust/thrift/src enum_lowercase_prefix.thrift
> *Generated Rust fails to compile:*
> error[E0412]: cannot find type `ePlatform` in this scope
>  --> src\enum_lowercase_prefix.rs:71:24
>  
> 71 | pub platform: Option,
> |^ did you mean `EPlatform`?|
>  
> *In t_rs_generator.cc line 3025:*
> return rust_namespace(ttype) + ttype->get_name();
> *To match behavior in generate_enum(), probably needs to be:*
> return rust_namespace(ttype) + rust_camel_case(ttype->get_name());



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (THRIFT-4661) Rust enum name wrong case in generated structs

2018-11-09 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/THRIFT-4661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16682038#comment-16682038
 ] 

ASF GitHub Bot commented on THRIFT-4661:


jeking3 closed pull request #1623: THRIFT-4661: Rust enum name wrong case in 
generated structs
URL: https://github.com/apache/thrift/pull/1623
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/compiler/cpp/src/thrift/generate/t_rs_generator.cc 
b/compiler/cpp/src/thrift/generate/t_rs_generator.cc
index dc11fd3ee2..5cd67f6755 100644
--- a/compiler/cpp/src/thrift/generate/t_rs_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_rs_generator.cc
@@ -3022,7 +3022,7 @@ string t_rs_generator::to_rust_type(t_type* ttype, bool 
ordered_float) {
 rust_type =  ttypedef->is_forward_typedef() ? "Box<" + rust_type + ">" : 
rust_type;
 return rust_type;
   } else if (ttype->is_enum()) {
-return rust_namespace(ttype) + ttype->get_name();
+return rust_namespace(ttype) + rust_camel_case(ttype->get_name());
   } else if (ttype->is_struct() || ttype->is_xception()) {
 return rust_namespace(ttype) + rust_camel_case(ttype->get_name());
   } else if (ttype->is_map()) {
diff --git a/lib/rs/test/src/bin/kitchen_sink_server.rs 
b/lib/rs/test/src/bin/kitchen_sink_server.rs
index 15ceb29dc4..ae7026288c 100644
--- a/lib/rs/test/src/bin/kitchen_sink_server.rs
+++ b/lib/rs/test/src/bin/kitchen_sink_server.rs
@@ -22,7 +22,7 @@ extern crate kitchen_sink;
 extern crate thrift;
 
 use kitchen_sink::base_one::Noodle;
-use kitchen_sink::base_two::{Napkin, NapkinServiceSyncHandler, Ramen, 
RamenServiceSyncHandler};
+use kitchen_sink::base_two::{BrothType, Napkin, NapkinServiceSyncHandler, 
Ramen, RamenServiceSyncHandler};
 use kitchen_sink::midlayer::{Dessert, Meal, MealServiceSyncHandler, 
MealServiceSyncProcessor};
 use kitchen_sink::recursive;
 use kitchen_sink::ultimate::{Drink, FullMeal, FullMealAndDrinks,
@@ -252,7 +252,7 @@ fn noodle() -> Noodle {
 }
 
 fn ramen() -> Ramen {
-Ramen::new("Mr Ramen".to_owned(), 72)
+Ramen::new("Mr Ramen".to_owned(), 72, BrothType::MISO)
 }
 
 fn napkin() -> Napkin {
diff --git a/lib/rs/test/thrifts/Base_Two.thrift 
b/lib/rs/test/thrifts/Base_Two.thrift
index b4b4ea1a5f..caa6acb86b 100644
--- a/lib/rs/test/thrifts/Base_Two.thrift
+++ b/lib/rs/test/thrifts/Base_Two.thrift
@@ -23,9 +23,15 @@
 
 const i32 WaterWeight = 200
 
+enum brothType {
+  Miso,
+  shouyu,
+}
+
 struct Ramen {
   1: optional string ramenType
   2: required i32 noodleCount
+  3: brothType broth
 }
 
 struct Napkin {


 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Rust enum name wrong case in generated structs
> --
>
> Key: THRIFT-4661
> URL: https://issues.apache.org/jira/browse/THRIFT-4661
> Project: Thrift
>  Issue Type: Bug
>  Components: Rust - Compiler
>Affects Versions: 0.11.0
> Environment: C:\Users\jake>rustup show
> Default host: x86_64-pc-windows-msvc
> stable-x86_64-pc-windows-msvc (default)
> rustc 1.30.0 (da5f414c2 2018-10-24)
>Reporter: J W
>Assignee: Allen George
>Priority: Major
> Fix For: 1.0
>
>
> *For this thrift (note lowercase "e" at beginning of enum name):*
> enum ePlatform
> { None = 0 }
> struct SettingItem
> { 1: ePlatform platform }
> *Generated with:*
> thrift -gen rs -out ../rust/thrift/src enum_lowercase_prefix.thrift
> *Generated Rust fails to compile:*
> error[E0412]: cannot find type `ePlatform` in this scope
>  --> src\enum_lowercase_prefix.rs:71:24
>  
> 71 | pub platform: Option,
> |^ did you mean `EPlatform`?|
>  
> *In t_rs_generator.cc line 3025:*
> return rust_namespace(ttype) + ttype->get_name();
> *To match behavior in generate_enum(), probably needs to be:*
> return rust_namespace(ttype) + rust_camel_case(ttype->get_name());



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (THRIFT-4656) infinite loop in latest PHP library

2018-11-09 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/THRIFT-4656?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16681661#comment-16681661
 ] 

ASF GitHub Bot commented on THRIFT-4656:


jeking3 commented on issue #1618: THRIFT-4656: Fix infinite loop in PHP 
TCurlClient
URL: https://github.com/apache/thrift/pull/1618#issuecomment-437410921
 
 
   I'm still concerned about how oneway requests are handled with HTTP 
transport.  It would be a HTTP/1.1 200 OK response without any payload...


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> infinite loop in latest PHP library
> ---
>
> Key: THRIFT-4656
> URL: https://issues.apache.org/jira/browse/THRIFT-4656
> Project: Thrift
>  Issue Type: Bug
>  Components: PHP - Library
>Reporter: Josip Sokcevic
>Priority: Major
> Fix For: 0.12.0
>
> Attachments: 
> 0001-THRIFT-4656-Fix-infinite-loop-in-PHP-TCurlClient.patch
>
>
> The latest PHP library can enter into infinite loop state when specific 
> payload is returned:
> HTTP status: 200
> Response body: 
>  
> It was introduced with THRIFT-4645, where check was replaced from
> {code:java}
> !$this->response_{code}
> to
> {code:java}
> $this->response_ === false{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (THRIFT-4661) Rust enum name wrong case in generated structs

2018-11-09 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/THRIFT-4661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16681652#comment-16681652
 ] 

ASF GitHub Bot commented on THRIFT-4661:


allengeorge commented on issue #1623: THRIFT-4661: Rust enum name wrong case in 
generated structs
URL: https://github.com/apache/thrift/pull/1623#issuecomment-437408771
 
 
   @jeking3 I can approve (just did), but I don't have write access to the 
repo, so I can't actually merge PRs.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Rust enum name wrong case in generated structs
> --
>
> Key: THRIFT-4661
> URL: https://issues.apache.org/jira/browse/THRIFT-4661
> Project: Thrift
>  Issue Type: Bug
>  Components: Rust - Compiler
>Affects Versions: 0.11.0
> Environment: C:\Users\jake>rustup show
> Default host: x86_64-pc-windows-msvc
> stable-x86_64-pc-windows-msvc (default)
> rustc 1.30.0 (da5f414c2 2018-10-24)
>Reporter: J W
>Assignee: Allen George
>Priority: Major
>
> *For this thrift (note lowercase "e" at beginning of enum name):*
> enum ePlatform
> { None = 0 }
> struct SettingItem
> { 1: ePlatform platform }
> *Generated with:*
> thrift -gen rs -out ../rust/thrift/src enum_lowercase_prefix.thrift
> *Generated Rust fails to compile:*
> error[E0412]: cannot find type `ePlatform` in this scope
>  --> src\enum_lowercase_prefix.rs:71:24
>  
> 71 | pub platform: Option,
> |^ did you mean `EPlatform`?|
>  
> *In t_rs_generator.cc line 3025:*
> return rust_namespace(ttype) + ttype->get_name();
> *To match behavior in generate_enum(), probably needs to be:*
> return rust_namespace(ttype) + rust_camel_case(ttype->get_name());



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (THRIFT-4661) Rust enum name wrong case in generated structs

2018-11-09 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/THRIFT-4661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16681633#comment-16681633
 ] 

ASF GitHub Bot commented on THRIFT-4661:


jeking3 commented on issue #1623: THRIFT-4661: Rust enum name wrong case in 
generated structs
URL: https://github.com/apache/thrift/pull/1623#issuecomment-437404329
 
 
   On the CL missing file my assumption was it is a race inside the cl build 
framework.  It has plagued the project since CL was added.  If you can smite 
that, it would help stabilize the builds.  The other issue I have seen is a 
less frequent ssl/socket issue in the dlang tests.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Rust enum name wrong case in generated structs
> --
>
> Key: THRIFT-4661
> URL: https://issues.apache.org/jira/browse/THRIFT-4661
> Project: Thrift
>  Issue Type: Bug
>  Components: Rust - Compiler
>Affects Versions: 0.11.0
> Environment: C:\Users\jake>rustup show
> Default host: x86_64-pc-windows-msvc
> stable-x86_64-pc-windows-msvc (default)
> rustc 1.30.0 (da5f414c2 2018-10-24)
>Reporter: J W
>Assignee: Allen George
>Priority: Major
>
> *For this thrift (note lowercase "e" at beginning of enum name):*
> enum ePlatform
> { None = 0 }
> struct SettingItem
> { 1: ePlatform platform }
> *Generated with:*
> thrift -gen rs -out ../rust/thrift/src enum_lowercase_prefix.thrift
> *Generated Rust fails to compile:*
> error[E0412]: cannot find type `ePlatform` in this scope
>  --> src\enum_lowercase_prefix.rs:71:24
>  
> 71 | pub platform: Option,
> |^ did you mean `EPlatform`?|
>  
> *In t_rs_generator.cc line 3025:*
> return rust_namespace(ttype) + ttype->get_name();
> *To match behavior in generate_enum(), probably needs to be:*
> return rust_namespace(ttype) + rust_camel_case(ttype->get_name());



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (THRIFT-4661) Rust enum name wrong case in generated structs

2018-11-09 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/THRIFT-4661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16681631#comment-16681631
 ] 

ASF GitHub Bot commented on THRIFT-4661:


jeking3 commented on issue #1623: THRIFT-4661: Rust enum name wrong case in 
generated structs
URL: https://github.com/apache/thrift/pull/1623#issuecomment-437403785
 
 
   @allengeorge do you have access in GitHub to "approve" a PR?  If you go to 
the "Files changed" tab, can you submit a review approval from there?  I'm just 
curious.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Rust enum name wrong case in generated structs
> --
>
> Key: THRIFT-4661
> URL: https://issues.apache.org/jira/browse/THRIFT-4661
> Project: Thrift
>  Issue Type: Bug
>  Components: Rust - Compiler
>Affects Versions: 0.11.0
> Environment: C:\Users\jake>rustup show
> Default host: x86_64-pc-windows-msvc
> stable-x86_64-pc-windows-msvc (default)
> rustc 1.30.0 (da5f414c2 2018-10-24)
>Reporter: J W
>Assignee: Allen George
>Priority: Major
>
> *For this thrift (note lowercase "e" at beginning of enum name):*
> enum ePlatform
> { None = 0 }
> struct SettingItem
> { 1: ePlatform platform }
> *Generated with:*
> thrift -gen rs -out ../rust/thrift/src enum_lowercase_prefix.thrift
> *Generated Rust fails to compile:*
> error[E0412]: cannot find type `ePlatform` in this scope
>  --> src\enum_lowercase_prefix.rs:71:24
>  
> 71 | pub platform: Option,
> |^ did you mean `EPlatform`?|
>  
> *In t_rs_generator.cc line 3025:*
> return rust_namespace(ttype) + ttype->get_name();
> *To match behavior in generate_enum(), probably needs to be:*
> return rust_namespace(ttype) + rust_camel_case(ttype->get_name());



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (THRIFT-4451) Rust client fails to communicate with multiplexed perl/c_glib servers

2018-11-09 Thread Allen George (JIRA)


[ 
https://issues.apache.org/jira/browse/THRIFT-4451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16681366#comment-16681366
 ] 

Allen George commented on THRIFT-4451:
--

 !Screen Shot 2018-11-09 at 07.03.39.png! 

Here's a representative sample of what I'm seeing. Specifically, after the call 
to the second-test server is sent and the server responds with an {{ACK}}, the 
client immediately sends out a {{FIN}}. Now, once the server sends its response 
the client thinks the connection is dead, and so of course nothing is read.

AFAICT, I'm not invoking {{shutdown()}} explicitly, neither is {{Drop}} on the 
{{TcpStream}} getting called.

> Rust client fails to communicate with multiplexed perl/c_glib servers
> -
>
> Key: THRIFT-4451
> URL: https://issues.apache.org/jira/browse/THRIFT-4451
> Project: Thrift
>  Issue Type: Bug
>  Components: Rust - Library
>Reporter: Allen George
>Assignee: Allen George
>Priority: Major
> Attachments: Screen Shot 2018-11-09 at 07.03.39.png
>
>
> As stated in description. Minimal case is to comment out everything in the 
> Rust {{test_client}} leaving only the {{SecondService}} call behind.
> From what I can tell the Rust socket isn't getting *any* bytes at all for the 
> response (i.e. it can't even get the first 4 bytes of the message header). 
> There is a {{flush()}} call on the remote side - so that's puzzling.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (THRIFT-4451) Rust client fails to communicate with multiplexed perl/c_glib servers

2018-11-09 Thread Allen George (JIRA)


 [ 
https://issues.apache.org/jira/browse/THRIFT-4451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Allen George updated THRIFT-4451:
-
Attachment: Screen Shot 2018-11-09 at 07.03.39.png

> Rust client fails to communicate with multiplexed perl/c_glib servers
> -
>
> Key: THRIFT-4451
> URL: https://issues.apache.org/jira/browse/THRIFT-4451
> Project: Thrift
>  Issue Type: Bug
>  Components: Rust - Library
>Reporter: Allen George
>Assignee: Allen George
>Priority: Major
> Attachments: Screen Shot 2018-11-09 at 07.03.39.png
>
>
> As stated in description. Minimal case is to comment out everything in the 
> Rust {{test_client}} leaving only the {{SecondService}} call behind.
> From what I can tell the Rust socket isn't getting *any* bytes at all for the 
> response (i.e. it can't even get the first 4 bytes of the message header). 
> There is a {{flush()}} call on the remote side - so that's puzzling.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)