-
Notifications
You must be signed in to change notification settings - Fork 8
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
warn if dependencies file does not exist #33
Conversation
@vyasr @KyleFromNVIDIA @bdice I think it'd be worth talking through this synchronously next week. That will probably go faster than using GItHub comments. |
Sure, happy to link you to some relevant information. The tl;dr is I'd be fine with warning, but I don't think we want to hard error. |
Thanks, I see now from the links you shared that having this try-catch was an explicit design choice. Specifically this quote:
from #17 (comment) I wasn't involved in that conversation, didn't know about that. Sorry for bringing up something that's already covered. I do still think at least the warning would be nice to have at this stage of development, where I've changed this PR in the following ways:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw you changed the default location but then changed it back - I presume this is because it broke the tests. I think the new default location that you proposed is better, and we should change the tests to match.
# "dependencies.yaml" might not exist in sdists and wouldn't need to... so don't | ||
# raise an exception if that file can't be found when this runs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should distinguish between "dependencies.yaml
doesn't exist because it's an sdist" and "dependencies.yaml
doesn't exist because the developer forgot to configure it properly." The former is easy to mark with some sort of marker file or a setting that gets written to pyproject.toml
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a setting that gets written to
pyproject.toml
Maybe we should have this anyway, instead of assuming that the user doesn't want dependencies.yaml
just because they forgot to include it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other things about this project would need to change to support sdists too.
The relative paths that reach up above pyproject.toml
, like this:
[tool.rapids-build-backend]
dependencies-file = "../../dependencies.yaml"
are unlikely to work in an sdist
, where I'd expect pyproject.toml
to be at the root of the file layout.
This is just another place that's exposing the tension between building from an sdist vs. the file layout in source control (#17 (comment)).
From my perspective, having rapids-build-backend
be stricter here (raising an error if the file that dependencies-file
points to does not exist) is useful at this stage of development, where we're only building wheels and don't know the exact shape of what building RAPIDS sdists would even look like (#17 (comment)).
But if we don't want to do that, then I think raising this warning is sufficient (to at least help with debugging mistakes like the one I made in cudf
) and that we shouldn't try to add configuration to differentiate between the sdist vs misconfiguration distinction. I think any attempt to do that is going to be difficult to review without knowing what we want out of sdist support, and that sdist support isn't a high priority right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I raised the sdist discussions, but I am also leaning towards us not needing to plan for them right now. I think it's causing additional complexity that isn't merited at this stage. I'd be fine with being stricter now and loosening up restrictions if and when we decide that we want to support sdists. The current state is a bit confusing because the backend does wrap the wrapped backend's build_sdist
call correctly right now, which makes it seem like we support sdists, but I don't want to remove that stuff. For now we can leave it in whatever half-supported state is convenient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok thanks for that!
I think we should proceed right now with adding this warning, and defer any other changes related to this.
I spent an hour debugging issues in my cudf
PR that had the root cause "misconfigured dependencies-file
". Having this case be an error would have saved me 59 of those 60 minutes... having this result in a warning would have saved me 58 of those 60 minutes. So the warning gets most of the benefit I wanted out of this discussion, and leaves the library in a state where it's possible to experiment with sdists.
@KyleFromNVIDIA I just updated this to latest main
now that you merged #30 and #32 . I think we should merge this and then cut a release.
I changed it back for 2 reasons:
|
Indeed there are, but I think |
Description
Contributes to rapidsai/build-planning#31.
Related to #24.
This proposes the following changes:
dependencies-file
does not exist, emit a warningNotes for Reviewers
Why add this warning?
While testing rapidsai/cudf#15245, I observed
rapids-build-backend==0.1.1
failing to update the build dependencies of wheels.This showed up with errors like the following:
It took me maybe an hour to figure out what was going on.... I wasn't setting
dependencies-file
in the[tool.rapids-build-backend]
configuration.cudf
is laid out like this:Not setting
dependencies-file
meant thatrapids-build-backend
defaulted to"dependencies.yaml"
(e.g.cudf/python/cudf/dependencies.yaml
).That file doesn't exist, and so it just silently skipped all
dependencies.yaml
-related stuff via this:rapids-build-backend/rapids_build_backend/impls.py
Lines 170 to 175 in 97a1950
With the warning added in this PR, I would have at least had a hint from CI logs pointing me at the potential problem.
Why change the default?edited: removed (click me)
"./dependencies.yaml"
(e.g.,dependencies.yaml
located next to the wheel'spyproject.toml
) is not a working default for any RAPIDS project, as far as I know.In my experience, most of them are either laid out like
cuml
:Or like
rmm
See https://github.com/search?q=%22%5Bproject%5D%22+org%3Arapidsai+path%3Apyproject.toml&type=code.
Changing to
../dependencies.yaml
would at least automatically work for some projects (likecuml
) with minimal risk of reaching up outside of the repo to some other project'sdependencies.yaml
(which would be more of a risk with, say,../../dependencies.yaml
.Could we just make this a hard error instead of a warning?
I think we should!
I'd personally support being even stricter at this point in development and making an existing
dependencies.yaml
file a hard requirement for runningrapids-build-backend
, meaning:dependencies-file
dependencies-file
doesn't existIf we can't think of an existing case that requires running this without a
dependencies.yaml
, then I think we should implement this stricter interface. Making something more flexible later is always easier than making it stricter, and this strictness right now will save some developer time (e.g. would have saved me some time working oncudf
today).