-
Notifications
You must be signed in to change notification settings - Fork 14
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
RFC: Toolchain #27
RFC: Toolchain #27
Conversation
…ia `install/uninstall/update`.
I think that pinning the node version of an installed binary to the version in that project's So pinning the user version to the version that was used to develop a tool only applies for user tools that aren't explicitly specified in a given project. Which (should) mean that they have no impact on the reproducibility of builds for that specific project, because if they did have an effect, then you would want to add that dependency to the project and we would be back on the above use case. Furthermore, there are a couple of similar concepts that are being conflated by using the Lastly, pinning a user tool to the platform specified in that tool's Alternatively, we could even not pin the platform for a user tool at all, and simply use the current user platform whenever the tool is executed. That would open potential issues with compatibility, but I would have to guess that those are relatively rare, since that more closely matches the current status quo. It would also make the Notion user experience easier to understand: If you are running in a project with |
After typing that all out, I think my proposal would be simplification to: If you are in a project, we use that project's To help with any weird corner cases that might come up, I also thought of having a |
@charlespierce I'm replying to a couple things you wrote above:
Pinning the user tool to a specific platform should have no affect on the platform the user is running on their machine. And vice-versa: if the user changes their active platform, it should not break the user tool. The idea is that the user tool is installed like a standalone binary, which is statically linked to a specific platform, apart from whatever platform they have installed. So in a typical scenario, the user runs The way things are now outside of Notion, whenever you install a new version of That kind of leads into this as well:
I don't think there is any way we can guarantee that a package installed using one version of Node will necessarily work when run using a different version of Node, especially between major versions. To keep user tools working as expected we have to statically pin them to a specific platform, until the user does a |
@mikrostew That's reasonable about Tool Bitrot making pinning the platform a desired aspect so that the tool will always work, regardless of what else changes. I still feel like double-dipping the At the very least it's a potential source of confusion for a user: If I have my user platform set to use Node 11.6.0 and run |
@mikrostew wrote:
Yeah, I believe this is an important requirement.
I agree, and in fact I think this is part of making the choice of platform more under the user's control. When I install a tool like The way I see this is:
@charlespierce wrote:
Yes! I've had this in the back of my head but didn't write it up. I'll mention it in the RFC.
I think this is a fair concern. Maybe it's worth considering an optional syntax allowing a project to specify distinct dev vs prod platforms. By default, "platform": {
"node": "11.8.0"
}, but maybe we could allow you to specify: "devPlatform": {
"node": "11.8.0"
},
"platform": {
"node": "10.5.0"
} to be consistent with naming conventions like |
It's also good to break this down into representative scenarios for each case:
Going through them case by case:
|
I like the potential idea of a Regardless, however, I don't think it's a major issue or a blocker for MVP in any way, just something to keep in our minds as adoption (hopefully) grows. |
There's also a 4th use-case, that at least early on, I suspect will be pretty common: A user with Notion installed is working on an OSS project that doesn't specify a platform. In this case, we treat it the same as the "global context" case: Using the user platform and the pinned platform for any installed tools. However, if the installed tool is a dependency of the project (e.g. |
Oh, this made me realize: we actually may want to use something more like As you say, specifying a precise version is a development concern. For deployment, you probably don’t want to have to be as precise, and you probably want to allow customers to use newer versions of Node than the particular one you chose at the time of shipping. And that’s really what the That also has the benefit of reusing an existing standard and not needing to work so hard to bootstrap the ecosystem. |
@dherman I like the idea of using the |
This has been an edifying thread. I’ll update the RFC! I think this also should be enough clarity to help me update the docs for the web site too. |
- Rename `"platform"` key back to `"toolchain"` - Use standard Node "engine" terminology instead of "platform" - Use `"engines"` for choosing the default engine of a package binary - Fix the definition of "toolchain"
Follow-up from a video discussion a few of us had today: we ended up convincing ourselves we prefer to original
|
LOL, we had yet another discussion about the name of the key, and @charlespierce made the case in volta-cli/volta#412 for |
This RFC is also overdue for merging -- I updated a few bits that were out of date but otherwise it pretty much describes the current state of the design, so I'm going to merge. |
This RFC supersedes #21 and #22.
Rendered