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

#451: mac gatekeeper #453

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

hohwille
Copy link
Member

@hohwille hohwille commented Jul 6, 2024

tries to fix #451

@hohwille hohwille added macOS specific for Apple MacOS bugfix labels Jul 6, 2024
@hohwille hohwille self-assigned this Jul 6, 2024
@hohwille hohwille marked this pull request as draft July 6, 2024 11:28
@hohwille hohwille marked this pull request as ready for review July 6, 2024 11:31
@coveralls
Copy link
Collaborator

coveralls commented Jul 6, 2024

Pull Request Test Coverage Report for Build 9818906813

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 56 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.2%) to 61.598%

Files with Coverage Reduction New Missed Lines %
com/devonfw/tools/ide/url/model/UrlMetadata.java 8 80.28%
com/devonfw/tools/ide/tool/ToolCommandlet.java 10 66.2%
com/devonfw/tools/ide/tool/LocalToolCommandlet.java 38 75.28%
Totals Coverage Status
Change from base Build 9813808982: -0.2%
Covered Lines: 5278
Relevant Lines: 8248

💛 - Coveralls

@coveralls
Copy link
Collaborator

coveralls commented Jul 6, 2024

Pull Request Test Coverage Report for Build 9818906469

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 56 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.2%) to 61.598%

Files with Coverage Reduction New Missed Lines %
com/devonfw/tools/ide/url/model/UrlMetadata.java 8 80.28%
com/devonfw/tools/ide/tool/ToolCommandlet.java 10 66.2%
com/devonfw/tools/ide/tool/LocalToolCommandlet.java 38 75.28%
Totals Coverage Status
Change from base Build 9813808982: -0.2%
Covered Lines: 5278
Relevant Lines: 8248

💛 - Coveralls

# Conflicts:
#	cli/src/main/java/com/devonfw/tools/ide/tool/LocalToolCommandlet.java
#	cli/src/main/java/com/devonfw/tools/ide/tool/ToolCommandlet.java
#	cli/src/test/java/com/devonfw/tools/ide/commandlet/EditionSetCommandletTest.java
Copy link
Contributor

@jan-vcapgemini jan-vcapgemini left a comment

Choose a reason for hiding this comment

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

Looks good to me. I've added some small CRs and merged the latest main into this branch.
Please double check if the merge was ok.

}
return new ToolInstallation(rootDir, linkDir, binDir, resolvedVersion, newInstallation);
}

private Path findMacApp(Path path) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Couldn't this be moved to the MacOsHelper class?

Comment on lines +296 to +300
Path macApp = findMacApp(linkDir);
if (macApp != null) {
ProcessContext pc = this.context.newProcess();
pc.executable("sudo").addArgs("xattr", "-d", "com.apple.quarantine", macApp);
pc.run();
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe move to MacOsHelper class?

Copy link
Member Author

Choose a reason for hiding this comment

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

Major problem is that this approach does not yet work. Maybe we need to do this for all files recursively. Still looking for a better solution to the problem. After all MacOS Settings will do some magic and there should be some command to automate this "magic".
But I fully aggree that this should go to MacOsHelper following SoC.

Copy link
Member Author

Choose a reason for hiding this comment

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

There is no documentation from Apple about such features. Maybe this meta-attribute needs to be set on the executable(s) rather than on the *.all folder. We would need more analysis on this to come up with a real solution.
I will change this PR back to draft to make this clear.

Copy link
Member Author

Choose a reason for hiding this comment

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

We would actually need somebody to analyze this on a real mac with Gatekeeper and try various such xattr commands for different folders and files until we know what does the magic trick.
Additionally someone must implement #415
Only after both things are addressed, we can actually implement/finish this #451 story.

@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 10115741272

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 54 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.1%) to 61.042%

Files with Coverage Reduction New Missed Lines %
com/devonfw/tools/ide/tool/ToolCommandlet.java 6 66.2%
com/devonfw/tools/ide/url/model/UrlMetadata.java 8 80.28%
com/devonfw/tools/ide/tool/LocalToolCommandlet.java 40 76.7%
Totals Coverage Status
Change from base Build 9940115511: -0.1%
Covered Lines: 5304
Relevant Lines: 8359

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix macOS specific for Apple MacOS
Projects
Status: Team Review
Development

Successfully merging this pull request may close these issues.

Make IDEasy usable on MacOS with active Gatekeeper
3 participants