Skip to content
This repository was archived by the owner on Dec 7, 2021. It is now read-only.

Support Windows #5

Open
klaussner opened this issue Aug 12, 2017 · 4 comments
Open

Support Windows #5

klaussner opened this issue Aug 12, 2017 · 4 comments

Comments

@klaussner
Copy link
Owner

klaussner commented Aug 12, 2017

Package cache differences on Windows:

  • Located at ~\AppData\Local\.meteor\packages
  • No symlinks
@dossorio
Copy link

hey @klaussner do you need a hand with this ? I am on windows so I could help, do you have any ideas on how to implement it ?

@klaussner
Copy link
Owner Author

klaussner commented Sep 29, 2017

Thank you so much for offering your help, @dossorio! 😊 I've put together a list of changes that I think will be necessary for Windows support (it might be incomplete 😄):

Paths to directories in the Meteor installation are stored in lib/paths.js. For Windows, these two would have to be changed:

meteor: path.join(home, '.meteor', 'meteor'),
packages: path.join(home, '.meteor', 'packages'),

The analyzeVersions function in lib/analyze-packages.js collects all versions of a package by reading the package's directory. On Linux and macOS, such a package directory could look like this:

1.5.2_1
.1.5.2_1.9e82ly++os.linux.x86_64+web.browser+web.cordova
1.6.0-beta.24
.1.6.0-beta.24.1bc2sqg++os.linux.x86_64+web.browser+web.cordova

The directories with the short names are symlinks to the directories with the longs names in which the package code is stored. Since Meteor uses symlinks only on Linux and macOS, the directory would look like this on Windows:

1.5.2_1
1.6.0-beta.24

To support this symlink-less directory structure, you would have to adapt this part of analyzeVersions:

// Only use symbolic links to analyze versions.
if (!(status && status.isSymbolicLink())) {
return;
}
const realPath = fs.realpathSync(filePath);
const version = Version.parse(fileName);
versions.push({
version: fileName,
isPreRelease: version.prerelease.length > 0,
path: filePath,
realPath,
size: directorySize(realPath)
});

Instead of storing both the path (of the symlink) and the realPath, you could just store the path. Both values are used again when versions are deleted:

remove(version.realPath);
remove(version.path);

Let me know if you have any questions! 🙂

@dossorio
Copy link

Awesome ! I am currently away but I am back 9th October, I'll get started asap !

Thanks for that @klaussner !

@Deadly0
Copy link

Deadly0 commented Oct 20, 2017

Still no Windows support?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants