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

Fix incorrect branch name when cloning openexr-images for the tests #3814

Merged

Conversation

jessey-git
Copy link
Contributor

@jessey-git jessey-git commented Apr 22, 2023

Description

The openexr-images repo was never updated after the default branch was renamed to main. This will fix the following silent errors in CI:

Cloning into '/__w/oiio/oiio/build/testsuite/openexr-images'...
warning: Could not find remote branch master to clone.
fatal: Remote branch master not found in upstream origin

Additionally, the cmake attempted to symbolically link local repos like oiio-images if they were found. Unfortunately this type of link will fail unless running as admin on Windows (which is rare) and the COPY_ON_ERROR directive did not work here (cmake 3.24; weird; sigh...). The output will now look something like the following:

-- Linking oiio-images from C:/Users/jesse/source/oiio-images
-- Link result failed to create symbolic link 'C:/Users/jesse/source/oiio/build/testsuite/oiio-images': A required privilege is not held by the client.
-- Copying oiio-images from C:/Users/jesse/source/oiio-images

Tests

These were found while trying to get the test suite running on Windows here in preparation for some development. Sadly the suite is still not running correctly at all so I may have to rely on the CI.

Checklist:

  • I have read the contribution guidelines.
  • If this is more extensive than a small change to existing code, I
    have previously submitted a Contributor License Agreement
    (individual, and if there is any way my
    employers might think my programming belongs to them, then also
    corporate).
  • I have updated the documentation, if applicable.
  • I have ensured that the change is tested somewhere in the testsuite
    (adding new test cases if necessary).
  • My code follows the prevailing code style of this project.

@lgritz
Copy link
Collaborator

lgritz commented Apr 24, 2023

Good catch. Fixing the URL is definitely good. In fact, it looks like maybe we have been skipping some of the openexr tests in CI because of this, and had not noticed! That's very bad, really embarrassing oversight. (I, frankly, never thought to check and if you had asked me, I would have said I assumed that the branch rename would forever after redirect properly so that any requests for master would get main automatically.) Some of the test failures you're seeing appear to be because these tests haven't run for a while for those testing combinations, and need some updates to the reference output for those tests. I won't hold up this PR because of that, I will just fix it after the fact by checking in new ref output.

I'm still confused about why the COPY_ON_ERROR is not sufficient here. Do you have an explanation? I wouldn't think that code change was necessary.

@jessey-git
Copy link
Contributor Author

I'm still confused about why the COPY_ON_ERROR is not sufficient here. Do you have an explanation? I wouldn't think that code change was necessary.

I'm confused too. When COPY_ON_ERROR is present the Status will be 0, which indicates success, but it appears to be a lie. The oiio-images directory will be created but its contents will be empty. Maybe it's a CMake bug where it's not doing a recursive copy in the case where the specified variable points to a directory?

@lgritz
Copy link
Collaborator

lgritz commented Apr 24, 2023

OK, then let's keep your logic change, but can you please put in a comment that explains that we thought that COPY_ON_ERROR would implement this behavior, it doesn't appear to in this circumstance and we don't know why, but that it's something we should check from time to time and maybe can return to the simpler construct if cmake eventually fixes the behavior.

Copy link
Collaborator

@lgritz lgritz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the fix

@lgritz lgritz merged commit e88e4e4 into AcademySoftwareFoundation:master Apr 25, 2023
17 of 20 checks passed
@jessey-git jessey-git deleted the fix-missing-openexr-images branch April 25, 2023 09:39
lgritz pushed a commit to lgritz/OpenImageIO that referenced this pull request Apr 25, 2023
…tests (AcademySoftwareFoundation#3814)

The `openexr-images` repo was never updated after the default branch was
renamed to `main`. This will fix the following silent errors in CI:
```
Cloning into '/__w/oiio/oiio/build/testsuite/openexr-images'...
warning: Could not find remote branch master to clone.
fatal: Remote branch master not found in upstream origin
```

Additionally, the cmake attempted to symbolically link local repos like
`oiio-images` if they were found. Unfortunately this type of link will
fail unless running as admin on Windows (which is rare) and the
COPY_ON_ERROR directive did _not_ work here (cmake 3.24; weird;
sigh...). The output will now look something like the following:
```
-- Linking oiio-images from C:/Users/jesse/source/oiio-images
-- Link result failed to create symbolic link 'C:/Users/jesse/source/oiio/build/testsuite/oiio-images': A required privilege is not held by the client.
-- Copying oiio-images from C:/Users/jesse/source/oiio-images
```
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