Skip to content

Fix Windows test errors in src/ls.js and test/cp.js. #1165

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

Closed
wants to merge 4 commits into from

Conversation

kmashint
Copy link
Contributor

These are fixes for Windows in the switch-fast-blob branch as mentioned in this pull-request.
#1153

nfischer and others added 3 commits February 18, 2024 01:04
This removes support for configuring `config.globOptions`. Exposing this
variable makes it difficult to change (or upgrade) our glob library.
It's best to consider our choice of glob library to be an implementation
detail.

As far as I know, this is not a commonly used option:
https://github.com/shelljs/shelljs/issues?q=globOptions currently shows
no GitHub issues of users using this option, and there was never really
a motivation for why this needed to be exposed (shelljs#400 exposed the option
just because we could, not because we should).

This is one step toward supporting Issue shelljs#828.
This removes `node-glob` in favor of `fast-glob`. The main motivation
for this is because `node-glob` has a security warning and I can't
update to `node-glob@9` unless we drop compatibility for node v8.

Switching to `fast-glob` seems to be fairly straightforward, although
some options need to be changed by default for bash compatibility.

Fixes shelljs#828
Fixes shelljs#1149
@nfischer
Copy link
Member

@kmashint can you please rebase this PR on top of the master branch instead? I realized this change is missing some critical commits that I landed recently on master. I'm hoping that your fixes are backward compatible with both glob and fast-glob so this should be relatively easy to land.

@nfischer nfischer force-pushed the switch-fast-glob branch 2 times, most recently from a242df1 to 5e83898 Compare June 21, 2024 22:58
@kmashint
Copy link
Contributor Author

@nfischer Will rebase on master tonight.

@kmashint kmashint changed the base branch from switch-fast-glob to master June 21, 2024 23:46
@kmashint
Copy link
Contributor Author

I merged master into this pull-request branch, and hoping I cut it the right way, removing references to glob in favour of fast-glob.

@@ -246,12 +246,6 @@ function parseOptions(opt, map, errorOptions) {
}
exports.parseOptions = parseOptions;

function globOptions() {
Copy link
Member

Choose a reason for hiding this comment

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

I think this was reverted when it should not have been. I think what happened is that you probably have an out-of-date copy of the master branch. Can you please sync this against the main repo's master branch? I think you can do this with something like:

git checkout master
git remote add upstream https://github.com/shelljs/shelljs.git
git fetch upstream
git rebase upstream/master
git checkout switch-fast-glob
git rebase master
git push origin switch-fast-glob --force-with-lease

@@ -55,7 +55,7 @@
},
"dependencies": {
"execa": "^1.0.0",
"glob": "^7.0.0",
"fast-glob": "^3.3.2",
Copy link
Member

Choose a reason for hiding this comment

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

Also, I would like to exclude this part from this PR. My change will take care of switching over to fast-glob. I'd like to merge your change before mine though to make sure it is backward-compatible with "plain" glob. Then I'll rebase my change on top of yours to test it with fast-glob`.

It's also fine if you want to test this with fast-glob locally in your checkout. We should just remove this part before merging this on the master branch.

@nfischer nfischer added fix Bug/defect, or a fix for such a problem test labels Jun 22, 2024
@nfischer
Copy link
Member

Closing this one in favor of #1166.

@nfischer nfischer closed this Jun 22, 2024
@kmashint kmashint deleted the switch-fast-glob branch June 23, 2024 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug/defect, or a fix for such a problem test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants