Skip to content
This repository has been archived by the owner on Dec 3, 2018. It is now read-only.

Windows support #315

Closed
6 tasks done
springmeyer opened this issue Apr 22, 2014 · 21 comments
Closed
6 tasks done

Windows support #315

springmeyer opened this issue Apr 22, 2014 · 21 comments
Assignees

Comments

@springmeyer
Copy link
Contributor

TM2 does not work on windows yet, but it should be feasible to port it and have it work reasonably well in a modern browser like Chrome.

This ticket stands to track this task.

Porting will require:

@springmeyer
Copy link
Contributor Author

Updated the list of broken things above. We're not very far off from supporting windows. The problems are restricted to filesystem stuff. By working around the app.db problem I got the default project to load:

screenshot 2014-04-25 14 17 38

@yhahn yhahn self-assigned this May 13, 2014
yhahn added a commit that referenced this issue May 13, 2014
@yhahn
Copy link
Member

yhahn commented May 13, 2014

Above commit should (?) fix no 2 EPERM issue.

@yhahn yhahn mentioned this issue May 13, 2014
@springmeyer
Copy link
Contributor Author

EPERM issue is fixed, thanks! Tested on windows and updated the above checkboxes to reflect that saving styles also works now. File browser is still broken (does not display any entries and does not allow moving up a directory) so I can't yet test source creation:

@yhahn
Copy link
Member

yhahn commented May 13, 2014

Word, will consider that next up.

@springmeyer
Copy link
Contributor Author

seeing this when I try to open the browser and click up a directory:
screenshot 2014-05-13 13 33 53

@wilhelmberg
Copy link
Contributor

EPERM, open still exists on Windows when app.db does not exist.
After I created an empty file tm2 was able to start and load the default project.

@springmeyer
Copy link
Contributor Author

@BergWerkGIS okay, perhaps a fs.exists check could be added to https://github.com/mapbox/tm2/blob/master/lib/tm.js#L81-L96 to avoid that first run problem. Want to give that a shot?

@wilhelmberg
Copy link
Contributor

Sure.

@wilhelmberg
Copy link
Contributor

@springmeyer
Hmh, probably I'm missing some context here, because some strange things are going on that I don't fully understand.

tl;dr:
Inserting if (!existsSync(filepath)) { fs.writeFileSync(filepath, ""); }
as the first line in dbcompact solves the problem.
Seems like a dirty hack to me, though.


If the app.db does not exist it is created via var old = dirty(filepath); and is available to unlink, which succeeds.
Nevertheless creating the new db with var db = dirty(filepath); doesn't seem to be successful, because at entry of dbmigrate it is not available.
Neither is it possible to create a new file at that code location (EPERM).
The error thrown EPERM, open seems to come from another location, because db.get('version') in dbmigrate returns undefined and the switch isn't executed.

On the other hand, if app.db exists (even if it is an empty file created with the patch mentioned above) everything works as expected and I'm shown the Connect your Mapbox account page.

@yhahn
Copy link
Member

yhahn commented Jun 10, 2014

@BergWerkGIS I pushed an adjustment based on your notes to the dbcompact-winfix branch -- the idea being to not attempt to do db compaction (e.g. reading the db into memory and then unlinking the stale file) if the db doesn't exist in the first place.

Would love to know how it does for you -- I'll try to get tm2 up and running on a VM sometime today so I can debug more directly.

@wilhelmberg
Copy link
Contributor

@yhahn cannot test your adjustment: I was testing with an older commit (unfortunately don't remember which one exactly), because latest source fails at installing node-blend.
tm2-blend

@wilhelmberg
Copy link
Contributor

@yhahn I saw that your latest commit worked on AppVeyor, so I tested on two different machines with node 0.10.26, 0.10.28 and 0.10.29.

I always deleted the tm2 folder completely and started from scratch.

With 26/28 I get varying results: sometimes node-srs gets rebuilt, sometimes not.
Sometimes it fails like in the screenshot of my previous comment.

With 29 nothing gets compiled, but this error is shown:
tm2-abaculus

A manual npm install abacus produces the same error as in the screenshot of my previous comment.

@wilhelmberg
Copy link
Contributor

@yhahn I tried to get pkg-config working as this what abacus seems to be looking for.
I used precompiled files from here: http://www.gtk.org/download/win32.php
Error now is No package 'libpng' found.
Any ideas?
abacus-pkgconfig

@wilhelmberg
Copy link
Contributor

@springmeyer @yhahn

Ok, worked my way thru the commits.

This is the last one that is working for me: Merge pull request #414 from mapbox/tv102.

The next one (abaculus updated for headers) isn't.
It fails with the pkg-config error.

@yhahn
Copy link
Member

yhahn commented Jun 11, 2014

@BergWerkGIS yeah, for now I've removed the abaculus dependency from https://github.com/mapbox/tm2/tree/dbcompact-winfix and am focusing on getting the tests pass without it. Not trying to even run the app yet : )

@springmeyer is looking at mapbox/node-blend#48 so once that is resolved we can re-add the dep.

@wilhelmberg
Copy link
Contributor

@yhahn Ok, wasn't aware about that.

Just to let you know how the latest commit looks like on my main machine.
npm install is only successfull with node 0.10.29 32bit. Previous versions fail.

tm2-npm-test-01

tm2-npm-test-02

@springmeyer
Copy link
Contributor Author

after #457 appveyor builds are now showing errors in the logs (https://ci.appveyor.com/project/Mapbox/tm2/build/1.0.4#L990) - which look similar to @BergWerkGIS's logs above.

@yhahn
Copy link
Member

yhahn commented Jun 24, 2014

#468

appveyor builds are now completing and passing. This gets us CI for the server component of tm2 -- next up for me is seeing if we can get our browser tests running + passing on windows.

@yhahn
Copy link
Member

yhahn commented Jun 24, 2014

#469

client-side testing in place. I haven't actually used the app on windows much and I see that as the next step as our tests are far from comprehensive.

@wilhelmberg
Copy link
Contributor

This is, what it looks like on my machine (cannot add any data 😭 ):
tm2

@yhahn
Copy link
Member

yhahn commented Aug 5, 2014

Closing this out in favor of more specific tickets now.

@yhahn yhahn closed this as completed Aug 5, 2014
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