veracode / gen-ir

Generates LLVM IR for Xcode Projects
MIT License
8 stars 4 forks source link

the latest release doesn't generate files for the main target #31

Closed magicalc0der closed 1 year ago

magicalc0der commented 1 year ago

After update to v0.3.9 the files for the main app target does not get generated. Please see screen attached for the resulted archive It does generate data for the second app target but it should be for the first one. There is no way to specify target that I can see in the utility help.

veracode

One of the previous versions the one that has this #20 fix, I reckon it was 0.3.7, was working properly

NinjaLikesCheez commented 1 year ago

That's certainly odd - I'll dig in a little and see what changed. As for which target is selected, it should be whatever was built as part of your xcodebuild command.

magicalc0der commented 1 year ago

I am not quite sure how you identify the target in this case. I pass a scheme to build the app and the target is inside the scheme. I can't see target name when I skim through the build log

NinjaLikesCheez commented 1 year ago

We do it in a number of ways:

Does your scheme build the target you're looking for?

magicalc0der commented 1 year ago

yes it does. I tried to remove the second app target (which is the pretty much a copy of a main one) and everything was generated properly.

NinjaLikesCheez commented 1 year ago

Interesting - could you describe how the project & scheme are made up so I can try to replicate this in a test app?

magicalc0der commented 1 year ago

The app has a few targets. The main app target, copy of the app target with some additional functionality for internal purposes and tests targets (unit & UI tests). The main target has several configurations (schemes) and the build process is controlled by schemes.

build command looks as it follows:

xcodebuild -scheme SchemeName -project ./project.xcodeproj -configuration "configuration" -destination generic/platform=iOS -archivePath ./build/archive/archive.xcarchive BUNDLE_IDENTIFIER=BUNDLE_IDENTIFIER PRODUCT_BUNDLE_IDENTIFIER=PRODUCT_BUNDLE_IDENTIFIER "PROVISIONING_PROFILE_SPECIFIER=PROVISIONING_PROFILE_SPECIFIER" DEVELOPMENT_TEAM=DEVELOPMENT_TEAM ENABLE_BITCODE=NO archive

NinjaLikesCheez commented 1 year ago

Thanks for the description, I'll try create a test app to replicate this when I have some time later in the week

NinjaLikesCheez commented 1 year ago

Just to update you - I think I've managed to replicate this issue in a test app, I'll start to dig in when I can

NinjaLikesCheez commented 1 year ago

Could you test with the branch multiple_app_issue and see if that resolves your issue? Thanks!

magicalc0der commented 1 year ago

This branch worked for me. Files are generated properly and scan is successful.