Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Issue building atom on Windows #14264

Closed
Closed

Description

@shanept

Prerequisites

Description

In attempting to build Atom from source on Windows 10, I am presented with an issue that a "path, file name, or both are too long".

Steps to Reproduce

  1. Checkout latest commit (currently 1fc23c3)
  2. script/build --create-windows-installer --compress-artifacts

Expected behavior: Atom builds, providing installer

Actual behavior: Build fails during creation of installer

Reproduces how often: 100%

Versions

OS: Windows 10 Pro x64
Node: v6.10.2
NPM: v3.10.10
Python: 2.7.12

Also, I am using Visual C++ Build Tools 2015.

Additional Information

My repo is checked out to c:\atom to get the path as short as possible. I have run npm dedupe on my node_modules in both the repo base and the 'out' directories at different points to attempt to get rid of this error - I am using NPMv3 so I believe this is not needed anyway.

Here is a snippet of the build output with debugging:

Verifying if snapshot can be executed via `mksnapshot`
Generating startup blob at "C:\atom\out\snapshot_blob.bin"
Moving generated startup blob into "C:\atom\out\Atom x64\snapshot_blob.bin"
Skipping code-signing. Specify the --code-sign option and provide a ATOM_WIN_CODE_SIGNING_CERT_DOWNLOAD_URL environment variable to perform code-signing
Creating Windows Installer for C:\atom\out\Atom x64
Thu, 20 Apr 2017 03:04:54 GMT electron-windows-installer:spawn Spawning C:\atom\script\node_modules\electron-winstaller\vendor\rcedit.exe C:\atom\out\Atom x64\Update.exe --set-icon C:\atom\resources\app-icons\dev\atom.ico
Thu, 20 Apr 2017 03:04:54 GMT electron-windows-installer:fs-utils Error: ENOENT: no such file or directory, stat 'C:\atom\out\Atom x64\resources\app.asar'
  at Error (native)
Thu, 20 Apr 2017 03:04:54 GMT electron-windows-installer:main Created NuSpec file:
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
  <metadata>
    <id>atom</id>
    <title>Atom</title>
    <version>1.18.0-dev-41f0d5825</version>
    <authors>GitHub Inc.</authors>
    <owners>GitHub Inc.</owners>
    <iconUrl>https://raw.githubusercontent.com/atom/atom/master/resources/app-icons/dev/atom.ico</iconUrl>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description>A hackable text editor for the 21st Century.</description>
    <copyright>Copyright © 2017 GitHub Inc.</copyright>
  </metadata>
  <files>
    <file src="locales\**" target="lib\net45\locales" />
    <file src="resources\**" target="lib\net45\resources" />
    <file src="*.bin" target="lib\net45" />
    <file src="*.dll" target="lib\net45" />
    <file src="*.pak" target="lib\net45" />
    <file src="Update.exe" target="lib\net45\squirrel.exe" />
    <file src="icudtl.dat" target="lib\net45\icudtl.dat" />
    <file src="LICENSE" target="lib\net45\LICENSE" />
    <file src="atom.exe" target="lib\net45\atom.exe" />
  </files>
</package>
Thu, 20 Apr 2017 03:04:54 GMT electron-windows-installer:spawn Spawning C:\atom\script\node_modules\electron-winstaller\vendor\nuget.exe pack C:\Users\SHANE~1.AEO\AppData\Local\Temp\si-117320-944-68ih1h.cxazcl3di\atom.nuspec -BasePath C:\atom\out\Atom x64 -OutputDirectory C:\Users\SHANE~1.AEO\AppData\Local\Temp\si-117320-944-68ih1h.cxazcl3di -NoDefaultExcludes
Thu, 20 Apr 2017 03:18:49 GMT electron-windows-installer:main Attempting to build package from 'atom.nuspec'.
Successfully created package 'C:\Users\SHANE~1.AEO\AppData\Local\Temp\si-117320-944-68ih1h.cxazcl3di\atom.1.18.0-dev-41f0d5825.nupkg'.

Thu, 20 Apr 2017 03:18:49 GMT electron-windows-installer:spawn Spawning C:\atom\script\node_modules\electron-winstaller\vendor\SyncReleases.exe -u https://atom.io/api/updates-x64?version=1.18.0-dev-41f0d5825 -r C:\atom\out
Thu, 20 Apr 2017 03:19:47 GMT electron-windows-installer:main Attempting to sync URL as remote RELEASES folder
Trying to download RELEASES index from https://atom.io/api/updates-x64/RELEASES?version=1.18.0-dev-41f0d5825
Downloading release from https://atom.io/api/updates-x64/atom-1.16.0-full.nupkg

