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

[core] Support release:build with cmd.exe #28318

Merged
merged 1 commit into from
Sep 15, 2021

Conversation

michaldudak
Copy link
Member

Makes building @mui/icons-material (and, therefore, running yarn release:build in the repository root) succeed on Windows.

@michaldudak michaldudak added the core Infrastructure work going on behind the scenes label Sep 13, 2021
@mui-pr-bot
Copy link

mui-pr-bot commented Sep 13, 2021

Details of bundle changes

@material-ui/core: parsed: +Infinity% , gzip: +Infinity%
@material-ui/lab: parsed: +Infinity% , gzip: +Infinity%
@material-ui/styles: parsed: +Infinity% , gzip: +Infinity%
@material-ui/private-theming: parsed: +Infinity% , gzip: +Infinity%
@material-ui/system: parsed: +Infinity% , gzip: +Infinity%
@material-ui/unstyled: parsed: +Infinity% , gzip: +Infinity%
@material-ui/utils: parsed: +Infinity% , gzip: +Infinity%

Generated by 🚫 dangerJS against f9fbcae

@@ -56,6 +56,7 @@
"devDependencies": {
"fs-extra": "^10.0.0",
"mustache": "^4.2.0",
"shx": "^0.3.3",
Copy link
Member

Choose a reason for hiding this comment

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

what's this?

Copy link
Member Author

Choose a reason for hiding this comment

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

A utility that lets run cp (and few other *nix tools) on Windows.

Copy link
Member

@eps1lon eps1lon Sep 14, 2021

Choose a reason for hiding this comment

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

on Windows.

Could you be a bit more specific about your environment? Both in the git-bash and PowerShell this task is fine. We specifically test dev scripts for Windows + PowerShell.

There's a limit to the environment matrix we can support. So if you're using the ancient windows command prompt or some exotic Windows build then you may want to consider using a more standard development setup.

Copy link
Member

Choose a reason for hiding this comment

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

I remember this failed on the default CMD, but I am using Git Bash and haven't had problems with that one.

Copy link
Member

Choose a reason for hiding this comment

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

I remember this failed on the default CMD

Yeah, we gain more value by you switching over from that tool than fixing every compat issue with CMD. cmd.exe is effectively deprecated since 2008 and GitHub also defaults to PowerShell now.

I definitely get behind general OS support at our scale. But support of every tool is a bit of a stretch. And I do have issues as well since I us a non-standard shell as well. But when I do have these issues I switch to standard tools instead of spending time on (and bloating) the codebase to fix these.

Copy link
Member Author

@michaldudak michaldudak Sep 14, 2021

Choose a reason for hiding this comment

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

I'm using Powershell 7.1.4, so it's hardly an ancient tool.

However, yarn does not. Yarn uses the default command interpreter, which, even on the latest Windows, happens to be cmd. I'm not aiming to support every tool there is, just the ones that are default, so that developers can use standard tooling to build the library.

Copy link
Member

Choose a reason for hiding this comment

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

I'm using Powershell 7.1.4, so it's hardly an ancient tool.

I did not say that PowerShell is an ancient tool.

so that developers can use standard tooling to build the library.

Outdated versions of PowerShell are not standard tooling.

Leaving this discussion as this is again an instance where Michal fails to engage with the argument. If you want that everything is tailored to your liking while simultaneously making no effort to apply the same standard to everybody else, then so be it. But I don't have to put up with it anymore.

I have no idea what yarn has to do with it. I'm not aware that yarn implements cp -r.

Copy link
Member Author

Choose a reason for hiding this comment

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

I did not say that PowerShell is an ancient tool.

I never suggested you did. I'm just saying I'm using an up-to-date toolset.

Outdated versions of PowerShell are not standard tooling

Yes, in general, that's undeniably true.
However, what outdated version do you have in mind in the context of this conversation? As I said I'm using the latest PowerShell and it fails to build.

I have no idea what yarn has to do with it

Then let me explain: If you are on Windows, yarn uses the default command interpreter to run commands defined in the scripts section of package.json. So even if I'm using PowerShell to execute yarn build in /packages/mui-icons-material, yarn will use cmd.exe to run cp -r lib/ build/. And this fails.

If you want that everything is tailored to your liking while simultaneously making no effort to apply the same standard to everybody else, then so be it.

Does my solution break anything to anyone else? Does it make it harder to build on other systems? If so, please let me know, and I'll consider something else or drop this completely. As of now, my understanding is that it improves the developer experience on Windows by allowing to use any of the standard, built-in shells to build the project.

Copy link
Member

Choose a reason for hiding this comment

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

My understanding is that it improves the developer experience on Windows by allowing to use any of the standard, built-in shells to build the project.

I agree with this. And looks like we are not loosing anything with this change. So I don’t see any downside with adding this.

@eps1lon eps1lon changed the title [core] Allow release:build to be run on Windows [core] Support release:build with cmd.exe Sep 14, 2021
@mnajdova
Copy link
Member

@michaldudak I just noticed that the base is wrong, we should target master. Please update and feel free to merge afterwards

@michaldudak michaldudak changed the base branch from next to master September 15, 2021 12:31
@michaldudak
Copy link
Member Author

Good point, thanks!

@michaldudak michaldudak merged commit 2503a09 into mui:master Sep 15, 2021
@michaldudak michaldudak deleted the windows-build branch September 15, 2021 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Infrastructure work going on behind the scenes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants