-
-
Notifications
You must be signed in to change notification settings - Fork 225
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
shared: Move idmap from internal #302
Conversation
Oh - yeah - clearly :) |
So if there are any suggestions of where to put the .h files, those would be appreciated - otherwise I'll just try a few things. |
Ideally, I'd make The stuff in |
Yeah - it's simpler than I thought. I was thinking when you import github.com/lxc/incus/shared/idmap, it would actually fetch only that subdir. But incus.git/internal/ is available to it, so it's fine. I'll update later today. Thanks. |
Yeah, Go doesn't really do per-directory imports unless they have their own go.mod. That said we effectively have a policy to not have packages in The other way is perfectly fine though, packages in So having things layed out as described above where Obviously this all assumes that in your own case you don't need those Linux specific bits. |
@stgraber no, that doesn't suffice. Stacker (and project-machine, and atomix) need the uid shifting code as well, and therefore need the cgo bits e.g. for setting v3 filecaps. So if the policy is to not import from internal into shared, then it becomes harder again :) |
Okay, so yeah, if you need the "fun" bits of the package too, then we'll need to move the whole thing. I'll take a look at it later today to see how that may look like. |
Thanks -fwiw the pr as is compiles and allows stacker to compile. |
|
Oh yeah - saw that this morning and cursed stupid linters. |
197bb68
to
cc05d31
Compare
Are zfs tests known to be flaky, or could this be a real failure? |
Some of those tests can be flaky, it's all good now. |
This is needed for shared/idmap as external packages consuming shared/idmap need a way to pull the cgo code too. Signed-off-by: Stéphane Graber <[email protected]>
Signed-off-by: Stéphane Graber <[email protected]>
Move internal/idmap/* back to shared/idmap/. It was in use by projects like github.com/project-stacker/stacker. Add an idmapset_other.go so that non-linux systems will just get an error message if they try to use it. Signed-off-by: Serge Hallyn <[email protected]>
Signed-off-by: Serge Hallyn <[email protected]>
Signed-off-by: Stéphane Graber <[email protected]>
cc05d31
to
3f94117
Compare
I'd considered moving internal/cgo to shared/cgo, but that made it sound like something others would want to pull so I was trying to think of another way to do that. Other than shared/idmap/cgo which is wrong since not only idmap uses it, I hadn't come up with anything. maybe shared/cgo is just fine. |
Yeah, it's not great but the fact that it does absolutely nothing when you import it (other than its side effects), makes it pretty easy to remove down the line at least without people getting too mad at us :) |
Move internal/idmap/* back to shared/idmap/. It was in use by projects like github.com/project-stacker/stacker.
Create an idmapset_other.go so that non-linux systems will just get an error message if they try to use it.
The #included .h files need to move somewhere, but I'm not sure where is best. As is, incus will compile, but stacker for instance will not, since it won't be able to find internal/cgo/*.h.