Skip to content

Portion of updates go get things building/running with node 19, python3#118

Open
KostyaSha wants to merge 3 commits intodryark:masterfrom
KostyaSha:update-deps
Open

Portion of updates go get things building/running with node 19, python3#118
KostyaSha wants to merge 3 commits intodryark:masterfrom
KostyaSha:update-deps

Conversation

@KostyaSha
Copy link

@KostyaSha KostyaSha commented Jul 15, 2023

After going through issues/forks/mrs decided to PR my local changes for building stuff.

libimobiledevice splitted to glue module that is required for libusbmuxd.

 brew install --build-from-source --HEAD libimobiledevice-glue.rb
 brew install --build-from-source --HEAD libusbmuxd.rb
 brew install --build-from-source --HEAD libimobiledevice.rb

Probably better to relax node to just node binary, but node 20 had some issues...

go stuff is not perfect, i also added go mod in the root of repo, but i'm not sure that it's the best go way.

PS i think switch repos to git submodules would be better and this can allign code/tools in a working state.

volumes:
- ./runcli.js:/app/runcli.js
ports:
- 9229:9229
Copy link
Author

Choose a reason for hiding this comment

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

compose blame two ports definitions, merged into one. Not sure why 1-to-1 9229 port is required

@@ -1,4 +1,4 @@
FROM livxtrm/devicefarmer:latest
Copy link
Author

Choose a reason for hiding this comment

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

didn't found sources and replaced with upstream

@@ -0,0 +1,50 @@
class Libusbmuxd < Formula
Copy link
Author

Choose a reason for hiding this comment

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

copy-pasted existing + added depends_on so pkg-config added to biuld process. Probably fix pc's not needed then(?)

@@ -1,4 +1,4 @@
#!/usr/bin/python
Copy link
Author

Choose a reason for hiding this comment

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

this path is not available in osx and just fails run

}*/

// node --inspect=[ip]:[port] runmod.js device-ios
if cmd[0] == "/usr/local/opt/node@12/bin/node" && cmd[3] == "device-ios" {
Copy link
Author

Choose a reason for hiding this comment

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

would it better to move to cmd option? coordinator is a go tool, instead of hardcode we can require parameter with a path

Copy link
Collaborator

Choose a reason for hiding this comment

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

This cleanup section is an extra protection to doubly sure that old processes are not leftover.

The cmd option itself is supposed to get rid of them all on shutdown, but in some cases ( such as when the coordinator crashes ) it doesn't happen.

"server_hostname": serverHostname,
"location": location,
}
o.binary = "/usr/local/opt/node@12/bin/node"
Copy link
Author

Choose a reason for hiding this comment

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

i guess this could be even shitfed into config.json?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, such things could be shifted into config. I think in this case I did not do so as the proper version and location of node should be detected via additional code instead of being hardcoded.

serverIP := o.config.Stf.Ip

location := fmt.Sprintf("macmini/%s", clientHostname)
Copy link
Author

Choose a reason for hiding this comment

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

macmini is pretty weird hardcode, is it needed for something at all?

Copy link
Collaborator

Choose a reason for hiding this comment

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

This was put here as when this code was used, the names of the machines were not very descriptive, but they were all mac minis. Really this should be a name prefix that can be set if desired in config.

libimobiledevice splitted to glue module that is required for libusbmuxd.

```
 brew install --build-from-source --HEAD libimobiledevice.rb
 brew install --build-from-source --HEAD libimobiledevice-glue.rb
 brew install --build-from-source --HEAD libusbmuxd.rb
```

Probably better to relax node to just `node` binary, but node 20 had some issues afair

Signed-off-by: Kanstantsin Shautsou <kanstantsin.sha@gmail.com>
@KostyaSha
Copy link
Author

Q about coordinator.go, what is the sense of calling go binary from go binary with json as IPC? Why not call it natively?

./util/brewser.pl ensurehead libusbmuxd 2.0.3
#./util/brewser.pl ensurehead libusbmuxd 2.0.3
./util/brewser.pl fixpc libusbmuxd 2.0
#make libimd No newline at end of file
Copy link
Author

Choose a reason for hiding this comment

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

todo review, also libimd builds fine

Brew link/unlink should handle node switching(?)

Signed-off-by: Kanstantsin Shautsou <kanstantsin.sha@gmail.com>
@nanoscopic
Copy link
Collaborator

Q about coordinator.go, what is the sense of calling go binary from go binary with json as IPC? Why not call it natively?

It is done because if you call it natively it doesn't work.

@nanoscopic
Copy link
Collaborator

PS i think switch repos to git submodules would be better and this can align code/tools in a working state.

Git submodules will not be used.

@nanoscopic
Copy link
Collaborator

go stuff is not perfect, i also added go mod in the root of repo, but i'm not sure that it's the best go way.

What does adding a go.mod in the root accomplish?

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