Comments (12)
Hi. Please, send me a zip of the directory. I will look.
from protobuf-swift.
What command do you use to generate files?
from protobuf-swift.
For some reason gmail keeps bouncing the follow up email i'm trying to send.
If you take the zip i sent you and run:
mkdir src
tar -xvf protobufs.tar.gz
mv protobufs src
mkdir swift
find src -type f -name '*.proto' | xargs protoc --proto_path ./src --swift_out swift/
that should generate the protobufs with the errors
from protobuf-swift.
I'm still having issues with these nested protobufs.
From what I can tell, it seems like the order in which you define the structures you use to represent the package hierarchy matters. I'm not sure how the swift compiler determines the order these will get compiled if the definitions are in different files.
I'm sending you a couple of sample projects that demonstrate the issue.
If all of the definitions are in order within one file, everything builds correctly.
ie something like:
public struct Services { public struct Organization { public struct Actions { public struct CreateOrganization { }}}}
public extension Services { public struct Profile { public struct Actions { public struct GetExtendedProfile { }}}}
public extension Services.Profile { public struct Containers { public struct Profile { }}}
public extension Services.Organization { public struct Containers { public struct Organization { }}}
public extension Services.Organization.Containers { public struct Team { }}
public extension Services.Organization.Actions { public struct GetOrganization { }}
works in a playground.
as opposed to:
public extension Services.Organization.Actions { public struct GetOrganization { }}
public extension Services.Profile { public struct Containers { public struct Profile { }}}
public struct Services { public struct Organization { public struct Actions { public struct CreateOrganization { }}}}
public extension Services { public struct Profile { public struct Actions { public struct GetExtendedProfile { }}}}
public extension Services.Organization { public struct Containers { public struct Organization { }}}
public extension Services.Organization.Containers { public struct Team { }}
which fails with "'Profile' is not a member type of 'Services'"
from protobuf-swift.
https://developer.apple.com/swift/blog/?id=7
makes it clear why the above two don't work in the playground, the playgrounds are "order-dependent". i'm not sure why the project i sent you is not "order-independent" as it should be.
from protobuf-swift.
This is some kind of magic:)
from protobuf-swift.
I look this example in the weekend.
from protobuf-swift.
This is a bug in Xcode. When I change the order of files - all compiled :)
from protobuf-swift.
@mhahn did you file a bug report on this? I am having the same problem as you and changing the compile order fixes the problem for me. I think it would be worth it to add this edge case to the readme so others don't spin their wheels wondering why it doesn't work.
from protobuf-swift.
i never did, i guess now we could probably open an issue on the swift code
base?
On Tue, Feb 9, 2016 at 5:49 PM brandonroth [email protected] wrote:
@mhahn https://github.com/mhahn did you file a bug report on this? I am
having the same problem as you and changing the compile order fixes the
problem for me. I think it would be worth it to add this edge case to the
readme so others don't spin their wheels wondering why it doesn't work.—
Reply to this email directly or view it on GitHub
#49 (comment)
.
from protobuf-swift.
I'm planning on creating a sample project to demonstrate the issue and file a bug report. Thanks for posting your solution of compile order, it saved my day!
from protobuf-swift.
thanks to @alexeyxo without his screenshot i wouldn't have known you can adjust compile order ;)
from protobuf-swift.
Related Issues (20)
- Error in Xcode10 HOT 1
- Build fails with protobuf 3.6.0 HOT 2
- If a number is 0 this property will missing HOT 1
- XCode 10/swift 4.2 compilation errors HOT 3
- Build error on Xcode beta 5 HOT 2
- convert array ro json
- UnsafeRawPointer(&buffer+bufferPos) Ambiguous use of 'init' HOT 4
- configuare.ac
- new function to `delimitedData`
- Build time error HOT 1
- protobuf test program failed to link
- Message Field extensions
- protobuf2.6,swift 3.0 ,version Number
- Question : Codable
- [Question] Use RawValue enum when formatting to JSON
- protocol buffer build.sh error and show “protobuf test program failed to link” HOT 4
- Install failed
- Why the GeneratedMessageProtocol tip error
- Xcode 12.0 BETA 4 HOT 5
- Xcode12 build failure - Generic parameter 'Element' could not be inferred HOT 2
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 protobuf-swift.