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

feat: support onlyBuiltDependencies #4002

Closed
wants to merge 6 commits into from
Closed

feat: support onlyBuiltDependencies #4002

wants to merge 6 commits into from

Conversation

Jack-Works
Copy link
Member

close #4001

@fireairforce
Copy link
Member

Ci failed for the test case

@Jack-Works
Copy link
Member Author

Yes. I'm debugging it.

@Jack-Works
Copy link
Member Author

hi! I spent 3 hours and really cannot find out why the test fails. Can you help me?

I handle the new option like neverBuiltDependencies but it does not work.

packages/core/src/install/index.ts Outdated Show resolved Hide resolved
packages/core/src/install/index.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@SukkaW SukkaW left a comment

Choose a reason for hiding this comment

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

IMHO this is the requiresBuild should be.

Comment on lines +881 to +893
let requiresBuild: boolean | undefined
if (options.onlyBuiltDependencies === false || options.onlyBuiltDependencies.has(options.pkg.name)) {
// No onlyBuiltDependencies is specified or this package is explicitly allowed.
if (options.neverBuiltDependencies.has(options.pkg.name)) {
// This package is explicitly listed.
requiresBuild = false
} else {
// default resolution
requiresBuild = options.dependencyLockfile != null ? Boolean(options.dependencyLockfile.requiresBuild) : undefined
}
} else {
requiresBuild = false
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
let requiresBuild: boolean | undefined
if (options.onlyBuiltDependencies === false || options.onlyBuiltDependencies.has(options.pkg.name)) {
// No onlyBuiltDependencies is specified or this package is explicitly allowed.
if (options.neverBuiltDependencies.has(options.pkg.name)) {
// This package is explicitly listed.
requiresBuild = false
} else {
// default resolution
requiresBuild = options.dependencyLockfile != null ? Boolean(options.dependencyLockfile.requiresBuild) : undefined
}
} else {
requiresBuild = false
}
let requiresBuild: boolean | undefined
if (
options.neverBuiltDependencies.has(options.pkg.name)
|| (
options.onlyBuiltDependencies !== false
&& !options.onlyBuiltDependencies.has(options.pkg.name)
)
) {
requiresBuild = false;
} else if (options.dependencyLockfile != null) {
requiresBuild = Boolean(options.dependencyLockfile.requiresBuild);
} else {
requiresBuild = undefined;
}

@zkochan
Copy link
Member

zkochan commented Nov 18, 2021

hi! I spent 3 hours and really cannot find out why the test fails. Can you help me?

I'll check this week.

Copy link
Member

@zkochan zkochan left a comment

Choose a reason for hiding this comment

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

I'll make some refactoring

@zkochan
Copy link
Member

zkochan commented Nov 20, 2021

Looks like you did not allow others to push to your pull request. So I had to make another one #4014

@Jack-Works Jack-Works closed this Nov 20, 2021
@Jack-Works
Copy link
Member Author

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reverse option of neverBuiltDependencies
4 participants