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

Install SVN Using MacPorts #31

Closed
JoelProminic opened this issue Dec 7, 2020 · 29 comments
Closed

Install SVN Using MacPorts #31

JoelProminic opened this issue Dec 7, 2020 · 29 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request macOS test-ready
Milestone

Comments

@JoelProminic
Copy link
Contributor

I recently updated to macOS Catalina (10.15.7) and I got this error when trying SVN from the command line:

$ svn update
svn: error: Failed to locate 'svn'.
svn: error: The subversion command line tools are no longer provided by Xcode.

In Moonshine, the Subversion menu always shows "Grant Permission" when I have selected an SVN project, and the other menu items are disabled.

I originally thought this was related to Moonshine-IDE/Moonshine-IDE#748, but that fix did not clear my error above.

After some testing and investigation, I confirmed that SVN support was removed from XCode in Catalina.

This StackOverflow question offers a couple solutions. I tried installing the latest version of CommandLIneTools, but I found it was missing in this project as well.

Instead, I used brew install svn and set the SVN path to /usr/bin/svn in Moonshine. This worked for a non-Sandbox build, but I haven't tried and AppStore build yet.

However, this may require installing brew. I also had to make additional changes to allow brew to run on Catalina

Error: The following directories are not writable by your user:
/usr/local/lib

You should change the ownership of these directories to your user.
  sudo chown -R $(whoami) /usr/local/lib

And make sure that your user has write permission.
  chmod u+w /usr/local/lib

The install output was slow and complicated, and it ended with an error for me (that did not prevent SVN from working):

Error: Could not symlink Frameworks/Python.framework/Headers
Target /usr/local/Frameworks/Python.framework/Headers
is a symlink belonging to [email protected]. You can unlink it:
  brew unlink [email protected]

To force the link and overwrite all conflicting files:
  brew link --overwrite python@2

To list all files that would be deleted:
  brew link --overwrite --dry-run python@2

We'll need to discuss the brew-based solution further.

@JoelProminic
Copy link
Contributor Author

If we end up using brew, we should also install some other common tools (i.e. telnet). We can make a "Homebrew Module" for Moonshine SDK Installer. We should discuss this with @JustinProminic later.

@rat-moonshine
Copy link
Collaborator

rat-moonshine commented Dec 8, 2020

Overall, this makes things complicated for us, and maybe for the users, too. I just noticed the problem against SVN in Moonshine where the calculated SVN path is invalid:

image

I really do not want to go into brew complexities if it is possible at all. I'd rather want to look for SDK with Subversion command-line support, the kind we're using on Windows. In a fact, we should also start looking for Git command-line alternative on macOS; We can't really depend on Apple on a longer term.

The above Apple changes also seem to affect my updates on Moonshine-IDE/Moonshine-IDE#533.

@rat-moonshine
Copy link
Collaborator

rat-moonshine commented Dec 11, 2020

Here are the official install and uninstaller commands on macOS: https://github.com/homebrew/install#uninstall-homebrew.

Upon running the standard uninstaller command (as suggested), it suggested on following folder deletion post uninstaller command run:

The following possible Homebrew files were not deleted:
/usr/local/.com.apple.installer.keep
/usr/local/Homebrew/
/usr/local/PortDetect.log
/usr/local/bin/
/usr/local/etc/
/usr/local/git/
/usr/local/hw_mp_userdata/
/usr/local/include/
/usr/local/lib/
/usr/local/libexec/
/usr/local/man/
/usr/local/opt/
/usr/local/remotedesktop/
/usr/local/sbin/
/usr/local/share/
/usr/local/var/
You may wish to remove them yourself.

While I'm uncertain about deleting any of the above folders, I deleted only /usr/local/Homebrew/ - this may require sudo on Terminal.

I received the system user's password prompt if I try using the official installer command for Homebrew, though. We need to discuss how we want to handle this part.

@JoelProminic
Copy link
Contributor Author

I tried to change SVN Binary in Moonshine to the Homebrew install (/usr/local/bin/svn), but I got this error on the console:

: svn: error: Failed to locate 'svn'.
: svn: error: The subversion command line tools are no longer provided by Xcode.
: Error Domain=NSCocoaErrorDomain Code=256 "Could not open() the item" UserInfo={NSURL=file:///usr/local/Cellar/subversion/1.14.0_6/bin/svn, NSDebugDescription=Could not open() the item}

@rat-moonshine
Copy link
Collaborator

rat-moonshine commented Apr 22, 2021

The closely relating long discussion I found here: Moonshine-IDE/Moonshine-IDE#307 (comment). Although, the error in Moonshine-IDE/Moonshine-IDE#307 never mentioned 'failed to locate'. So this could be something different this time.

I assume it's the /usr/local/bin/svn which is pointing somehow to {NSURL=file:///usr/local/Cellar/subversion/1.14.0_6/bin/svn?

@JoelProminic
Copy link
Contributor Author

Yes, I see that /usr/local/bin/svn in a symlink

% ls -lh /usr/local/bin/svn
lrwxr-xr-x  1 user  admin    37B Dec  7 16:44 /usr/local/bin/svn -> ../Cellar/subversion/1.14.0_6/bin/svn
% ls /usr/local/Cellar/subversion/1.14.0_6/bin/svn
/usr/local/Cellar/subversion/1.14.0_6/bin/svn

However, I tried selecting /usr/local/Cellar/subversion/1.14.0_6/bin/svn directly, and I got the same error:

: Error Domain=NSCocoaErrorDomain Code=256 "Could not open() the item" UserInfo={NSURL=file:///usr/local/Cellar/subversion/1.14.0_6/bin/svn, NSDebugDescription=Could not open() the item}

I suspect that macOS Catalina is restricting access to this directory.

@rat-moonshine
Copy link
Collaborator

I vaguely remember we did seen that mac file-browser doesn't permit to select certain file/directory in past. I wonder if the said file also has certain type restrictions (!)

@JoelProminic
Copy link
Contributor Author

@rat-moonshine suggested that MSDKI should expect the user to install HomeBrew for now, and we'll report an error if it is not found. If it is available, the MSDKI will run the brew commands for SVN.

I think this is a good start for this case at least. If desired, we can come back later and add logic for installing HomeBrew, especially if we find there are more SDKs that require this.

@JoelProminic
Copy link
Contributor Author

If we want to push this to a later release, we at least need to update the error message to make it clear that SVN installation is not currently available for macOS:

image

Check the behavior on Install Everything as well.

@JoelProminic
Copy link
Contributor Author

For reference, I did some testing with the AppStore build today, and I see that I can't setup Subversion with the Homebrew path. I get this error:

: Error Domain=NSCocoaErrorDomain Code=256 "Could not open() the item" UserInfo={NSURL=file:///usr/local/Cellar/subversion/1.14.0_6/bin/svn, NSDebugDescription=Could not open() the item}

So, we'll need a workaround for this, or we'll need to find another way to install SVN on macOS.

@rat-moonshine
Copy link
Collaborator

I see some interesting thoughts (beside using brew) might give some investigation (?) at https://stackoverflow.com/questions/60869347/mac-command-line-tools-11-4-no-longer-has-svn.

Two in particular:

  1. Tarball Subversion source download (at the end of the discussion)
  2. SVNKIT

@JoelProminic
Copy link
Contributor Author

I think we need to bump this to the next release, but we need to display a warning indicating that the SVN installation is unavailable currently. Something like this:

SVN installation is not currently available. You can install it through Homebrew with "brew install svn".

@rat-moonshine
Copy link
Collaborator

Stopped SVN downloads on macOS for now, in a manner of HCL Notes. However, I couldn't able test this locally due to Haxe compilation trouble (I sent a separate email on this), a Bamboo build is waiting for a test.

@piotrzarzycki21
Copy link
Collaborator

I have tested it and prompt is showing once I roll over on it. It is not so obvious but for me it could stay like that. You move issue for the next release.

@JoelProminic
Copy link
Contributor Author

I think the message looks good, and we are using the tooltip for other warning icons:
image

That said, @JustinProminic complained about this for other Warning icons before, so we may want to revisit this if we update that logic

@piotrzarzycki21
Copy link
Collaborator

We have notice for user, so I'm moving issue for next release.

@piotrzarzycki21 piotrzarzycki21 modified the milestones: v3.9.0, v4.0.0 Jul 20, 2021
@JoelProminic JoelProminic removed this from the v4.0.0 milestone Sep 1, 2021
@rat-moonshine
Copy link
Collaborator

I have cleaned-up UI requirements along with other handlings. This should be now ready for tests on macOS.

If we want a prior-notification/alert on 'the installation require user's permission' - then I need some texts that we can display before installation begins.

@rat-moonshine rat-moonshine changed the title SVN Removed from XCode and CommandLineTools in macOS Catalina SVN Removed from XCode and CommandLineTools in macOS Catalina | SVN installation using MacPorts Feb 22, 2022
@JoelProminic
Copy link
Contributor Author

I did some tests with the updated macOS build. @rat-moonshine reported that he did a sanity test for the Windows SlikSVN install to make sure nothing broke there.

Test Result
Missing MacPorts Message reported when installation triggers. This does not prevent other SDKs from installing
Subversion not installed Installs properly
Subversion already installed Detected properly
Reject admin prompt Shows "SVN Installation error: 0:94:" in log.

For the "Missing MacPorts" case, the message looks like this:

image

I would like to update the message like this:

Error

Subversion requires MacPorts for installation. Please install MacPorts separately.

OK

Note the casing update for the "Ok" button.

We do need to look into automating the MacPorts install for this case, but that is a separate issue.

@JoelProminic
Copy link
Contributor Author

In addition, I would like to display a better message for the authentication prompt. Currently, it shows "osascript" only, which will be confusing for users, especially when doing an "Install All":
image

@rat-moonshine found that we can specify a prompt using with prompt "%message%" in the applescript command. I would like to display a message likes this.

Moonshine SDK Installer requires admin privileges to install Subversion with MacPorts

Note that osascript will still be displayed in the message for Mojave, but this is still more clear than the default message.

rat-moonshine added a commit that referenced this issue Feb 23, 2022
- Admin privilege window message updated
#31
@rat-moonshine
Copy link
Collaborator

Updates:

  • Alert message updated while MacPorts installation is missing
  • User message updated in admin permission window

Please, check.

@rat-moonshine
Copy link
Collaborator

I noticed that Moonshine was unable to auto-setup SVN path on macOS. This fixed now in latest Moonshine build.

For sometime we were noticing an "invalid path" error message to SVN however the path was correct. This should be rectified now, as well:

image

@rat-moonshine
Copy link
Collaborator

@JoelProminic earlier reported following during his tests on MSDKI and Moonshine-IDE:

  1. Subversion path is not auto-setting in Moonshine Settings
  2. MSDKI opens blank license view during SVN setup

It appears that changes from 06cc8c2 affected areas which I didn't thought about. I re-worked in the related areas and did a full tests using MSDKI and Moonshine:

SVN Exists Scenario Results
No Moonshine No SVN path in Settings
No MSDKI Displays download icon against SVN
No MSDKI calls for installation Opens correct license view
- MSDKI completes SVN installation -
- Moonshine auto-focused upon SVN installation completes in MSDKI SVN path auto-set in Moonshine Settings
Yes Clear SVN path in Moonshine Settings and Save -
Yes Open Getting Started view in Moonshine SVN properly shown installed. Re-check Settings, SVN path again auto-set

Please, check.

@JoelProminic JoelProminic modified the milestones: v4.3.0, v4.4.0 Mar 30, 2022
@JoelProminic JoelProminic changed the title SVN Removed from XCode and CommandLineTools in macOS Catalina | SVN installation using MacPorts Install SVN Using MacPorts Mar 30, 2022
@JoelProminic
Copy link
Contributor Author

I have been confusing this issue with something else. I updated the issue title to make it more clear.

I see that we previously tested the different installation cases: #31 (comment)

I need to test and confirm:

@JoelProminic
Copy link
Contributor Author

Here is the admin prompt:

image

The install worked for me, and populated in Moonshine. I saw that the status did not update automatically in the Getting Started page, but I think this is a known limitation.

This looks fine for a release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request macOS test-ready
Projects
None yet
Development

No branches or pull requests

3 participants