-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
Fixing --preserve-symlinks. Enhancing node to exploit. #10107
Comments
This is great! We need it! cc @alexanderGugel, @wmhilton, @iamstarkov, @rstacruz |
I think the naming of the adjacent node_modules should not be a valid npm package name. Someone can publish a package named |
|
I don't insist but this is easy to change and I think solves an edge case. |
What about instead of |
@zkochan Thought a little more, and I think the So I'm just going to change that tonight. |
@phestermcs the patterns and semantics for file locations and behaviors you're defining in this thread would I think fit perfectly with work in the version-management discussion group, see e.g. nodejs/version-management#3 and nodejs/version-management#12. /cc @jasongin |
@joshgav Reading the discussions on the repo, they seem to be more about managing multiple versions of Our discussion here is merely about what specific character to use to distinguish a directory name, and it appears given what can be used and prior convention, the one best character is the Or am I completely missing something? |
@phestermcs
I see 💡 . Okay, well at least that group is now aware of your concerns too. Thanks! |
There's a lot of pitching going on in this thread, but is there a succinct explanation of what the proposed changes are? Could you rebase your branch onto master so that it would be easier to review the changes? I'm not sure what is being proposed, or how it differs from discussions in the past around handling symbolic links in the module loader. |
@phestermcs ... first off, thank you for the effort that you've put into this. Given how critical the module system is to Node.js, we will have to carefully consider the change that you are proposing. The preferred approach for something like this would be to open a enhancement proposal in the https://github.com/nodejs/node-eps repository that expands on the detail that you have provided here. Ideally that proposal would evolve into a pull request that we can evaluate and review more directly. Backwards compatibility is going to be the most significant factor when reviewing this so please keep that in mind. |
There are two things we need: The EPS and a pull request. This is unlikely to get significant review until either/both of those arrive. |
I'd start by simply copying the text of your original post into the EPS and seeing where the discussion leads. As I have the opportunity over the coming couple of weeks I'll try to dig in on this to start reviewing. |
No, they are not, that's what I'm saying. The superlatives and format changes are very distracting. I'd just look at a set of diffs, but since it's not based off master, I'm unsure that what I'm seeing is actually the changes being suggested. The links to code in the |
Deep breath everyone. Let's not waste time hand wringing over communication styles and focus on the code, shall we? @phestermcs, thank you for the PR. It is much appreciated. It will take a couple weeks, I think, to do a proper review so I ask for your patience. :) |
Absolutely reasonable! I see @mscdex has already jumped in to handle some of the style nits. I'll continue discussion over in the PR! |
@phestermcs I get the feeling that you are expecting more backlash here than you’ll actually receive, and try to answer criticism for your PR before that is even voiced. In any case, it’s a plus to see that you’ve thought this through. Your PR isn’t huge (which is a good sign), and we’ll get to review it and talk about it. I think I’m pretty much agreeing with Isaac here, so maybe it helps if I try to rephrase what he’s saying: I can assure you that you have offended neither @isaacs nor @thealphanerd. They are both people who I fully trust to give everybody a fair treatment, and I would read the comment I believe you are referring to as asking for a better way for us to understand your perspective. (Also, another tiny tip: Using |
All PRs for new changes are made against master and must land there first. From there we will cherry-pick changes back to the release branches. We do no accept changes to release branches that have not yet landed in master |
@phestermcs You haven't offended me, but I appreciate your concern and eagerness to be respectful, and your kind words about my software development expertise. I'm often slow to respond because I run a startup and have a young baby, and both things eat into my OSS time. Reviewing your summary now. |
This is certainly exciting!! Looking at the changes now. |
@phestermcs You seem to use it to precede things that are long and detailed instead. I don't (I hope) normally nit-pick about such things in a lengthy issue tracker conversation, but every time you've used So above, where you have "Succinctly?" That's a TL;DR (at least in my experience). Below, where you have TL;DR? That's more like "All The Details" or something (again, in my experience at least). |
ftr. i removed several comments as they were irrelevant to the issue and inappropriate. |
A working prototype that enables using symlinks to machine level module stores, so modules no longer need to be physically copied and duplicated wherever they're used on a given machine. This is accomplished by:
__dirname
of the "main" entry module to the preserved path passed on the command line, or if it's a file-symlink, using its target path. This is intended to start the program off in the right symbolic path space, to address tooling problems resulting from the current behavior, where__dirname
is always the fs.realpath().require()d
modules, always using the preserved path of its directory location as its__dirname
, but always using itsrealpath
as the module cache key. This resolves the memory bloat and add-on crashing problems while still letting resolution happen within the symbolic path space.somemod+node_modules
directory paths after the subordinatesomemod/node_modules
, the directory structure dictating dependency version resolution can still be bound and specific to a given top-level/node_modules
, but can now be completely decoupled from the physical directories of the modules involved.The text was updated successfully, but these errors were encountered: