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

macOS swiftly-install.sh does not create config.json #136

Open
BrianHenryIE opened this issue Jul 16, 2024 · 4 comments
Open

macOS swiftly-install.sh does not create config.json #136

BrianHenryIE opened this issue Jul 16, 2024 · 4 comments

Comments

@BrianHenryIE
Copy link

% swiftly                                                               

Error: Could not load swiftly's configuration file at /Users/brianhenry/Library/Application Support/swiftly/config.json due to
error: "Error Domain=NSCocoaErrorDomain Code=260 "The file “config.json” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/Users/brianhenry/Library/Application Support/swiftly/config.json, NSUnderlyingError=0x600000cc4ab0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}".
To use swiftly, modify the configuration file to fix the issue or perform a clean installation.

if [ "$IS_MACOS" == "false" ]; then
JSON_OUT=$(cat <<EOF
{
"platform": {
"name": "$PLATFORM_NAME",
"nameFull": "$PLATFORM_NAME_FULL",
"namePretty": "$PLATFORM_NAME_PRETTY",
"architecture": $PLATFORM_ARCH
},
"installedToolchains": [],
"inUse": null
}
EOF
)
fi

if [ "$IS_MACOS" == "false" ]; then
echo "$JSON_OUT" > "$HOME_DIR/config.json"
fi

Removing the conditionals allows swiftly to run, but the config is mostly empty:

% cat "/Users/brianhenry/Library/Application Support/swiftly/config.json"

{
  "platform": {
    "name": "",
    "nameFull": "",
    "namePretty": "",
    "architecture": "aarch64"
  },
  "installedToolchains": [],
  "inUse": null
}

And installing doesn't work:

% swiftly install 5.9

Fetching the latest stable Swift 5.9 release...
Installing Swift 5.9.2
Swift 5.9.2 does not exist, exiting
@adam-fowler
Copy link
Contributor

We haven't released a macOS version of swiftly yet.

@BrianHenryIE
Copy link
Author

BrianHenryIE commented Jul 16, 2024

Yeah, I'm testing the changes that have been merged to main

#121 (comment)

Please raise issues for anything that remains. Thanks everyone!

@adam-fowler
Copy link
Contributor

The plan is for a lot of the swiftly-install script to be moved inside of swiftly. The current state of the script is not Mac friendly.

@BrianHenryIE
Copy link
Author

Brief thread on Slack, FYI: https://swift-open-source.slack.com/archives/C078M3HTMEU/p1720899355984949, basically just saying I want to test this.

I still have more use-testing to do to be 100% sure, but I think if my two PRs are merged, then macOS support is ready for a release.

I agree 100% that it's preferable to eliminate swiftly-install.sh. My reading of the discussion is that that is a different task, and it has a PR proposal but looks like it's not imminent. If it is imminent, hopefully the comments I've made here will be helpful.

Let me know if there's an expectation of automated tests – I said elsewhere that hopefully it's a matter of adding a macOS target for testing rather than writing new tests. The two "suggestion" issues I've opened probably would want tests when I write PRs.

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 a pull request may close this issue.

2 participants