Skip to content
This repository was archived by the owner on Sep 26, 2018. It is now read-only.

Allow user to rebuild incompatible packages against the current version of Atom - #9

Merged
nathansobo merged 15 commits into
masterfrom
ns-mb-rebuild
Sep 8, 2015
Merged

nathansobo merged 15 commits into
masterfrom
ns-mb-rebuild

Conversation

@nathansobo

Copy link
Copy Markdown
Contributor

This PR depends on core APIs introduced in atom/atom#8475.

rebuild-packages

Tasks

  • Remove extra text
  • Add rebuild all button
  • Disable rebuild button when package rebuild starts
  • Indicate rebuild in progress for each package
  • When build succeeds, indicate it
  • When build fails, indicate it with error messages
  • Persist build failure and don't load packages that failed to build (atom/atom PR pending)
  • Add button linking to package settings
  • When all rebuilds complete, show notification with a reload button

Testing Tips

The easiest way to make an incompatible package is to take a package that has native dependencies and run npm rebuild to compile it against the Node headers. I use the following:

  • spell-check
  • dev-live-reload Make sure you're checked out to 0.46.0.

For both these packages do the following:

  • rm -rf node_modules
  • apm install
  • npm rebuild
  • apm link -d

Now both should show up in your incompatible packages listing in dev mode.

To create a build failure, add some random syntax error in spell-check/node_modules/spellchecker/src/main.cc before rebuilding. Be aware: The rebuild failure will be persisted until the next time you click rebuild.

@kevinsawicki

Copy link
Copy Markdown
Contributor

Awesome, thanks so much for getting this going 👍

@maxbrunsfeld
maxbrunsfeld force-pushed the ns-mb-rebuild branch 2 times, most recently from 6050a8c to 866938c Compare August 19, 2015 17:10
@nathansobo
nathansobo force-pushed the ns-mb-rebuild branch 3 times, most recently from 4469fe8 to f25c670 Compare August 20, 2015 23:37
@nathansobo

Copy link
Copy Markdown
Contributor Author

@simurai Heads up... I'm going to do this kinda ugly and ask for you to swoop in with some design sauce. I have a decent amount of the logic in place. The basic flow is as follows:

  • If there are no incompatible packages, user is presented with a message saying this.
  • If there are incompatible packages, user is told this and there's a rebuild button.
  • The user is presented with all packages containing incompatible node modules, with the individual modules listed along with the reason they are incompatible.
  • When the user clicks rebuild all, each package rebuilds in sequence... we need to indicate this is in progress.
  • When a package rebuilds cleanly, we need to indicate this somehow.
  • When a package fails to rebuild, we need to show an error message.

Also, if you whip up a mockup of some sort I could also just implement it.

@thomasjo thomasjo mentioned this pull request Aug 21, 2015
20 tasks done
@simurai

simurai commented Aug 21, 2015

Copy link
Copy Markdown

@nathansobo I think you already started. I can brush over it on Mon/Tue. You don't have to worry about styling as long as it works.

@nathansobo

Copy link
Copy Markdown
Contributor Author

I added an animated GIF to first comment to illustrate today's progress. Almost there except for the interaction following build failure.

@thomasjo If you want to work on adding back the buttons to uninstall upgrade and create issues, that would be 🏀er. I'm thinking we shouldn't display the create issue button unless we know the user is up to date... I updated the checklist accordingly and added some hints about testing this in dev mode to the body.

@nathansobo

Copy link
Copy Markdown
Contributor Author

Oh, I almost forgot, this depends on APIs introduced in atom/atom#8475.

@thomasjo

Copy link
Copy Markdown
Contributor

Kinda hit a roadblock since there's no API for either uninstalling packages or checking for updates. All of that stuff is located in the settings-view (and apm of course). Do we simply want to copy and paste the relevant code from settings-view, or should we expose it somehow?

Current behavior is simply to offer ability to check for updates, report issue, and disable the package.

@thomasjo

Copy link
Copy Markdown
Contributor

How do we want to deal with linked packages? I'm assuming we won't check for updates for those packages, so should we always display a Report Issue button in that case?

And what about the uninstall button? Should we display a Disable button instead when the package is linked instead of installed?

Doesn't do anything yet, since we have no standard API for uninstalling
packages (nor checking for available updates).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nathansobo 🔥 This method? It's no longer being used.

@nathansobo

Copy link
Copy Markdown
Contributor Author

@thomasjo Okay, I just added a link to the package settings.

@simurai This is ready for some 🎨 from you. You can follow the steps listed in the body to get it into different states. My main concern is the relationship between the settings button and the badge.

@simurai

simurai commented Aug 25, 2015

Copy link
Copy Markdown

@nathansobo Got spell-check into an incompatible state. But having problems with this branch. I did:

  1. Checkout incompatible-packages/tree/ns-mb-rebuild
  2. Checkout atom/tree/ns-rebuild-packages
  3. Run script/build. First time got an error. Second time it worked.
  4. Open Atom. Now I get this error:

screen shot 2015-08-25 at 8 56 50 pm

A JavaScript error occurred in the main process

Uncaught Exception:
Error: Module version mismatch. Expected 44, got 43.
    at Error (native)
    at Object.module.(anonymous function) (ATOM_SHELL_ASAR.js:137:20)
    at Object.module.(anonymous function) [as .node] (ATOM_SHELL_ASAR.js:148:18)
    at Module.load (module.js:353:32)
    at Function.Module._load (module.js:308:12)
    at Module.require (module.js:363:17)
    at require (module.js:382:17)
    at Object.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/nslog/lib/nslog.js:5:11)
    at Object.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/nslog/lib/nslog.js:15:4)
    at Module._compile (module.js:428:26)

Did I miss something else? It looks the same as @lee-dohm's error here: atom/atom#7877 (comment)

@nathansobo

Copy link
Copy Markdown
Contributor Author

@simurai Ah shit I rebased on top of the Electron upgrade for testing everything combined.

@simurai

simurai commented Aug 27, 2015

Copy link
Copy Markdown

@nathansobo Will the Electron upgrade land in master soon? Or will this PR go first? I can try to rebase too, although I somehow already messed up Atom with switching branches.

My main concern is the relationship between the settings button and the badge.

Based on the gif.. ya, the badges might look a bit like they could be buttons and not just some status indicator. Maybe the badges could only be used for the icons and not include the text. But that can also be changed later, after this shipped.

@nathansobo

Copy link
Copy Markdown
Contributor Author

Electron upgrade will be landing very soon. Let's just wait until then to proceed with styling changes.

@nathansobo

Copy link
Copy Markdown
Contributor Author

The build fails against the current release, but we need to bundle this to cut a new release, so I'm just going to merge due to this passing locally.

nathansobo pushed a commit that referenced this pull request Sep 8, 2015
Allow user to rebuild incompatible packages against the current version of Atom
@nathansobo
nathansobo merged commit fe709b9 into master Sep 8, 2015
@nathansobo
nathansobo deleted the ns-mb-rebuild branch September 8, 2015 17:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants