Finally I did something helpful
I will explain again, I think I am not clear.
Normally, the first example
https://play.crystal-lang.org/#/r/eoax/
should output all softwares in this order:
#Normally, the expected order should be:
#SftBase Pass1
#Sft1 Pass1
#Sft2 Pass1
#SftBase Pass2
#Sft1 Pass2
#Sft2 Pass2
#Sft3 Pass1
#SftBase Pass3
#Sft1
#Sft2
#Sft3
#SftBase
In the second example,
https://play.crystal-lang.org/#/r/eoe3/edit
The first empty array is normal, it just show when I add this code in the example:
test = SftBase
test.enableOption("Pass1")
puts getRequiredDependencies(test)
puts
The result of the dependencies order is altered.
It’s normal the option “Pass(x)” change the dependencies, it’s a normal behavior.
Because if a software have an option named pass, it mean this software need to be build with this option first. I will don’t explain all changes about that, it will make you more confuse.
Because if you read yet the LFS Book, you will see Gcc for example is build 3 times, but you can’t build three time in a row, you have to build others softwares before (they need to be build few times as well for some)
I did that because I would like to provide a way for user to really build automatically a Linux system from the very beginning
Just to give you an example, this is the script installation of Bash, you will understand (I guess). You can see Pass1 change how to build the software.
class Target < ISM::Software
def configure
super
if option("Pass1")
configureSource([ "--prefix=/usr",
"--build=$(support/config.guess)",
"--host=#{Ism.settings.target}",
"--without-bash-malloc"],
buildDirectoryPath)
else
configureSource([ "--prefix=/usr",
"--docdir=/usr/share/doc/bash-5.1.8",
"--without-bash-malloc",
"--with-installed-readline"],
buildDirectoryPath)
end
end
def build
super
makeSource([Ism.settings.makeOptions],buildDirectoryPath)
end
def prepareInstallation
super
makeSource([Ism.settings.makeOptions,"DESTDIR=#{builtSoftwareDirectoryPath}#{Ism.settings.rootPath}","install"],buildDirectoryPath)
end
def install
super
if option("Pass1")
makeLink("bash","#{Ism.settings.rootPath}bin/sh",:symbolicLink)
end
end
end
I hope you can help me to solve this bug, I am very tired of it