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

Getting run-tests.sh to work on macOS #110

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Alex-Vasile
Copy link

Fixes the half of the issues Brough up in #109.

Replaced head with sed so that commands works on macOS.

Also added description of what the entire command does.

Replaced head with sed so that commands works on macOS.

Also added description of what the entire command does.
@mk270
Copy link
Owner

mk270 commented Oct 15, 2020

ah thanks - I'll have a look

Undo part of my last change by re-adding the "+" in-front of 19 for tail.

I naively removed it since it didn't appear to make a difference on macOS, but it does in ubuntu. Tests fail without it.
@mk270
Copy link
Owner

mk270 commented Oct 25, 2020

Hi @Alex-Vasile ... the code you've pushed doesn't always do the right thing; could you change it to:

sed -e :a -e '$q;N;20,$D;ba' | sed -e '$ d'

(which I think does the right thing portably; obviously long-term we need a better solution to this, which is barely legible)

@Alex-Vasile
Copy link
Author

@mk270, The first commit in the PR broke things by mistake, my second commit should have fixed it (It was an issue with the tail command).

I tried replacing
tail -n +19 | sed -e '$ d'
with
sed -e :a -e '$q;N;20,$D;ba' | sed -e '$ d'
but all tests fail on macOS. I'm not entirely sure what the issue is, but I have attached the output.txt.

@mk270
Copy link
Owner

mk270 commented Oct 25, 2020

what we need is a portable implementation of "give me the last 19 lines of output". Since the interface of tail was unaccountably changed, that's become harder.

I don't want to give up on portability, but I have no means of testing this stuff on MacOS. We might be reduced to reimplementing tail -19 in Ada at this rate.

@Alex-Vasile
Copy link
Author

What do you mean, or what change for tail are you referring to?

But yes, the shell scripts are a bit of a trouble for cross-platform support.

I tested your suggested change (sed -e :a -e '$q;N;20,$D;ba' | sed -e '$ d') on Ubuntu 20.04, and I am getting the same issue as on macOS. However, tail -n +19 | sed -e '$ d' (what is currently in this PR) works.

Does it work on Windows? (I haven't gotten gnat running on my windows installation yet).

If it is, we should consider going it with for now, work towards releasing binaries for v1.98, and come back for a longer term solution after.

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