Opened 15 years ago

Closed 13 years ago

#5482 closed enhancement (invalid)

--install-sources should increase HAIKU_IMAGE_SIZE's value

Reported by: mmadia Owned by: mmadia
Priority: normal Milestone: R1
Component: Build System Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

--install-sources should be able to increase the size of the image files. This will allow seamless operation with the current BuildProfiles.

Perhaps in build/jam/HaikuImage

HAIKU_IMAGE_SIZE ?= $(HAIKU_DEFAULT_IMAGE_SIZE) ; # 100 MB
if $(HAIKU_INCLUDE_SOURCES) {
    HAIKU_IMAGE_SIZE += HAIKU_SOURCES_SIZE ;
}
... 
AddVariableToScript $(script) : imageSize : $(HAIKU_IMAGE_SIZE) ;

HAIKU_SOURCES_SIZE could be a fixed value or maybe set by something that computes the size of the additional source archives.

Attachments (1)

5482-IncreaseImageSizeForSources.patch (1.1 KB ) - added by mmadia 15 years ago.
untested draft idea.

Download all attachments as: .zip

Change History (8)

comment:1 by bonefish, 15 years ago

Yep, something like this could be done. Since jam doesn't have built-in support for basic arithmetics, the Expr rule from MathRules has to be used, though. The easiest way would be to introduce HAIKU_SOURCES_SIZE as a user overridable variable, similar to HAIKU_IMAGE_SIZE. Or maybe rather introduce a HAIKU_IMAGE_SIZE_WITH_SOURCES, which would be used instead of HAIKU_IMAGE_SIZE, if HAIKU_INCLUDE_SOURCES is enabled. It would default to HAIKU_IMAGE_SIZE, so users can still easily define a fixed (sufficiently large) image size regardless of whether they include sources or not.

PS: HAIKU_INCLUDE_SOURCES has the value 0 or 1, i.e. the "if" needs to check for "== 1".

comment:2 by mmadia, 15 years ago

Would it be better to : Extend InstallSourceArchive to accept a 3rd parameter, "sizeMB". InstallSourceArchive would then use Expr to increase HAIKU_SOURCES_SIZE. Then in HaikuImage,

if $(HAIKU_INCLUDE_SOURCES) = 1 { 
  HAIKU_IMAGE_SIZE = [ Expr $(HAIKU_IMAGE_SIZE) + $(HAIKU_SOURCES_SIZE) ] ;
}

by mmadia, 15 years ago

untested draft idea.

comment:3 by axeld, 15 years ago

I'm not sure if I would like the build system to automatically adapt the size of the image. Why not simply show an error if the image is too small instead?

comment:4 by axeld, 15 years ago

To give an example: I create a 256 MB image for a USB stick, and the build system silently enlarges the image, making it impossible to actually write it to the stick (or CD, whatever, you get the idea).

comment:5 by mmadia, 15 years ago

Would it matter that this is not default behavior and would only occur when the user runs configure --include-sources or sets HAIKU_INCLUDE_SOURCES = 1 ?

comment:6 by axeld, 15 years ago

Not for me, but YMMV :-) It would be nice to warn about an image size that cannot hold all the requested packages in general, but even if it's only for the sources, I don't like to silently change the parameters given by the user. Ie. IMO we don't need a constraint solver, just someone who says: dude, this won't work, your image needs to be 134 MB larger for this.

in reply to:  6 comment:7 by mmadia, 13 years ago

Resolution: invalid
Status: newclosed

Replying to axeld:

... Ie. IMO we don't need a constraint solver, just someone who says: dude, this won't work, your image needs to be 134 MB larger for this.

Ok.

Note: See TracTickets for help on using tickets.