← 输入框|github.com|刷新
Skip to content

How to update reference files on Windows #1462

Closed

Description

@faze-geek

This may seem like an issue that can be discussed on zulip. I have already done that through PM's, will close this as soon as I get required solution.

I am trying to follow this comment by @czgdp1807 .

I believe that when I am trying to update the reference files, all of the reference files get updated which is unexpected. I guess this is because I am not running the windows equivalent of rm ./* after cd tests/reference. Could you kindly help me figuring out a windows equivalent for that command.

I'll attach screen shots for clarity on what is going on.
Image_1 shows all reference files being updated instead of only the required ones.
Image_2 shows commands that I am running to update( where rm ./* is intended to delete unwanted files)

image

image

Activity

  1. czgdp1807 commented on Jan 25, 2023

    @czgdp1807
    Collaborator

    What you can do is commit the changes you have made so far. Update your main branch locally, from origin. Then merge main into your working branch. Do a clean build. And run python run_tests.py -u.

  2. Thirumalai-Shaktivel commented on Jan 25, 2023

    @Thirumalai-Shaktivel
    Collaborator

    Currently, python run_tests.py -u doesn't work as expected in Windows. i.e., Both Linux and macOS get updated with the same output but this isn't the case in Windows. This might be the issue related to the \n\r or simply \n is not handled correctly in Windows (or possibly some other issue.). This was the reason for multiple files get updated like this: 9628b56 (#1430), when you do python run_tests -u

    Also, regarding the rm ./*, be very careful while using this command, it can remove all the files in the current directory.
    I use this: rm tests\references\* command only during the git rebase or git merge (which caused conflicts in the references) or while modifying the options name in run_tests. While the rest of the time, I only do run_tests.py -u.

  3. faze-geek commented on Feb 3, 2023

    @faze-geek
    ContributorAuthor

    I was under the assumption that #1463 was an attempt to fix python run_test.py -u but it doesn't and all the reference files get updated (I have fetched the latest changes).
    If I only run python run_test.py it does show me the changes the stdout_hash should have in the form of errors but then I have to make those manually which I would not prefer.

  4. certik commented on Feb 3, 2023

    @certik
    Contributor

    #1463 fixed run_tests.py, but not run_tests.py -u. @faze-geek would you be interested in sending us a PR that fixes run_tests.py -u on windows? That would be a big help.

  5. Thirumalai-Shaktivel commented on Feb 5, 2023

    @Thirumalai-Shaktivel
    Collaborator

    Yup, #1463 fixed run_tests.py. But, I don't know why it didn't fix run_tests.py -u. Let me check and report back.

  6. Thirumalai-Shaktivel commented on Feb 5, 2023

    @Thirumalai-Shaktivel
    Collaborator

    I see, the issue is with the git clone. So, previously while you cloned the lpython repo all the files were converted to CRLF format. Even if you fetched the latest changes, it wouldn't update the file format. That might be the reason for the failure.

    @faze-geek why don't you try this?

    • Commit the changes and publish or push the changes of the branches that you were working on if any.
    • Delete the lpython directory. Clone it again (make sure the repo contains the .gitattributes file in it). Build and test it with python run_tests.py --skip-run-with-dbg.

    If you face any issue with the python run_tests.py -u, please report it here.

  7. faze-geek commented on Feb 5, 2023

    @faze-geek
    ContributorAuthor

    If you face any issue with the python run_tests.py -u, please report it here.

    Sure, I will try the modifications you suggested soon. I will also test if run_tests.py is working correctly on my windows machine.

  8. faze-geek commented on Feb 13, 2023

    @faze-geek
    ContributorAuthor

    I see, the issue is with the git clone. So, previously while you cloned the lpython repo all the files were converted to CRLF format. Even if you fetched the latest changes, it wouldn't update the file format. That might be the reason for the failure.

    @Thirumalai-Shaktivel I tried this suggestion, this time the reference files get updated accordingly. I made a small test pr with minimal change so that I can test it out #1515 .

    Once you have a look at it and give me a green flag, I'll close this issue. Thanks!

  9. faze-geek commented on Mar 17, 2023

    @faze-geek
    ContributorAuthor

    Closing as completed in #1463 and Readme updated by this commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions