Merge branch 'master' of git://factorcode.org/git/factor
commit
0d4032707c
|
@ -12,7 +12,7 @@ SYMBOL: bootstrap-time
|
||||||
|
|
||||||
: default-image-name ( -- string )
|
: default-image-name ( -- string )
|
||||||
vm file-name windows? [ "." split1 drop ] when
|
vm file-name windows? [ "." split1 drop ] when
|
||||||
".image" append ;
|
".image" append resource-path ;
|
||||||
|
|
||||||
: do-crossref ( -- )
|
: do-crossref ( -- )
|
||||||
"Cross-referencing..." print flush
|
"Cross-referencing..." print flush
|
||||||
|
@ -106,5 +106,5 @@ f error-continuation set-global
|
||||||
millis r> - dup bootstrap-time set-global
|
millis r> - dup bootstrap-time set-global
|
||||||
print-report
|
print-report
|
||||||
|
|
||||||
"output-image" get resource-path save-image-and-exit
|
"output-image" get save-image-and-exit
|
||||||
] if
|
] if
|
||||||
|
|
|
@ -190,7 +190,7 @@ DEFER: copy-tree-into
|
||||||
|
|
||||||
! Special paths
|
! Special paths
|
||||||
: resource-path ( path -- newpath )
|
: resource-path ( path -- newpath )
|
||||||
\ resource-path get [ image parent-directory ] unless*
|
"resource-path" get [ image parent-directory ] unless*
|
||||||
prepend-path ;
|
prepend-path ;
|
||||||
|
|
||||||
: ?resource-path ( path -- newpath )
|
: ?resource-path ( path -- newpath )
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
USING: tools.deploy.config ;
|
USING: tools.deploy.config ;
|
||||||
H{
|
H{
|
||||||
{ deploy-math? t }
|
{ deploy-word-defs? f }
|
||||||
{ deploy-reflection 1 }
|
{ deploy-random? f }
|
||||||
{ deploy-name "Bunny" }
|
{ deploy-name "Bunny" }
|
||||||
{ deploy-threads? t }
|
{ deploy-threads? t }
|
||||||
{ deploy-word-props? f }
|
|
||||||
{ "stop-after-last-window?" t }
|
|
||||||
{ deploy-ui? t }
|
|
||||||
{ deploy-io 3 }
|
|
||||||
{ deploy-compiler? t }
|
{ deploy-compiler? t }
|
||||||
{ deploy-word-defs? f }
|
{ deploy-math? t }
|
||||||
{ deploy-c-types? f }
|
{ deploy-c-types? f }
|
||||||
|
{ deploy-io 3 }
|
||||||
|
{ deploy-reflection 1 }
|
||||||
|
{ deploy-ui? t }
|
||||||
|
{ "stop-after-last-window?" t }
|
||||||
|
{ deploy-word-props? f }
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
USING: tools.deploy.config ;
|
USING: tools.deploy.config ;
|
||||||
H{
|
H{
|
||||||
{ deploy-io 1 }
|
|
||||||
{ deploy-compiler? t }
|
|
||||||
{ deploy-word-defs? f }
|
{ deploy-word-defs? f }
|
||||||
{ deploy-word-props? f }
|
{ deploy-random? t }
|
||||||
{ deploy-math? t }
|
|
||||||
{ deploy-name "Hello world" }
|
{ deploy-name "Hello world" }
|
||||||
{ deploy-c-types? f }
|
|
||||||
{ deploy-ui? t }
|
|
||||||
{ deploy-threads? t }
|
{ deploy-threads? t }
|
||||||
|
{ deploy-compiler? t }
|
||||||
|
{ deploy-math? t }
|
||||||
|
{ deploy-c-types? f }
|
||||||
|
{ deploy-io 1 }
|
||||||
{ deploy-reflection 1 }
|
{ deploy-reflection 1 }
|
||||||
|
{ deploy-ui? t }
|
||||||
{ "stop-after-last-window?" t }
|
{ "stop-after-last-window?" t }
|
||||||
|
{ deploy-word-props? f }
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
USING: tools.deploy.config ;
|
USING: tools.deploy.config ;
|
||||||
H{
|
H{
|
||||||
|
{ deploy-word-defs? f }
|
||||||
|
{ deploy-random? f }
|
||||||
{ deploy-name "Hello world (console)" }
|
{ deploy-name "Hello world (console)" }
|
||||||
{ deploy-threads? f }
|
{ deploy-threads? f }
|
||||||
{ deploy-c-types? f }
|
|
||||||
{ deploy-compiler? f }
|
{ deploy-compiler? f }
|
||||||
{ deploy-ui? f }
|
|
||||||
{ deploy-math? f }
|
{ deploy-math? f }
|
||||||
{ deploy-reflection 1 }
|
{ deploy-c-types? f }
|
||||||
{ deploy-word-defs? f }
|
|
||||||
{ deploy-io 2 }
|
{ deploy-io 2 }
|
||||||
{ deploy-word-props? f }
|
{ deploy-reflection 1 }
|
||||||
|
{ deploy-ui? f }
|
||||||
{ "stop-after-last-window?" t }
|
{ "stop-after-last-window?" t }
|
||||||
|
{ deploy-word-props? f }
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
USING: tools.deploy.config ;
|
USING: tools.deploy.config ;
|
||||||
H{
|
H{
|
||||||
|
{ deploy-word-defs? f }
|
||||||
|
{ deploy-random? f }
|
||||||
{ deploy-name "Sudoku" }
|
{ deploy-name "Sudoku" }
|
||||||
{ deploy-threads? f }
|
{ deploy-threads? f }
|
||||||
{ deploy-c-types? f }
|
|
||||||
{ deploy-compiler? t }
|
{ deploy-compiler? t }
|
||||||
{ deploy-ui? f }
|
|
||||||
{ deploy-math? f }
|
{ deploy-math? f }
|
||||||
{ deploy-reflection 1 }
|
{ deploy-c-types? f }
|
||||||
{ deploy-word-defs? f }
|
|
||||||
{ deploy-io 2 }
|
{ deploy-io 2 }
|
||||||
{ deploy-word-props? f }
|
{ deploy-reflection 1 }
|
||||||
|
{ deploy-ui? f }
|
||||||
{ "stop-after-last-window?" t }
|
{ "stop-after-last-window?" t }
|
||||||
|
{ deploy-word-props? f }
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,42 +40,57 @@ IN: tools.deploy.backend
|
||||||
"compiler" deploy-compiler? get ?,
|
"compiler" deploy-compiler? get ?,
|
||||||
"ui" deploy-ui? get ?,
|
"ui" deploy-ui? get ?,
|
||||||
"io" native-io? ?,
|
"io" native-io? ?,
|
||||||
|
"random" deploy-random? get ?,
|
||||||
] { } make ;
|
] { } make ;
|
||||||
|
|
||||||
: staging-image-name ( -- name )
|
: staging-image-name ( profile -- name )
|
||||||
"staging."
|
"staging."
|
||||||
bootstrap-profile strip-word-names? [ "strip" add ] when
|
swap strip-word-names? [ "strip" add ] when
|
||||||
"-" join ".image" 3append ;
|
"-" join ".image" 3append temp-file ;
|
||||||
|
|
||||||
: staging-command-line ( config -- flags )
|
DEFER: ?make-staging-image
|
||||||
|
|
||||||
|
: staging-command-line ( profile -- flags )
|
||||||
[
|
[
|
||||||
[
|
dup empty? [
|
||||||
"-i=" my-boot-image-name append ,
|
"-i=" my-boot-image-name append ,
|
||||||
|
] [
|
||||||
|
dup 1 head* ?make-staging-image
|
||||||
|
|
||||||
"-output-image=" staging-image-name append ,
|
"-resource-path=" "" resource-path append ,
|
||||||
|
|
||||||
"-include=" bootstrap-profile " " join append ,
|
"-i=" over 1 head* staging-image-name append ,
|
||||||
|
|
||||||
strip-word-names? [ "-no-stack-traces" , ] when
|
"-run=tools.deploy.restage" ,
|
||||||
|
] if
|
||||||
|
|
||||||
"-no-user-init" ,
|
"-output-image=" over staging-image-name append ,
|
||||||
] { } make
|
|
||||||
] bind ;
|
"-include=" swap " " join append ,
|
||||||
|
|
||||||
|
strip-word-names? [ "-no-stack-traces" , ] when
|
||||||
|
|
||||||
|
"-no-user-init" ,
|
||||||
|
] { } make ;
|
||||||
|
|
||||||
: run-factor ( vm flags -- )
|
: run-factor ( vm flags -- )
|
||||||
swap add* dup . run-with-output ; inline
|
swap add* dup . run-with-output ; inline
|
||||||
|
|
||||||
: make-staging-image ( config -- )
|
: make-staging-image ( profile -- )
|
||||||
vm swap staging-command-line run-factor ;
|
vm swap staging-command-line run-factor ;
|
||||||
|
|
||||||
: ?make-staging-image ( config -- )
|
: ?make-staging-image ( profile -- )
|
||||||
dup [ staging-image-name ] bind exists?
|
dup staging-image-name exists?
|
||||||
[ drop ] [ make-staging-image ] if ;
|
[ drop ] [ make-staging-image ] if ;
|
||||||
|
|
||||||
: deploy-command-line ( image vocab config -- flags )
|
: deploy-command-line ( image vocab config -- flags )
|
||||||
[
|
[
|
||||||
|
bootstrap-profile ?make-staging-image
|
||||||
|
|
||||||
[
|
[
|
||||||
"-i=" staging-image-name append ,
|
"-i=" bootstrap-profile staging-image-name append ,
|
||||||
|
|
||||||
|
"-resource-path=" "" resource-path append ,
|
||||||
|
|
||||||
"-run=tools.deploy.shaker" ,
|
"-run=tools.deploy.shaker" ,
|
||||||
|
|
||||||
|
@ -89,7 +104,6 @@ IN: tools.deploy.backend
|
||||||
|
|
||||||
: make-deploy-image ( vm image vocab config -- )
|
: make-deploy-image ( vm image vocab config -- )
|
||||||
make-boot-image
|
make-boot-image
|
||||||
dup ?make-staging-image
|
|
||||||
deploy-command-line run-factor ;
|
deploy-command-line run-factor ;
|
||||||
|
|
||||||
SYMBOL: deploy-implementation
|
SYMBOL: deploy-implementation
|
||||||
|
|
|
@ -16,6 +16,8 @@ ARTICLE: "deploy-flags" "Deployment flags"
|
||||||
"There are two sets of deployment flags. The first set controls the major subsystems which are to be included in the deployment image:"
|
"There are two sets of deployment flags. The first set controls the major subsystems which are to be included in the deployment image:"
|
||||||
{ $subsection deploy-math? }
|
{ $subsection deploy-math? }
|
||||||
{ $subsection deploy-compiler? }
|
{ $subsection deploy-compiler? }
|
||||||
|
{ $subsection deploy-random? }
|
||||||
|
{ $subsection deploy-threads? }
|
||||||
{ $subsection deploy-ui? }
|
{ $subsection deploy-ui? }
|
||||||
"The second set of flags controls the level of stripping to be performed on the deployment image; there is a trade-off between image size, and retaining functionality which is required by the application:"
|
"The second set of flags controls the level of stripping to be performed on the deployment image; there is a trade-off between image size, and retaining functionality which is required by the application:"
|
||||||
{ $subsection deploy-io }
|
{ $subsection deploy-io }
|
||||||
|
@ -66,16 +68,21 @@ HELP: deploy-math?
|
||||||
$nl
|
$nl
|
||||||
"On by default. Often the programmer will use rationals without realizing it. A small amount of space can be saved by stripping these features out, but some code may require changes to work properly." } ;
|
"On by default. Often the programmer will use rationals without realizing it. A small amount of space can be saved by stripping these features out, but some code may require changes to work properly." } ;
|
||||||
|
|
||||||
HELP: deploy-threads?
|
|
||||||
{ $description "Deploy flag. If set, the deployed image will contain support for threads."
|
|
||||||
$nl
|
|
||||||
"On by default. Often the programmer will use threads without realizing it. A small amount of space can be saved by stripping this feature out, but some code may require changes to work properly." } ;
|
|
||||||
|
|
||||||
HELP: deploy-compiler?
|
HELP: deploy-compiler?
|
||||||
{ $description "Deploy flag. If set, words in the deployed image will be compiled with the optimizing compiler when possible."
|
{ $description "Deploy flag. If set, words in the deployed image will be compiled with the optimizing compiler when possible."
|
||||||
$nl
|
$nl
|
||||||
"On by default. Most programs should be compiled, not only for performance but because features which depend on the C library interface only function after compilation." } ;
|
"On by default. Most programs should be compiled, not only for performance but because features which depend on the C library interface only function after compilation." } ;
|
||||||
|
|
||||||
|
HELP: deploy-random?
|
||||||
|
{ $description "Deploy flag. If set, the random number generator protocol is included, together with two implementations: a native OS-specific random number generator, and the Mersenne Twister."
|
||||||
|
$nl
|
||||||
|
"On by default. If your program does not generate random numbers you can disable this to save some space." } ;
|
||||||
|
|
||||||
|
HELP: deploy-threads?
|
||||||
|
{ $description "Deploy flag. If set, thread support will be included in the final image."
|
||||||
|
$nl
|
||||||
|
"On by default. Most programs depend on libraries which use threads even if they don't use threads directly; for example, alarms, non-blocking I/O, and the UI are built on top of threads. If after testing your program still works without threads, you can disable this feature to save some space." } ;
|
||||||
|
|
||||||
HELP: deploy-ui?
|
HELP: deploy-ui?
|
||||||
{ $description "Deploy flag. If set, the Factor UI will be included in the deployed image."
|
{ $description "Deploy flag. If set, the Factor UI will be included in the deployed image."
|
||||||
$nl
|
$nl
|
||||||
|
|
|
@ -10,6 +10,7 @@ SYMBOL: deploy-name
|
||||||
SYMBOL: deploy-ui?
|
SYMBOL: deploy-ui?
|
||||||
SYMBOL: deploy-compiler?
|
SYMBOL: deploy-compiler?
|
||||||
SYMBOL: deploy-math?
|
SYMBOL: deploy-math?
|
||||||
|
SYMBOL: deploy-random?
|
||||||
SYMBOL: deploy-threads?
|
SYMBOL: deploy-threads?
|
||||||
|
|
||||||
SYMBOL: deploy-io
|
SYMBOL: deploy-io
|
||||||
|
@ -57,6 +58,7 @@ SYMBOL: deploy-image
|
||||||
{ deploy-reflection 1 }
|
{ deploy-reflection 1 }
|
||||||
{ deploy-compiler? t }
|
{ deploy-compiler? t }
|
||||||
{ deploy-threads? t }
|
{ deploy-threads? t }
|
||||||
|
{ deploy-random? t }
|
||||||
{ deploy-math? t }
|
{ deploy-math? t }
|
||||||
{ deploy-word-props? f }
|
{ deploy-word-props? f }
|
||||||
{ deploy-word-defs? f }
|
{ deploy-word-defs? f }
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
IN: tools.deploy.restage
|
||||||
|
USING: bootstrap.stage2 namespaces memory ;
|
||||||
|
|
||||||
|
: restage ( -- )
|
||||||
|
load-components
|
||||||
|
"output-image" get save-image-and-exit ;
|
||||||
|
|
||||||
|
MAIN: restage
|
|
@ -19,7 +19,6 @@ QUALIFIED: libc.private
|
||||||
QUALIFIED: libc.private
|
QUALIFIED: libc.private
|
||||||
QUALIFIED: listener
|
QUALIFIED: listener
|
||||||
QUALIFIED: prettyprint.config
|
QUALIFIED: prettyprint.config
|
||||||
QUALIFIED: random
|
|
||||||
QUALIFIED: source-files
|
QUALIFIED: source-files
|
||||||
QUALIFIED: threads
|
QUALIFIED: threads
|
||||||
QUALIFIED: vocabs
|
QUALIFIED: vocabs
|
||||||
|
@ -108,8 +107,6 @@ IN: tools.deploy.shaker
|
||||||
|
|
||||||
: stripped-globals ( -- seq )
|
: stripped-globals ( -- seq )
|
||||||
[
|
[
|
||||||
random:random-generator ,
|
|
||||||
|
|
||||||
{
|
{
|
||||||
bootstrap.stage2:bootstrap-time
|
bootstrap.stage2:bootstrap-time
|
||||||
continuations:error
|
continuations:error
|
||||||
|
@ -145,12 +142,14 @@ IN: tools.deploy.shaker
|
||||||
vocabs:dictionary
|
vocabs:dictionary
|
||||||
lexer-factory
|
lexer-factory
|
||||||
vocabs:load-vocab-hook
|
vocabs:load-vocab-hook
|
||||||
|
root-cache
|
||||||
layouts:num-tags
|
layouts:num-tags
|
||||||
layouts:num-types
|
layouts:num-types
|
||||||
layouts:tag-mask
|
layouts:tag-mask
|
||||||
layouts:tag-numbers
|
layouts:tag-numbers
|
||||||
layouts:type-numbers
|
layouts:type-numbers
|
||||||
classes:typemap
|
classes:typemap
|
||||||
|
classes:class-map
|
||||||
vocab-roots
|
vocab-roots
|
||||||
definitions:crossref
|
definitions:crossref
|
||||||
compiled-crossref
|
compiled-crossref
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
USING: tools.deploy.config ;
|
USING: tools.deploy.config ;
|
||||||
H{
|
H{
|
||||||
|
{ deploy-word-defs? f }
|
||||||
|
{ deploy-random? f }
|
||||||
|
{ deploy-name "tools.deploy.test.1" }
|
||||||
|
{ deploy-threads? t }
|
||||||
|
{ deploy-compiler? t }
|
||||||
|
{ deploy-math? t }
|
||||||
{ deploy-c-types? f }
|
{ deploy-c-types? f }
|
||||||
{ deploy-io 2 }
|
{ deploy-io 2 }
|
||||||
{ deploy-reflection 1 }
|
{ deploy-reflection 1 }
|
||||||
{ deploy-threads? t }
|
|
||||||
{ deploy-word-props? f }
|
|
||||||
{ deploy-word-defs? f }
|
|
||||||
{ deploy-name "tools.deploy.test.1" }
|
|
||||||
{ deploy-math? t }
|
|
||||||
{ deploy-compiler? t }
|
|
||||||
{ "stop-after-last-window?" t }
|
|
||||||
{ deploy-ui? f }
|
{ deploy-ui? f }
|
||||||
|
{ "stop-after-last-window?" t }
|
||||||
|
{ deploy-word-props? f }
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
USING: tools.deploy.config ;
|
USING: tools.deploy.config ;
|
||||||
H{
|
H{
|
||||||
|
{ deploy-word-defs? f }
|
||||||
|
{ deploy-random? f }
|
||||||
|
{ deploy-name "tools.deploy.test.2" }
|
||||||
|
{ deploy-threads? t }
|
||||||
|
{ deploy-compiler? t }
|
||||||
|
{ deploy-math? t }
|
||||||
{ deploy-c-types? f }
|
{ deploy-c-types? f }
|
||||||
{ deploy-io 2 }
|
{ deploy-io 2 }
|
||||||
{ deploy-reflection 1 }
|
{ deploy-reflection 1 }
|
||||||
{ deploy-threads? t }
|
|
||||||
{ deploy-word-props? f }
|
|
||||||
{ deploy-word-defs? f }
|
|
||||||
{ deploy-name "tools.deploy.test.2" }
|
|
||||||
{ deploy-math? t }
|
|
||||||
{ deploy-compiler? t }
|
|
||||||
{ "stop-after-last-window?" t }
|
|
||||||
{ deploy-ui? f }
|
{ deploy-ui? f }
|
||||||
|
{ "stop-after-last-window?" t }
|
||||||
|
{ deploy-word-props? f }
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
USING: tools.deploy.config ;
|
USING: tools.deploy.config ;
|
||||||
H{
|
H{
|
||||||
{ deploy-math? t }
|
{ deploy-word-defs? f }
|
||||||
{ deploy-reflection 1 }
|
{ deploy-random? f }
|
||||||
{ deploy-name "tools.deploy.test.3" }
|
{ deploy-name "tools.deploy.test.3" }
|
||||||
{ deploy-threads? t }
|
{ deploy-threads? t }
|
||||||
{ deploy-word-props? f }
|
|
||||||
{ "stop-after-last-window?" t }
|
|
||||||
{ deploy-ui? f }
|
|
||||||
{ deploy-io 3 }
|
|
||||||
{ deploy-compiler? t }
|
{ deploy-compiler? t }
|
||||||
{ deploy-word-defs? f }
|
{ deploy-math? t }
|
||||||
{ deploy-c-types? f }
|
{ deploy-c-types? f }
|
||||||
|
{ deploy-io 3 }
|
||||||
|
{ deploy-reflection 1 }
|
||||||
|
{ deploy-ui? f }
|
||||||
|
{ "stop-after-last-window?" t }
|
||||||
|
{ deploy-word-props? f }
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,6 +35,7 @@ TUPLE: deploy-gadget vocab settings ;
|
||||||
deploy-compiler? get "Use optimizing compiler" <checkbox> gadget,
|
deploy-compiler? get "Use optimizing compiler" <checkbox> gadget,
|
||||||
deploy-math? get "Rational and complex number support" <checkbox> gadget,
|
deploy-math? get "Rational and complex number support" <checkbox> gadget,
|
||||||
deploy-threads? get "Threading support" <checkbox> gadget,
|
deploy-threads? get "Threading support" <checkbox> gadget,
|
||||||
|
deploy-random? get "Random number generator support" <checkbox> gadget,
|
||||||
deploy-word-props? get "Retain all word properties" <checkbox> gadget,
|
deploy-word-props? get "Retain all word properties" <checkbox> gadget,
|
||||||
deploy-word-defs? get "Retain all word definitions" <checkbox> gadget,
|
deploy-word-defs? get "Retain all word definitions" <checkbox> gadget,
|
||||||
deploy-c-types? get "Retain all C types" <checkbox> gadget, ;
|
deploy-c-types? get "Retain all C types" <checkbox> gadget, ;
|
||||||
|
|
Loading…
Reference in New Issue