Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Same file (different paths) deleted then changed #1278

Closed
zepumph opened this issue Jul 13, 2022 · 9 comments
Closed

Same file (different paths) deleted then changed #1278

zepumph opened this issue Jul 13, 2022 · 9 comments

Comments

@zepumph
Copy link
Member

zepumph commented Jul 13, 2022

In the transpiler: There seems to be something that isn't using path.sep and/or forwardSlashify

2:11:55 PM, 20 ms: ..\scenery-phet\js\TriangleNode.ts (deleted)
2:11:55 PM, 35 ms: ../scenery-phet/js/TriangleNode.ts (changed)
2:11:56 PM, 13 ms: ..\phet-io-wrappers\common\js\Client.ts (deleted)
2:11:56 PM, 90 ms: ../phet-io-wrappers/common/js/Client.ts (changed)
2:18:02 PM, 10 ms: ..\geometric-optics\js\geometric-optics-phet-io-overrides.js (deleted)
2:18:02 PM, 20 ms: ../geometric-optics/js/geometric-optics-phet-io-overrides.js (changed)

@samreid
Copy link
Member

samreid commented Jul 21, 2022

I'm seeing the backslashes on deleted on my win git bash, but not the immediate forward slash changed. Also note all of this is happening during watch on pull, none during initial transpilation:

7:20:20 AM, 18 ms: ../yotta/js/yottaMessages.js
Finished initial transpilation in 98316ms
Watching...
reloaded active repos
7:20:28 AM, 328 ms: ../axon/js/CallbackTimer.ts
7:20:29 AM, 212 ms: ../equality-explorer-basics/js/lab/LabScreen.js
7:20:29 AM, 137 ms: ../axon/js/EnumerationDeprecatedProperty.js
7:20:30 AM, 76 ms: ..\circuit-construction-kit-common\js\view\CCKCChartNode.ts (deleted)
7:20:30 AM, 69 ms: ..\scenery\js\accessibility\voicing\ReadingBlockHighlight.js (deleted)
7:20:30 AM, 74 ms: ..\tandem\js\types\NumberIOTests.js (deleted)
7:20:30 AM, 82 ms: ../nitroglycerin/js/nodes/C2H4Node.ts
7:20:30 AM, 71 ms: ../fractions-common/js/intro/view/beaker/BeakerSceneNode.js
7:20:30 AM, 154 ms: ../circuit-construction-kit-common/js/view/CircuitLayerNode.ts
7:20:30 AM, 87 ms: ../perennial-alias/js/grunt/Gruntfile.js
7:20:31 AM, 66 ms: ../sun/js/buttons/BooleanRoundToggleButton.ts
7:20:31 AM, 78 ms: ../number-play/js/game/view/CountingGameLevelNode.ts
7:20:31 AM, 62 ms: ../models-of-the-hydrogen-atom/js/common/view/MOTHAViewProperties.ts
7:20:31 AM, 132 ms: ..\scenery\js\display\ChangeInterval.js (deleted)
7:20:31 AM, 57 ms: ../scenery-phet/js/buttons/StarButton.ts

samreid added a commit that referenced this issue Jul 21, 2022
@samreid
Copy link
Member

samreid commented Jul 21, 2022

I normalized all paths and it seems to be behaving better on my Win git-bash. I'll test on my Mac next.

@samreid
Copy link
Member

samreid commented Jul 21, 2022

Everything seems to be working as expected on my mac. @zepumph can you please take this for a test drive? If it works well, we can tell slack dev-public to pull and restart their transpilers.

@samreid samreid assigned zepumph and unassigned samreid Jul 21, 2022
@zepumph
Copy link
Member Author

zepumph commented Jul 21, 2022

I'm not seeing the issue, thanks for working on this. Do you want to factor out Transpiler.forwardSlashify( path.join( into a Transpiler.joinPath so that we don't accidentally have this bug in the future?

@zepumph zepumph assigned samreid and unassigned zepumph Jul 21, 2022
@samreid
Copy link
Member

samreid commented Aug 2, 2022

Thanks for the recommendation. This will sound like a backtrack, but I feel the best way forward for this issue is to support windows paths on windows. The main reason I normalized out the paths was to make text searching for substrings like 'my/path/element` trivial, but perhaps that should be the part this is abstracted instead of having to remember to call Transpiler.joinPath or forwardSlashify everywhere. Sound ok?

@samreid samreid assigned zepumph and unassigned samreid Aug 2, 2022
@zepumph
Copy link
Member Author

zepumph commented Aug 2, 2022

Yes, it makes sense! Good luck.

@zepumph zepumph assigned samreid and unassigned zepumph Aug 2, 2022
@samreid
Copy link
Member

samreid commented Aug 4, 2022

As I was prototyping #1272 it was very convenient to be able to search for substrings in paths like includes('../chipper/') so now I am less sure what's best.

samreid added a commit that referenced this issue Aug 8, 2022
@samreid
Copy link
Member

samreid commented Aug 8, 2022

The commit adds Transpiler.join, would you like to review? Was mostly straightforward with the more complex usage in getTargetPath -- does that seem OK?

@samreid samreid assigned zepumph and unassigned samreid Aug 8, 2022
@zepumph
Copy link
Member Author

zepumph commented Aug 8, 2022

Looks great! Thanks.

@zepumph zepumph assigned samreid and unassigned zepumph Aug 8, 2022
@samreid samreid closed this as completed Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants