You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "tustvold (via GitHub)" <gi...@apache.org> on 2023/03/24 09:26:01 UTC

[GitHub] [arrow-rs] tustvold opened a new pull request, #3927: Move protoc generation to binary crate (#3876)

tustvold opened a new pull request, #3927:
URL: https://github.com/apache/arrow-rs/pull/3927

   # Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   -->
   
   Closes #.
   
   # Rationale for this change
    
   <!--
   Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
   Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
   -->
   
   Inspired by @sunng87 's work in https://github.com/apache/arrow-rs/pull/3926 
   
   # What changes are included in this PR?
   
   <!--
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   # Are there any user-facing changes?
   
   
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   <!---
   If there are any breaking changes to public APIs, please add the `breaking change` label.
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] alamb commented on a diff in pull request #3927: Move protoc generation to binary crate, unpin prost/tonic build (#3876)

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #3927:
URL: https://github.com/apache/arrow-rs/pull/3927#discussion_r1147351915


##########
arrow-flight/Cargo.toml:
##########
@@ -64,13 +64,6 @@ tempfile = "3.3"
 tokio-stream = { version = "0.1", features = ["net"] }
 tower = "0.4.13"
 
-[build-dependencies]
-# Pin specific version of the tonic-build dependencies to avoid auto-generated

Review Comment:
   This change alone is 😍 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] sunng87 commented on a diff in pull request #3927: Move protoc generation to binary crate, unpin prost/tonic build (#3876)

Posted by "sunng87 (via GitHub)" <gi...@apache.org>.
sunng87 commented on code in PR #3927:
URL: https://github.com/apache/arrow-rs/pull/3927#discussion_r1147367748


##########
arrow-flight/gen/Cargo.toml:
##########
@@ -0,0 +1,36 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+[package]

Review Comment:
   maybe add `publish = false` here



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] tustvold commented on a diff in pull request #3927: Move protoc generation to binary crate (#3876)

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold commented on code in PR #3927:
URL: https://github.com/apache/arrow-rs/pull/3927#discussion_r1147314203


##########
arrow-flight/gen/src/main.rs:
##########
@@ -0,0 +1,86 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use std::{
+    fs::OpenOptions,
+    io::{Read, Write},
+    path::Path,
+};
+
+fn main() -> Result<(), Box<dyn std::error::Error>> {

Review Comment:
   This is just the code from build.rs, but with the conditionals on path existence removed (as we want it to error if it can't find the protobuf definitions)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] tustvold commented on pull request #3927: Move protoc generation to binary crate, unpin prost/tonic build (#3876)

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold commented on PR #3927:
URL: https://github.com/apache/arrow-rs/pull/3927#issuecomment-1482570285

   FYI I've filled a corresponding ticket in DataFusion - https://github.com/apache/arrow-datafusion/issues/5718


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] tustvold merged pull request #3927: Move protoc generation to binary crate, unpin prost/tonic build (#3876)

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold merged PR #3927:
URL: https://github.com/apache/arrow-rs/pull/3927


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] alamb commented on a diff in pull request #3927: Move protoc generation to binary crate, unpin prost/tonic build (#3876)

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #3927:
URL: https://github.com/apache/arrow-rs/pull/3927#discussion_r1147340880


##########
arrow-flight/CONTRIBUTING.md:
##########
@@ -0,0 +1,31 @@
+<!---
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+## Flight
+
+The prost code was generated by running this command from the root of the crate:
+
+```bash
+./regen.sh
+```
+
+The above script will run the Rust binary located in [gen](./gen)

Review Comment:
   I think it would be useful to put a note here on the context of why this doesn't use the standard protoc process (i.e. so that the code can be vendored and not automatically change if people have different versions of protoc)
   
   It might be helpful to explicitly note that now any changes to protobuf files will require running these scripts manually



##########
arrow-flight/gen/Cargo.toml:
##########
@@ -0,0 +1,36 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+[package]

Review Comment:
   It might be worth pointing out here that this crate is not meant to be distributed 



##########
.github/workflows/arrow_flight.yml:
##########
@@ -62,6 +61,18 @@ jobs:
       - name: Test --examples
         run: |
           cargo test -p arrow-flight  --features=flight-sql-experimental,tls --examples
+
+  vendor:
+    name: Verify Vendored Code
+    runs-on: ubuntu-latest
+    container:
+      image: amd64/rust
+    steps:
+      - uses: actions/checkout@v3
+      - name: Setup Rust toolchain
+        uses: ./.github/actions/setup-builder
+      - name: Run gen
+        run: ./arrow-flight/regen.sh
       - name: Verify workspace clean

Review Comment:
   ```suggestion
         - name: Verify workspace clean (if this fails, run ./arrow-flight/regen.sh and check in results)
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org