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

Update to SDK 6.3 and NixOS 23.05 #1

Draft
wants to merge 1 commit into
base: wip
Choose a base branch
from
Draft

Update to SDK 6.3 and NixOS 23.05 #1

wants to merge 1 commit into from

Conversation

hoh
Copy link

@hoh hoh commented Sep 7, 2023

This is a work in progress regarding the support of the latest version of the Connect IQ SDK.

I updated the version of the SDK and fixed changes in Nix variables.

I am now facing an issue of Read-only file system, and don't know how to solve it yet.

$ nix-shell

$ monkeyc -y developer_key.der  -f /nix/store/rsgpkgyhsrz96wyd10ha4dhbm5rgygw1-connectiq-sdk-6.3.0-2023-08-29-fc81ed416/share/connectiq-sdk/samples/Attention/monkey.jungle  -o Attention.prg
ERROR: Unable to generate default.jungle: Read-only file system
usage: monkeyc [-a <arg>] [-b <arg>] [--build-stats <arg>] [-c <arg>] [-d <arg>]
(...)

@samueldr
Copy link
Owner

samueldr commented Sep 7, 2023

Thanks, I'd started looking into it and got something going on my end. But not updated to this point yet.

Try copying the sample in a directory with write access. My first guess here is that it would be trying to make files (think .o-like files) in the Nix store directory.

@samueldr
Copy link
Owner

samueldr commented Sep 7, 2023

Or, another alternative, is to try to build it using the tooling within this repo:

 $ nix-build -I developer_key.der=../developer_key/developer_key.der ./samples.nix -A Attention

From a 3.1.8 SDK found on archive.org, I got that sample built and going on my watch as a first attempt. I like verifying that things work as they are before trying to update.

(To install on your watch, copy the .prg file to the APPS folder)


Just tested, same issue, looking into it.

@samueldr
Copy link
Owner

samueldr commented Sep 7, 2023

Some clues:

openat(AT_FDCWD, "/nix/store/cn6n4i2h4r5ifxvkfvla667zg7lhb58r-connectiq-sdk-6.3.0-2023-08-29-fc81ed416/share/connectiq-sdk/bin/default.jungle", O_RDWR|O_CREAT|O_EXCL, 0666 <unfinished ...>

The Connect IQ SDK includes a default Jungle file, which is always applied to projects even if no custom Jungle files are present

It looks like while it includes it, it doesn't exist by default and is generated?


ugh I was apparently right

~/tmp/tmp/connectiq 1 $ grep -Ri 'default\.jungle' .                                                                                                                                                                                           
grep: ./com/garmin/monkeybrains/jungle/DefaultJungleFile.class: binary file matches
grep: ./com/garmin/monkeybrains/jungle/DefaultJungleGenerator.class: binary file matches

@samueldr
Copy link
Owner

samueldr commented Sep 7, 2023

Okay, I think I understand the issue, and it will require figuring out more details about their SDK "helper" app...

It's pretty ugly.

We'll need to fetch whatever .Garmin/ConnectIQ/Devices comes from, as default.jungle ends-up referring to that (to this point) bogus path.

That's because the whole thing seems to assume it will run from a directory in the user's home?

See 6148db9, where I worked around the default.jungle file missing issue.

@hoh how did you end-up getting the SDK filename?

@samueldr
Copy link
Owner

samueldr commented Sep 7, 2023

Looking at how the SDK manager works, it's requiring to be logged-in and do OAuth to fetch devices information. That's rude and prevents building automated CI pipelines. Whew.

@hoh
Copy link
Author

hoh commented Sep 8, 2023

Thanks for these updates and the refactoring of the commits !

@hoh how did you end-up getting the SDK filename?

By browsing the URLs of the Garmin website, I found a list of all the SDK versions and version codes. I don't remember which one however.

I confirm that device information is fetched from another domain that requires authentication. That is pretty annoying to automate into developer pipelines, including CI pipelines... 😐

@samueldr
Copy link
Owner

samueldr commented Sep 8, 2023

Do you have that link for the SDK? maybe around there, there would be other hints to help out?

I think working around the devices listing (and fonts listing) can be worked around in a legit way that respects their wishes with a helper script that would handle loading via a conscious action by the end-user.

If you have the full SDK installed in any other form, could you gist a listing of the .Garmin folder it somehow manages?

That would help me tie the loose ends together and make the mechanism work.

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.

None yet

2 participants