-
Notifications
You must be signed in to change notification settings - Fork 249
[per-OS Packages] in devbox add, allow multiple --platform/--exclude-platform flag values #1363
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
Conversation
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
internal/devconfig/packages.go
Outdated
if len(platforms) == 0 { | ||
return nil | ||
} | ||
for _, platform := range platforms { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make nix.EnsureValidPlatform
take ...string ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
internal/devconfig/packages.go
Outdated
for _, platform := range platforms { | ||
// Append if the platform is not already present | ||
if !lo.SomeBy(pkg.Platforms, func(p string) bool { return p == platform }) { | ||
pkg.Platforms = append(pkg.Platforms, platform) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pkg.Platforms = lo.Uniq(append(pkg.Platforms, platforms...))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
internal/devconfig/packages.go
Outdated
if existing == platform { | ||
alreadyPresent = true | ||
break | ||
for _, platform := range platforms { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lo.uniq
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -34,7 +34,7 @@ func (d *Devbox) Update(ctx context.Context, pkgs ...string) error { | |||
// Calling Add function with the original package names, since | |||
// Add will automatically append @latest if search is able to handle that. | |||
// If not, it will fallback to the nixpkg format. | |||
if err := d.Add(ctx, "" /*platform*/, "" /*excludePlatform*/, pkg.Raw); err != nil { | |||
if err := d.Add(ctx, nil /*platforms*/, nil /*excludePlatforms*/, pkg.Raw); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pain
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we fill these in next PR
81606cd
to
0dbee1d
Compare
f65133a
to
8790b47
Compare
0dbee1d
to
25122b6
Compare
8790b47
to
1453300
Compare
25122b6
to
7f2bc7a
Compare
1453300
to
af97428
Compare
7f2bc7a
to
fbba263
Compare
af97428
to
d8304fd
Compare
fbba263
to
8bf71ad
Compare
e0f4a8b
to
a9bec28
Compare
…platform flag values
… for this package
a9bec28
to
fe32133
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops forgot to submit comments
@@ -34,7 +34,7 @@ func (d *Devbox) Update(ctx context.Context, pkgs ...string) error { | |||
// Calling Add function with the original package names, since | |||
// Add will automatically append @latest if search is able to handle that. | |||
// If not, it will fallback to the nixpkg format. | |||
if err := d.Add(ctx, "" /*platform*/, "" /*excludePlatform*/, pkg.Raw); err != nil { | |||
if err := d.Add(ctx, nil /*platforms*/, nil /*excludePlatforms*/, pkg.Raw); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we fill these in next PR
internal/devconfig/packages.go
Outdated
if len(platforms) == 0 { | ||
return nil | ||
} | ||
for _, platform := range platforms { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
internal/devconfig/packages.go
Outdated
for _, platform := range platforms { | ||
// Append if the platform is not already present | ||
if !lo.SomeBy(pkg.Platforms, func(p string) bool { return p == platform }) { | ||
pkg.Platforms = append(pkg.Platforms, platform) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
internal/devconfig/packages.go
Outdated
if existing == platform { | ||
alreadyPresent = true | ||
break | ||
for _, platform := range platforms { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Summary
This PR enables calling
--platform
with multiple values withdevbox add
.It gives the user an option to user either or both (1) comma-separated flag values (2) multiple flag invocations. Like:
--platform <platform>,<platform>...,<platform> --platform <platform> --platform <platform>
Ditto for
--exclude-platform
How was it tested?
Augmented testscript unit test