- 
                Notifications
    
You must be signed in to change notification settings  - Fork 1
 
Respect the "NO_APM_DEDUPE" env var on Windows (affects the postinstall script) #70
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
Respect the "NO_APM_DEDUPE" env var on Windows (affects the postinstall script) #70
Conversation
:: is the comment indicator in batch scripts, not # like in most languages.
This environment var is already used for this purpose on Linux/macOS. We should respect this env var on Windows, too.
134c2fc    to
    6c4cd20      
    Compare
  
    | 
           Hmm... 
 I am disappointed to find that this was not actually true. It doesn't matter if deduping is disabled or not.  It still allows disabling deduping with the same env var as on Linux/macOS, but there is little difference when installing   | 
    
| 
           Okay, I found out this does work in normal circumstances! It just doesn't work very well with using  Testing notes (click to expand):It does work some of the time. Investigating whether this is: 
 @aminya if you want to enable installing  ... I will make a PR for upstream   | 
    
| 
           Here's the upstream PR: atom#912  | 
    
| 
           Can't we get rid of deduping altogether? Does deduping make any difference in the size of  The impression I get from this blog post is that deduping happens automatically. Running it afterward does not have any effect.  | 
    
| 
           Yes we can eliminate deduping for this fork. I was thinking about this, and even for upstream I am considering proposing that the default change to "not deduping." 
 Yes, I think that's mostly true. I think  There are some cases where  [Edit: actually, the same technique is used as with the rest of Atom's dependencies... If I read correctly, the build scripts  But most of the time, running  One last thought: This only matters when upgrading  In summary, my thoughts:I think this should be off by default, but people should still be in the habit of manually running   | 
    
| 
           @aminya which option do you like best for this fork?: 
 (Whatever we pick, I want to handle it the same way in both the   | 
    
| 
               | 
          ||
| # parallel node-gyp | ||
| :: parallel node-gyp | ||
| setx JOBS 16 | 
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.
| setx JOBS 16 | |
| setx JOBS max | 
| 
           Steps left to fix the build for community fork of Atom: 
 If you want me to open PRs for any of this, I'm up for it.  | 
    
| 
           Let's remove deduping now.  | 
    
Requirements
Description of the Change
Linux and macOS have respected a
NO_APM_DEDUPEenv var for a long time. If this env var is set, the postinstall script skips deduping (for these OSes, this is handled inscript/postinstall.sh).This PR adds a couple of lines to the Windows-specific
script\postinstall.cmdfile to do the same thing on Windows.Alternate Designs
None.
Benefits
This should enable installing
apmwithnpm ci --global-stylein Atom'sscript/bootstrap.Which in turn means we can have reliable, stable bootstrapping, when desired, for the Atom repo.
That turned out not to be true. So, there is very little benefit. At least an env var that works on Linux and macOS will work on Windows with this PR merged. But there is little difference when installing apm with or without deduping.Update: This does work, in fact, in the usual use-case. Just not when specifying
apmas a git URL dependency.Possible Drawbacks
None.
Verification Process
For this repository on its own:
I ran
npm run postinstallandnpm installwith this env var set (set NO_APM_DEDUPE=trueincmd.exe).Deduping was successfully skipped, and a message was printed out (
>> Deduplication disabled) to indicate that this is happening on purpose.I also tested installing
apmin Atom withnpm cilike this:cd atom\apmNO_APM_DEDUPE=truenpm cinpm ci, quickly afterapmis extracted, copy over the modifiedscript\postinstall.cmdand overwrite the existing, non-patched one. We want to patchscript\postinstall.cmdin a stable version ofapm.>> Deduplication disablednpm ls, and observe that no packages are reported missing.(Live-patching this file will no-longer be needed once this PR is merged and shipped in a stable release of
apm.)Applicable Issues
None.