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

Top-level projects don't seem to work on all OS's #76

Closed
ZacSweers opened this issue Apr 1, 2022 · 8 comments · Fixed by #79 or #84
Closed

Top-level projects don't seem to work on all OS's #76

ZacSweers opened this issue Apr 1, 2022 · 8 comments · Fixed by #79 or #84

Comments

@ZacSweers
Copy link

I'm not entirely sure if I'm reading this all right, but in our single-project repo doesn't appear to work when running apiCheck on linux CI while it does work on macOS locally.

Here's a repro - slackhq/EitherNet#52. Fails on CI with a strange check that suggests it's expecting a subproject, but it's a single-project repo only.

@joffrey-bion
Copy link
Contributor

joffrey-bion commented Apr 2, 2022

Why do you say it seems to be expecting a subproject? From your repro I could see:

Execution failed for task ':apiCheck'.
> File eithernet.api is missing from api/, please run :eithernet:apiDump task to generate one

Since you do have api/EitherNet.api (with CamelCase), I wonder if it's a case issue instead. Did apiDump generate the file with this camel case?

It seems you ran apiDump before you added rootProject.name to your settings.gradle.kts. Did you try to run apiDump again with the current settings.gradle.kts to see if it generates the .api file with a lowercase name?

@ZacSweers
Copy link
Author

This only reproduces on Linux, nothing errors when trying this flow on macOS locally.

Look again at the message

please run :eithernet:apiDump task

This doesn't make sense because there is no eithernet subproject. There is only one project — the root project. The only dump task is :apiDump, not :eithernet:apiDump. I think the problem lies somewhere in there - why does the plugin think that subproject exists?

@ZacSweers
Copy link
Author

It could be that it expects an all lowercase name on Linux, but I would expect the error message to be different or to possibly just better handle this case

@joffrey-bion
Copy link
Contributor

joffrey-bion commented Apr 3, 2022

This doesn't make sense because there is no eithernet subproject [...] I think the problem lies somewhere in there - why does the plugin think that subproject exists?

Oh right, the error message indeed looks broken in this respect. But looking at the code it really seems it is just that - a misleading error message. However, I'm not the maintainer of this project, so please take that with a grain of salt.

This only reproduces on Linux, nothing errors when trying this flow on macOS locally.

Filename case sensitivity behaving differently on different systems wouldn't surprise me. Better have the correct case instead of relying on system quirks.

IMO the problem is that you ran apiDump with the default project name, and later added an explicit rootProject.name in the Gradle settings (effectively changing the project name) without regenerating the api files again.

Did you try running :apiDump again as I suggested? Did it generate the file with lowercase name? If macOS considers the filename to be the same, it might not be enough to just run apiDump, you might need to delete the file first to be sure it re-creates it with proper case.

@ZacSweers
Copy link
Author

Did you try running :apiDump again as I suggested?

Yes, mentioned above too. No errors locally and no local file changes after running.

@joffrey-bion
Copy link
Contributor

joffrey-bion commented Apr 3, 2022

Yes, mentioned above too

You mentioned "trying this flow", I wasn't sure whether this referred to apiCheck or apiDump, and since you made no mention of the effect (or non effect) on the api file, I assumed you were referring to apiCheck working fine locally but failing on linux CI.

No errors locally and no local file changes after running.

Did you try deleting/renaming the file first? What's the filename case after that + apiDump? If your OS doesn't distinguish files that differ only by case, it's expected it might consider the camel case file as an already existing version of the lowercase file and not change its name, hence the suggestion about renaming or deleting.

@qwwdfsad
Copy link
Member

qwwdfsad commented Apr 3, 2022

Thanks for the report! Case sensitive may be the case here as OS X FS is case-insensitive (i.e. Foo.txt and foo.txt are considered to be the same filename), I'll investigate

joffrey-bion added a commit to joffrey-bion/binary-compatibility-validator that referenced this issue Apr 4, 2022
joffrey-bion added a commit to joffrey-bion/binary-compatibility-validator that referenced this issue Apr 11, 2022
qwwdfsad added a commit that referenced this issue Apr 11, 2022
@qwwdfsad qwwdfsad reopened this Apr 22, 2022
@qwwdfsad
Copy link
Member

Seems it wasn't fully fixed an requires further investigation: #79 (comment)

qwwdfsad added a commit that referenced this issue May 17, 2022
qwwdfsad added a commit that referenced this issue May 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants