Skip to content

refactor(upgrade): use Bazel packages to avoid symlinks in the source - #29466

Closed
petebacondarwin wants to merge 5 commits into
angular:masterfrom
petebacondarwin:ngupgrade-windows-support
Closed

petebacondarwin wants to merge 5 commits into
angular:masterfrom
petebacondarwin:ngupgrade-windows-support

Conversation

@petebacondarwin

Copy link
Copy Markdown
Contributor

Previously we had to share code between upgrade/dynamic and upgrade/static
by symlinking the src folder, which allowed both packages to access
the upgrade/common files.

These symlinks are always problematic on Windows, where we had to run
a script to re-link them, and restore them.

This change uses Bazel packages to share the upgrade/common code,
which avoids the need for symlinking the src folder.

Also, the Windows specific scripts that fixup the symlinks have also
been removed as there is no more need for them.

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@petebacondarwin petebacondarwin added action: merge The PR is ready for merge by the caretaker action: review The PR is still awaiting reviews from at least one requested reviewer effort3: weeks refactoring Issue that involves refactoring or code-cleanup freq2: medium severity2: inconvenient target: patch This PR is targeted for the next patch release risk: low area: upgrade Issues related to AngularJS → Angular upgrade APIs labels Mar 22, 2019
@petebacondarwin
petebacondarwin requested review from a team March 22, 2019 10:54
@ngbot ngbot Bot added this to the Backlog milestone Mar 22, 2019

@filipesilva filipesilva left a comment

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.

Can you also remove the newly added scripts/windows/create-symlinks.cmd, and remove its usage in .codefresh/codefresh.yml?

I was trialing a new Windows CI that uses needs that script so had to add an actual windows CMD for it.

@petebacondarwin

Copy link
Copy Markdown
Contributor Author

Will do!

@gkalpak gkalpak left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Woohoo! 🎉 🎉 🎉

Comment thread packages/upgrade/common/BUILD.bazel Resolved
Comment thread packages/upgrade/common/BUILD.bazel Resolved
Comment thread tools/public_api_guard/BUILD.bazel Resolved
Comment thread tools/public_api_guard/BUILD.bazel Resolved
Comment thread packages/upgrade/BUILD.bazel Resolved
Comment thread packages/upgrade/BUILD.bazel Resolved
@gkalpak gkalpak added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews and removed action: merge The PR is ready for merge by the caretaker labels Mar 22, 2019
@petebacondarwin petebacondarwin added action: merge The PR is ready for merge by the caretaker and removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels Mar 22, 2019
@petebacondarwin
petebacondarwin force-pushed the ngupgrade-windows-support branch from 47957ac to 90b046d Compare March 23, 2019 20:02
@mhevery

mhevery commented Mar 25, 2019

Copy link
Copy Markdown
Contributor

@mhevery

mhevery commented Mar 25, 2019

Copy link
Copy Markdown
Contributor

Breaks g3:


third_party/javascript/angular2/rc/packages/upgrade/static/public_api.ts:9:84 - error TS2307: Cannot find module '../common/src/angular1'.
	to fix, run:
	taze //third_party/javascript/angular2

9 export {getAngularJSGlobal, getAngularLib, setAngularJSGlobal, setAngularLib} from '../common/src/angular1';
                                                                                     ~~~~~~~~~~~~~~~~~~~~~~~~
third_party/javascript/angular2/rc/packages/upgrade/static/public_api.ts:10:34 - error TS2307: Cannot find module '../common/src/downgrade_component'.
	to fix, run:
	taze //third_party/javascript/angular2

10 export {downgradeComponent} from '../common/src/downgrade_component';
                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
third_party/javascript/angular2/rc/packages/upgrade/static/public_api.ts:11:35 - error TS2307: Cannot find module '../common/src/downgrade_injectable'.
	to fix, run:
	taze //third_party/javascript/angular2

11 export {downgradeInjectable} from '../common/src/downgrade_injectable';
                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
third_party/javascript/angular2/rc/packages/upgrade/static/public_api.ts:12:23 - error TS2307: Cannot find module '../common/src/version'.
	to fix, run:
	taze //third_party/javascript/angular2

12 export {VERSION} from '../common/src/version';
                         ~~~~~~~~~~~~~~~~~~~~~~~
third_party/javascript/angular2/rc/packages/upgrade/static/public_api.ts:13:31 - error TS2307: Cannot find module './src/downgrade_module'.
	to fix, run:
	taze //third_party/javascript/angular2

13 export {downgradeModule} from './src/downgrade_module';
                                 ~~~~~~~~~~~~~~~~~~~~~~~~
third_party/javascript/angular2/rc/packages/upgrade/static/public_api.ts:14:32 - error TS2307: Cannot find module './src/upgrade_component'.
	to fix, run:
	taze //third_party/javascript/angular2

14 export {UpgradeComponent} from './src/upgrade_component';
                                  ~~~~~~~~~~~~~~~~~~~~~~~~~
third_party/javascript/angular2/rc/packages/upgrade/static/public_api.ts:15:29 - error TS2307: Cannot find module './src/upgrade_module'.
	to fix, run:
	taze //third_party/javascript/angular2

15 export {UpgradeModule} from './src/upgrade_module';
                               ~~~~~~~~~~~~~~~~~~~~~~

@IgorMinar IgorMinar left a comment

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.

I discussed this with Pete and we agreed that it would be better to move /dynamics and /common under src to prevent these folders to be accidentally considered and used as entry points and public api.

otherwise this change looks great once these adjustments are made.

@IgorMinar IgorMinar added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Mar 27, 2019
@petebacondarwin

Copy link
Copy Markdown
Contributor Author

Done. It'll need another presubmit.

@petebacondarwin petebacondarwin removed the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label Mar 27, 2019
@mhevery

mhevery commented Mar 27, 2019 •

Copy link
Copy Markdown
Contributor

http://test/OCL:240155732:BASE:240621012:1553716123697:cf97eb17

ERROR: third_party/javascript/angular2/BUILD:916:1: Compiling Angular templates (ngtsc) //third_party/javascript/angular2:upgrade failed (Exit 1) ngc_wrapped failed: error executing command blaze-out/host/bin/javascript/angular2/tools/ngc_wrapped/ngc_wrapped '--node_options=--expose-gc' '--node_options=--stack-trace-limit=100' '--node_options=--max-old-space-size=2048' ... (remaining 1 argument(s) skipped).  [forge_remote_host=ikch12]
third_party/javascript/angular2/rc/packages/upgrade/static/public_api.ts:9:84 - error TS2307: Cannot find module '../src/common/src/angular1'.
	to fix, run:
	taze //third_party/javascript/angular2

9 export {getAngularJSGlobal, getAngularLib, setAngularJSGlobal, setAngularLib} from '../src/common/src/angular1';
                                                                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
third_party/javascript/angular2/rc/packages/upgrade/static/public_api.ts:10:34 - error TS2307: Cannot find module '../src/common/src/downgrade_component'.
	to fix, run:
	taze //third_party/javascript/angular2

10 export {downgradeComponent} from '../src/common/src/downgrade_component';
                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
third_party/javascript/angular2/rc/packages/upgrade/static/public_api.ts:11:35 - error TS2307: Cannot find module '../src/common/src/downgrade_injectable'.
	to fix, run:
	taze //third_party/javascript/angular2

11 export {downgradeInjectable} from '../src/common/src/downgrade_injectable';
                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
third_party/javascript/angular2/rc/packages/upgrade/static/public_api.ts:12:23 - error TS2307: Cannot find module '../src/common/src/version'.
	to fix, run:
	taze //third_party/javascript/angular2

12 export {VERSION} from '../src/common/src/version';
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~
third_party/javascript/angular2/rc/packages/upgrade/static/public_api.ts:13:31 - error TS2307: Cannot find module './src/downgrade_module'.
	to fix, run:
	taze //third_party/javascript/angular2

13 export {downgradeModule} from './src/downgrade_module';
                                 ~~~~~~~~~~~~~~~~~~~~~~~~
third_party/javascript/angular2/rc/packages/upgrade/static/public_api.ts:14:32 - error TS2307: Cannot find module './src/upgrade_component'.
	to fix, run:
	taze //third_party/javascript/angular2

14 export {UpgradeComponent} from './src/upgrade_component';
                                  ~~~~~~~~~~~~~~~~~~~~~~~~~
third_party/javascript/angular2/rc/packages/upgrade/static/public_api.ts:15:29 - error TS2307: Cannot find module './src/upgrade_module'.
	to fix, run:
	taze //third_party/javascript/angular2

15 export {UpgradeModule} from './src/upgrade_module';
                               ~~~~~~~~~~~~~~~~~~~~~~

Comment thread tools/public_api_guard/BUILD.bazel Resolved
Comment thread tools/public_api_guard/BUILD.bazel Resolved
@jasonaden

Copy link
Copy Markdown
Contributor

Presubmit

@jasonaden jasonaden added the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label Apr 1, 2019
Previously we had to share code between upgrade/dynamic and upgrade/static
by symlinking the `src` folder, which allowed both packages to access
the upgrade/common files.

These symlinks are always problematic on Windows, where we had to run
a script to re-link them, and restore them.

This change uses Bazel packages to share the `upgrade/common` code,
which avoids the need for symlinking the `src` folder.

Also, the Windows specific scripts that fixup the symlinks have also
been removed as there is no more need for them.
@petebacondarwin
petebacondarwin force-pushed the ngupgrade-windows-support branch from eb5ee3d to a673140 Compare April 1, 2019 18:27
@jasonaden jasonaden removed the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label Apr 1, 2019
@petebacondarwin petebacondarwin added target: major This PR is targeted for the next major release and removed target: patch This PR is targeted for the next patch release labels Apr 2, 2019
@jasonaden jasonaden closed this in 9f54d76 Apr 2, 2019
@gkalpak

gkalpak commented Apr 2, 2019

Copy link
Copy Markdown
Member

\o/

@petebacondarwin
petebacondarwin deleted the ngupgrade-windows-support branch April 3, 2019 07:42
wKoza pushed a commit to wKoza/angular that referenced this pull request Apr 17, 2019
…angular#29466)

Previously we had to share code between upgrade/dynamic and upgrade/static
by symlinking the `src` folder, which allowed both packages to access
the upgrade/common files.

These symlinks are always problematic on Windows, where we had to run
a script to re-link them, and restore them.

This change uses Bazel packages to share the `upgrade/common` code,
which avoids the need for symlinking the `src` folder.

Also, the Windows specific scripts that fixup the symlinks have also
been removed as there is no more need for them.

PR Close angular#29466
@angular-automatic-lock-bot

Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Sep 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: upgrade Issues related to AngularJS → Angular upgrade APIs cla: yes effort3: weeks freq2: medium refactoring Issue that involves refactoring or code-cleanup risk: low target: major This PR is targeted for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants