Coder Social home page Coder Social logo

Comments (6)

NicMcPhee avatar NicMcPhee commented on September 13, 2024 1

Wow – huge thanks to @helloworld12321 for the awesome write-up! We only started with GitHub actions on this lab last year, and I don't remember anyone raising (or being aware of) this issue then. It's possible that it just never came up, or that people ran into the issue and just worked around it in some way.

I have no idea why sort behaves differently in the lab. We're (slowly – thanks COVID) in the process of upgrading the lab boxes, and potentially switching to Ubuntu, so it'll be interesting to see what, if any effect that has.

I just checked and the BSD sort on MacOS seems to behave like the Ubuntu, etc., options you tested above:

Screen Shot 2021-09-18 at 4 19 00 PM

I'm not sure how we'd "normalize whitespace" before sorting, TBH. diff is nice because we can just give it several flags and it will ignore most whitespace. sort doesn't really have that option, so we'd essentially have to use something like sed to replace runs of spaces/tabs with a single space. We could do that, but I'm not sure we should as it seems that kind of change might end up "covering up" certain kinds of errors? One could argue, for example, that folks should just eliminate the weird two-space-thing between months and single digit days, and that the tests are "right" in that regard. If that's the case, then maybe we should create a new issue to say something in the write-up about there being an expectation that things like Aug  9 (two spaces) are converted to Aug 9 (with just one space).

I suspect this never came up for me because I matched the month and the day using two separate regexes, with \s+ between them.

from log-processing.

helloworld12321 avatar helloworld12321 commented on September 13, 2024 1

Yeah, that's totally fair :)

I had suggested normalizing before sorting since it seemed like the "intent" of the tests was to ignore whitespace (eg, diff had the -wbB flags). But, I agree that changing the tests to be whitespace-sensitive everywhere might be better. The big thing is just to make it consistent across systems. 🙂

from log-processing.

NicMcPhee avatar NicMcPhee commented on September 13, 2024 1

Agreed. The systems differences is definitely super weird. I don't immediately know how to make it consistent across systems, though, since I don't know why our lab sort behaves differently. I poked at some of the local environment variables mentioned in sort documentation, and none of them seem to be set in the lab. Weirdz.

from log-processing.

helloworld12321 avatar helloworld12321 commented on September 13, 2024

How exactly sort treats whitespace varies from system to system.

On the lab computers, sort ignores whitespace. But on most other unix systems, sort is whitespace-sensitive. (The lab computers even differ from other Fedora systems!)

This explains why some tests that pass on the lab computers fail on GH actions.

I'm not sure why sort is weird on the lab computers—googling suggests that it might be locale-related ¯\_(ツ)_/¯

from log-processing.

helloworld12321 avatar helloworld12321 commented on September 13, 2024

Lab computers:
Screenshot from 2021-09-17 17-10-16

Ubuntu:
Screen Shot 2021-09-17 at 5 08 24 PM

fresh Fedora installation:
Screen Shot 2021-09-17 at 5 17 38 PM

from log-processing.

helloworld12321 avatar helloworld12321 commented on September 13, 2024

Maybe we could get rid of the the -wb flags to diff?

Then the sort behavior shouldn't matter. If the whitespace matches, the tests will pass; if the whitespace is different, the tests will fail. ¯\_(ツ)_/¯

from log-processing.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.