-
Notifications
You must be signed in to change notification settings - Fork 92
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
Native post install script #1251
base: master
Are you sure you want to change the base?
Conversation
| Ok(_) => print_endline("Done!") | ||
| Error(`NoBuildFound) => Printf.eprintf("No build found!") | ||
| Error(`ReleaseAlreadyInstalled) => | ||
Printf.eprintf("Release already installed!") | ||
| Error(`Msg(msg)) => Printf.eprintf("%s", msg) | ||
| Error(`EsyLibError(err)) => | ||
Printf.eprintf("%s", EsyLib.Run.formatError(err)) | ||
| Error(`CommandError(cmd, status)) => | ||
Bos.Cmd.pp(Format.err_formatter, cmd) | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to have the main
function to return a result
type with the error
part being all variants so we could pattern match on them and decide what to do. Since we actually do nothing more than printing the error in every case, I might have made this more complicated than needed.
Happy to refactor and use the RunAsync.error(string)
function to report these errors if you prefer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that would be great! As much code/pattern reuse as possible.
Although I included |
switch (System.Platform.host, System.Arch.host) { | ||
| (Darwin, Arm64) => | ||
print_endline("Detected macOS arm64. Signing binaries..."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw after that you're doing it differently here:
esy/esy-build-package/Build.re
Line 372 in 560642c
let isBigSurArm = |
I have the feeling that my solution is better but I might be wrong ofc. Let me know what you think and I can adapt :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I completely missed EsyLib.System
- thanks!
EsyLib.System
internally runs uname too. Teeny tiny nit - it runs uname
twice. Definitely, doesnt justify reinventing it again.
+1 to your approach.
@tatchi The CI failure is because of |
d3272d7
to
b295f73
Compare
da3356e
to
1797b2e
Compare
a44a63d
to
a3021b4
Compare
What are the blocker of this PR ? |
It's been a while so I'm not totally sure but from what I remember, something was not working on CI. I see that @ManasJayanth force-pushed the last, so maybe he has better clue? |
48d08cc
to
78049aa
Compare
Address #1209