Thu, 20 Apr 2017 03:19:47 GMT electron-windows-installer:spawn Spawning C:\atom\script\node_modules\electron-winstaller\vendor\Update.com --releasify C:\Users\SHANE~1.AEO\AppData\Local\Temp\si-117320-944-68ih1h.cxazcl3di\atom.1.18.0-dev-41f0d5825.nupkg --releaseDir C:\atom\out --loadingGif C:\atom\resources\win\loading.gif --setupIcon C:\atom\resources\app-icons\dev\atom.ico
Deleting downloaded nupkg for previous version at C:/atom/out/atom-1.16.0-full.nupkg to prevent it from being stored as an artifact
Error: Failed with exit code: 4294967295
Output:
System.IO.PathTooLongException: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
   at System.IO.PathHelper.GetFullPathName()
   at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
   at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
   at Squirrel.DeltaPackageBuilder.createDeltaForSingleFile(FileInfo targetFile, DirectoryInfo workingDirectory, Dictionary`2 baseFileListing)
   at Squirrel.DeltaPackageBuilder.CreateDeltaPackage(ReleasePackage basePackage, ReleasePackage newPackage, String outputFile)
   at Squirrel.Update.Program.Releasify(String package, String targetDir, String packagesDir, String bootstrapperExe, String backgroundGif, String signingOpts, String baseUrl, String setupIcon, Boolean generateMsi)
   at Squirrel.Update.Program.executeCommandLine(String[] args)
   at Squirrel.Update.Program.main(String[] args)
   at Squirrel.Update.Program.Main(String[] args)

  at ChildProcess.proc.on.code (C:\atom\script\node_modules\electron-winstaller\lib\spawn-promise.js:62:16)
  at emitTwo (events.js:106:13)
  at ChildProcess.emit (events.js:191:7)
  at maybeClose (internal/child_process.js:886:16)
  at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)

Activity

  1. damieng commented on Apr 20, 2017

    @damieng
    Contributor

    Hmm, can you try creating a c:\temp folder and putting typing SET TEMP=c:\temp in your command prompt before issuing the build command? (This won't change temp for your machine just for that command window while it is open)

  2. added
    windows
    on Apr 20, 2017
  3. shanept commented on Apr 21, 2017

    @shanept
    Author

    Unfortunately that doesn't seem to change anything - I still have the error here.

  4. damieng commented on Apr 21, 2017

    @damieng
    Contributor

    Hmm, not sure what else to suggest. If you just want to build atom you don't normally need to use --create-installer - it's used to create the .exe and .msi setup systems and can take some time as well. the -compress-artifacts flag will give you a zip you can use if that helps.

  5. shanept commented on Apr 21, 2017

    @shanept
    Author
  6. damieng commented on Apr 21, 2017

    @damieng
    Contributor

    Was the output exactly the same when you set TEMP? The locations of the files should have been different.

  7. shanept commented on Apr 22, 2017

    @shanept
    Author

    Maybe some of the paths may have changed, but it ultimately resulted in the same error in the same place.

  8. damieng commented on Apr 24, 2017

    @damieng
    Contributor

    https://github.com/Squirrel/Squirrel.Windows/blob/master/src/Squirrel/DeltaPackage.cs#L148 is the point where things went awry in squirrel - this function is mostly performing operations creating temporary files using your temp folder.

    Your temp folder is longer than the one I personally use to build Windows and longer than the one we use on the build server both of which are working fine right now. It might be worth creating a c:\temp and setting TMP and TEMP to that from your system settings (then re-open the command window to take effect)

  9. damieng commented on May 17, 2017

    @damieng
    Contributor

    No further response.

  10. damieng commented on May 24, 2017

    @damieng
    Contributor

    Found something else you can try if you're still stuck;

    MKDIR C:\squirreltemp
    SET SQUIRREL_TEMP=C:\squirreltemp

    Might get you past it - we just ran into a length issue on our build server and this helped.

  11. gigibiffi84 commented on Jul 12, 2017

    @gigibiffi84

    Hi @damieng i was facing with same problem and overriding SQUIRREL_TEMP variables solves the issue thk for your suggest!! However i had to define a global env variable beacuse setting it from command line does not take effect.

  12. shanept commented on Aug 16, 2017

    @shanept
    Author

    Hi @damieng

    Sorry, it's obviously been quite a while since I last looked at this. However, setting that environmental variable has done the trick and I have now managed to compile a Windows installer.

    Now, I am attempting to run the install, and it failed until I set SQUIRREL_TEMP as an environmental variable for my user account. This can't be right? Is there something else you guys are doing to get around this?

    Thanks

  13. damieng commented on Aug 16, 2017

    @damieng
    Contributor

    Our installers don't typically have this problem however if your temp path is long it might be necessary (the default is within your user folder so longer user names can cause this)

  14. shanept commented on Aug 17, 2017

    @shanept
    Author

    I don't think my user folder is all that long, and my username is only five characters. I guess it must be due to the dev build having a long name. I've figured out a workaround for now.

    Thanks

  15. damieng commented on Aug 17, 2017

    @damieng
    Contributor

    What do you mean 'dev build' having a long name? Is the workaround to set SQUIRREL_TEMP?

  16. lock commented on Mar 31, 2018

    @lock

    This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!

  17. locked and limited conversation to collaborators on Mar 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    build-errorwindows

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions