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

lfc and build-lfc errors on MacOS after commit 7249b778283cbf0b63623a9f0427684755da7f1b #651

Closed
housengw opened this issue Oct 20, 2021 · 9 comments · Fixed by #656
Closed
Assignees

Comments

@housengw
Copy link
Contributor

Here's the error message:

oysteryio-2:bin wonghouseng$ lfc
readlink: illegal option -- f
usage: readlink [-n] [file ...]
/Users/wonghouseng/Desktop/lingua-franca/bin/lfc: line 11: ./init.sh: No such file or directory
/Users/wonghouseng/Desktop/lingua-franca/bin/lfc: line 14: find_jar_path: command not found
/Users/wonghouseng/Desktop/lingua-franca/bin/lfc: line 15: fatal_error: command not found
/Users/wonghouseng/Desktop/lingua-franca/bin/lfc: line 19: check_jre_version: command not found
/Users/wonghouseng/Desktop/lingua-franca/bin/lfc: line 22: run_jar_with_args: command not found

Based on a brief search, seems like the cause is that readlink on Mac does not have the --f flag.

@lhstrh
Copy link
Member

lhstrh commented Oct 20, 2021

Thanks for reporting this! It is unfortunate that lfc stopped working on MacOS. We use readlink --f to ensure that symlinks don't break our scripts. I'm not sure how to do this on Mac. In a quick search, I found this: https://stackoverflow.com/questions/29836821/how-does-this-os-x-bash-script-that-emulates-linuxs-readlink-work

We might want to check $OSTYPE and do platform-specific things here. Before doing this, however, we should set up a CI job that tests lfc on the various platforms so that we can guarantee all of this works...

@lhstrh
Copy link
Member

lhstrh commented Oct 20, 2021

One option would be to greadlink -f from coreutils (and tell the user to brew install coreutils if greadlink cannot be found).

Would this be acceptable, or should we really write our own bash code to resolve this?

One advantage of the greadlink approach is that we can push a fix quickly...and we could push a custom solution without dependencies later...

@Soroosh129
Copy link
Contributor

Soroosh129 commented Oct 20, 2021

I think we shouldn't assume probably that brew is installed on MacOS since it is not a natively installed application and it is not a light commitment to install it.

@Soroosh129
Copy link
Contributor

Should we revert the merge until this is resolved?

@lhstrh
Copy link
Member

lhstrh commented Oct 20, 2021 via email

@Soroosh129
Copy link
Contributor

I wouldn't be able to help out tonight. I can take a stab at it tomorrow morning.

@lhstrh
Copy link
Member

lhstrh commented Oct 20, 2021

BTW, I would have expected ./gradlew :org.lflang.lfc:test --stacktrace to have picked up on this problem because we run it for all platforms, not just for Linux. I haven't yet looked into what these test actually do, but the current tests do not suffice.

@cmnrd
Copy link
Collaborator

cmnrd commented Oct 21, 2021

Our tests don't use the lfc script. In fact, the lfc artifact isn't even build in our CI flow. I opened #320 and #575 pointing this out, but never got to fixing it.

Since we now test the benchmark runner script on Linux, we have at least a little coverage regarding the lfc script.

@lhstrh
Copy link
Member

lhstrh commented Oct 22, 2021

In lieu of tests (forthcoming) could you please check whether lfc and build-lfc work on Mac on the lfc-test branch?

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.

4 participants