opened
ivanbuhov
username_0
There is no more `metadata.bin` file. Metadata is now included in the executable upon build. The app thinning will strip the fat binaries to a single slice on the AppStore when the app is distributed to the client devices. This will leave a single copy of the metadata in the actual download from the AppStore.
Related issue: https://github.com/NativeScript/ios-runtime/issues/179
Buhov/metadata merged in binary
issue
created
fealebenpae
username_1
I can't tell from the patch, but did you move the 'Generate Metadata' build phase in the project template to the top? It would be best if it were right before the 'Link Binary' phase, for the same reason @username_2 cited for the proposed `PRE_LINK` CMake phase change.
comment
created
ivanbuhov
username_0
It turns out that the generation of `__TNSMetadata` section is part of the compilation phase, not the linking phase. It is the linker who does the job (`Ld` command is called), but it is called as part of the compilation process, right after all `CompileC` commands. So when the metadata generation step is between `Compile Sources` and `Link Binary With Libraries` or when it is set as `PRE_LINK` action the compilation phase fails with `ld: can't open -sectcreate file: /Users/buhov/Desktop/NS/ios-runtime/cmake-build/examples/Gameraww/Release-iphoneos/metadata-armv7.bin`, because it expects metadata to be already generated but there is no `metadata-armv7.bin` file yet. When I move the metadata generation step before `Compile Sources` phase (and in the other case - as `PRE_BUILD` action) it works like a charm. So I will leave it as it is unless you have better ideas.
comment
created
fealebenpae
username_1
Alright, makes sense
comment
created
ivanbuhov
username_0
Unfortunately, this approach is not working when NS Runtime is linked dynamically because it seems it is looking for TNSMetadata section in the dynamic library, but it is in the app executable.
comment
created
jasssonpet
username_2
Can we move the extern variable to the app then
comment
created
ivanbuhov
username_0
Yes, it should work. :+1:
comment
created
fealebenpae
username_1
:+1: after squashing to make things prettier
comment