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

Exchange metadata between Windows & Unix complicated because of EOL #7994

Closed
JaroslavTulach opened this issue Oct 6, 2023 · 1 comment
Closed
Assignees

Comments

@JaroslavTulach
Copy link
Member

While investigating so called "legit failure" in the CI Windows run I am concluding there is a problem in parsing META-DATA - there is no way to parse the same file on Windows and on other systems. To reproduce:

$ git checkout 958ac95
$ sbt runEngineDistribution --run test/Tests/src/Semantic/Instrumentor_Spec.enso

works on Linux, Mac, but fails on Windows. With a following Convert.java program:

import java.io.File;
import java.io.FileWriter;
import java.nio.file.Files;
import java.util.stream.Collectors;

public final class Convert {
    private Convert() {
    }

    public static void main(String... args) throws Exception {
        var nl = switch (args[1]) {
            case "crlf" -> "\r\n";
            case "lfcr" -> "\n\r";
            case "cr" -> "\n";
            case "lf" -> "\r";
            default -> throw new IllegalArgumentException("Specify: cr, lf or crlf");
        };
        var f = new File(args[0]).toPath();
        var txt = Files.readAllLines(f).stream().collect(Collectors.joining(nl));
        try (var w = new FileWriter(f.toFile())) {
            w.write(txt);
        }
    }
}

I can fix the problem on Windows, by running:

$ java Convert.java Instrumentor_Spec.enso "cr"

but then the file becomes unparsable on Linux & Mac. E.g. users sharing their files between windows and other system must loose their positions of widgets and visualizations as the parsing of META-DATA sections is too fragile - also reported as

and cannot handle parsing the same file on different systems.

@JaroslavTulach JaroslavTulach added p-high Should be completed in the next sprint -compiler -parser triage labels Oct 6, 2023
@github-project-automation github-project-automation bot moved this to ❓New in Issues Board Oct 6, 2023
@JaroslavTulach JaroslavTulach changed the title Cannot exchange metadata between Windows & Mac+Linux Exchange metadata between Windows & Unix complicated because of EOL Oct 9, 2023
@jdunkerley jdunkerley removed the triage label Oct 10, 2023
@JaroslavTulach JaroslavTulach removed the p-high Should be completed in the next sprint label Oct 10, 2023
@JaroslavTulach
Copy link
Member Author

No direct end user problem so far. Nobody seems to care.

@github-project-automation github-project-automation bot moved this from ❓New to 🟢 Accepted in Issues Board Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

3 participants