Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packing macOS executable into application #96

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Nelonn
Copy link

@Nelonn Nelonn commented Jul 28, 2024

Modifications in the build packages the executable file into macOS application.

image

macOS applications are read-only, so I moved config to /Users/{user}/Application Support/SniffCraft/conf.json

@Nelonn
Copy link
Author

Nelonn commented Jul 28, 2024

In mine repository automatic_release fails cause I don't have tag latest

@adepierre
Copy link
Owner

In mine repository automatic_release fails cause I don't have tag latest

Yes you need to create the first latest tag manually so the automatic changelog can be created in the release

@Nelonn
Copy link
Author

Nelonn commented Jul 28, 2024

In mine repository automatic_release fails cause I don't have tag latest

Yes you need to create the first latest tag manually so the automatic changelog can be created in the release

In general, everything works fine

set_target_properties(${PROJECT_NAME} PROPERTIES MACOSX_BUNDLE TRUE)
set_target_properties(${PROJECT_NAME} PROPERTIES
OUTPUT_NAME "SniffCraft"
XCODE_ATTRIBUTE_ENABLE_HARDENED_RUNTIME YES
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

XCODE_ATTRIBUTE_ENABLE_HARDENED_RUNTIME seems to be very XCode only. So I think the if condition should also check the generator is xcode, as it's also possible to compile on macos with other generators that don't support these features.

Also, I'm not sure what hardened runtime do exactly, but with a quick internet search, it makes me think it may break the DLL loading for the plugins feature.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

XCODE_ATTRIBUTE_ENABLE_HARDENED_RUNTIME seems to be very XCode only. So I think the if condition should also check the generator is xcode, as it's also possible to compile on macos with other generators that don't support these features.

Also, I'm not sure what hardened runtime do exactly, but with a quick internet search, it makes me think it may break the DLL loading for the plugins feature.

This is an optional option, but I've seen many people use it. At the expense of XCode, other compilers will simply ignore these options

@adepierre
Copy link
Owner

Took some time to look at it in details and I don't think I want to merge it in the main repo. The facts that I don't know anything about macOS and I can't test anything myself make me think that I won't be able to maintain the feature reliably in the future.

@Nelonn
Copy link
Author

Nelonn commented Jul 31, 2024

Took some time to look at it in details and I don't think I want to merge it in the main repo. The facts that I don't know anything about macOS and I can't test anything myself make me think that I won't be able to maintain the feature reliably in the future.

mac OS application is essentially executable in a mini wrapper, if the question is about support, you can supply raw executable separately

@Nelonn
Copy link
Author

Nelonn commented Jul 31, 2024

I recommend that you make a cmake option to build into the app.

@adepierre
Copy link
Owner

adepierre commented Jul 31, 2024

Took some time to look at it in details and I don't think I want to merge it in the main repo. The facts that I don't know anything about macOS and I can't test anything myself make me think that I won't be able to maintain the feature reliably in the future.

mac OS application is essentially executable in a mini wrapper, if the question is about support, you can supply raw executable separately

Yeah that's sort of my point. I don't really understand what is the advantage of going to an app instead of the standalone executable file? From what I understand the only effects it has are

  • forcing the conf file to be located somewhere else -which is not really a good thing-
  • potentially breaking the plugin system
  • making maintenance of the project harder, as everytime a new feature will be added, I'll have to wonder if that needs specific handling for the macos app thing

It seems to me the app package thing has only cons and not real pros in the context of this project which is already a single executable.

@Nelonn
Copy link
Author

Nelonn commented Jul 31, 2024

Took some time to look at it in details and I don't think I want to merge it in the main repo. The facts that I don't know anything about macOS and I can't test anything myself make me think that I won't be able to maintain the feature reliably in the future.

mac OS application is essentially executable in a mini wrapper, if the question is about support, you can supply raw executable separately

Yeah that's sort of my point. I don't really understand what is the advantage of going to an app instead of the standalone executable file? From what I understand the only effects it has are

  • forcing the conf file to be located somewhere else -which is not really a good thing-
  • potentially breaking the plugin system
  • making maintenance of the project harder, as everytime a new feature will be added, I'll have to wonder if that needs specific handling for the macos app thing

It seems to me the app package thing has only cons and not real pros in the context of this project which is already a single executable.

In my mind, SniffCraft should be a complete application with the ability to "Load config", "Save config", workspaces, etc. Now I use this modifications and get great pleasure from my work.

@adepierre
Copy link
Owner

Yeah I think this is a divergence in vision for Sniffcraft. I personally see it as a tool that I use occasionally to develop my other projects. As such, it obviously needs to work properly, but also more importantly not take me more time to develop and maintain than I gain by using it.

So even if many small niche features would probably be useful for some people, I do not want to take the responsability of maintaining them in the future in the main repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants