eve icon indicating copy to clipboard operation
eve copied to clipboard

Should explicitly specify what arches we want to build eve packages for

Open deitch opened this issue 4 years ago • 12 comments

We use make eve in the root to call linuxkit pkg build with the build.yml from pkg/eve/build.yml. That does not specify explicitly which arches are supported, so a future call to pkg build will try to build for lots of things that might or might not suit us.

This makes it explicit.

cc @vmlemon @rvs

Related to this

deitch avatar May 26 '21 13:05 deitch

Sure. Just call it as lkt pkg build <path> --platforms=linux/arm64 or whatever you're in. Stick it in the makefile where we already do that.

deitch avatar May 27 '21 22:05 deitch

Hmm, would https://github.com/tonistiigi/xx be of any use to us, for this kind of thing? I stumbled across it, whilst watching some of the DockerCon videos, earlier on.

vmlemon avatar May 27 '21 23:05 vmlemon

No, we don't need any of that @vmlemon -- nice find tho

rvs avatar May 28 '21 00:05 rvs

Btw @deitch it sounds like with the explicit invocation of linuxkit you suggested above -- we should close this PR?

rvs avatar May 28 '21 00:05 rvs

Correct.

How did you find time to watch those videos @vmlemon :-)

deitch avatar May 28 '21 04:05 deitch

Actually I'm going to change that. The explicit platforms invocation is independent of this PR. This PR sets the default for when you do not explicitly set platforms. When you explicitly do - as suggested above - the arches part of build.yml is ignored. Consider this a "safety net" for when someone runs it without explicit platforms (only do these platforms, not every one linuxkit can think of), as well as good indication / documentation what platforms are supported.

I would merge this in for those reasons, and then do the explicit --platforms to restrict it to just one platform when running.

deitch avatar May 28 '21 04:05 deitch

Correct.

How did you find time to watch those videos @vmlemon :-)

Copious amounts of coffee, snacks, and planning out which sessions were most interesting, before ending up staying awake until 2am. The time boundaries also kinda-helped, since the videos were just short enough, that the start/end of each overlapped... :)

vmlemon avatar May 28 '21 07:05 vmlemon

Consider this a "safety net"

The problem with looking at it as a safety net @deitch is that it is broken -- attempting to cross-build eve packages (specifically) will result in ether failure or worse yet producing an incorrect container. Both of these are not what I would call a safety net.

Specifically for eve -- it really has to be somehow the platform I'm running on. Which brings me to: it really would be helpful if there was a way to say:

arches:
  - self

Which would mean that the package is declaring itself to be safe to be built on any architecture as long as cross-compilation is not involved.

rvs avatar May 28 '21 19:05 rvs

The problem with looking at it as a safety net @deitch is that it is broken

I don't understand why it is broken. It doesn't say, "I will prevent you from building any other arches." If you specify pkg build --platforms=foo, it will let you build for foo. If you specified foo, you are more than smart enough to know that was what you wanted to build.

attempting to cross-build eve packages (specifically) will result in ether failure or worse yet producing an incorrect container. Both of these are not what I would call a safety net.

If eve cross-building fails, let's fix it. But pkg build does what it is expected to:

  • if you specified --platforms, build for that
  • if you did not, build for the "default arches" specified in the file

arches:

  • self

I don't see the maintainers agreeing to that. Why would I want to say, "this is safe to build as long as cross-compilation is not involved"?

deitch avatar May 30 '21 13:05 deitch

I don't understand why it is broken.

It is broken because running make eve with your changes will produce a package with a broken content for non-host arch.

I think we need to discuss it in a more 1-1 way at this point -- since it is clearly that both of us are missing some crucial details here.

rvs avatar Jun 01 '21 14:06 rvs

Hey @deitch -- shouldn't this be closed in favor of #2115 ?

rvs avatar Jun 07 '21 10:06 rvs

Nope. This is about what platforms I build for in my current command, not creating an index. Two distinct things.

deitch avatar Jun 07 '21 12:06 deitch

@deitch do we close this?

rouming avatar Dec 05 '22 10:12 rouming

Yeah we can for now.

deitch avatar Dec 05 '22 17:12 deitch