Merge remote-tracking branch 'origin/master' into modern-harvey2

modern-harvey2
Doug Coleman 2018-06-29 03:17:55 -05:00
commit 69c000088d
9 changed files with 110 additions and 97 deletions

View File

@ -5,9 +5,6 @@ compiler:
os:
- linux
- osx
branches:
only:
- master
sudo: required
dist: trusty
group: deprecated-2017Q4

View File

@ -1,26 +1,10 @@
! Copyright (C) 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays kernel combinators assocs
namespaces sequences splitting words
fry urls multiline present
xml
xml.data
xml.entities
xml.writer
xml.traversal
xml.syntax
html.components
html.forms
html.templates
html.templates.chloe
html.templates.chloe.compiler
html.templates.chloe.syntax
http
http.server
http.server.redirection
http.server.responses
io.streams.string
furnace.utilities ;
USING: accessors assocs combinators fry furnace.utilities
html.components html.forms html.templates
html.templates.chloe.compiler html.templates.chloe.syntax kernel
namespaces present sequences splitting urls xml.data xml.syntax
xml.traversal xml.writer ;
IN: furnace.chloe-tags
! Chloe tags

View File

@ -83,7 +83,6 @@ SYMBOL: vocab-articles
] map ;
: contains-funky-elements? ( element -- ? )
B
{
$shuffle
$complex-shuffle

View File

@ -1,36 +1,14 @@
! Copyright (C) 2003, 2010 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: kernel accessors sequences arrays namespaces splitting
vocabs.loader destructors assocs debugger continuations
combinators combinators.short-circuit vocabs.refresh
tools.time math present vectors hashtables
io
io.sockets
io.sockets.secure
io.encodings
io.encodings.iana
io.encodings.utf8
io.encodings.ascii
io.encodings.binary
io.streams.limited
io.streams.string
io.streams.throwing
io.servers
io.timeouts
io.crlf
fry logging logging.insomniac calendar urls
unicode
http
http.server.requests
http.server.responses
http.server.remapping
html.templates
html.streams
html
mime.types
math.order
xml.writer
vocabs ;
USING: accessors arrays assocs combinators
combinators.short-circuit continuations debugger destructors fry
hashtables html html.streams html.templates http
http.server.remapping http.server.requests http.server.responses
io io.crlf io.encodings io.encodings.ascii io.encodings.iana
io.encodings.utf8 io.servers io.sockets io.sockets.secure
io.streams.limited kernel logging logging.insomniac math
mime.types namespaces present sequences splitting tools.time
urls vectors vocabs vocabs.refresh xml.writer ;
IN: http.server
GENERIC: write-response ( response -- )
@ -187,7 +165,7 @@ SYMBOL: params
[
local-address get
[ secure? "https" "http" ? >>protocol ]
[ port>> remap-port '[ _ or ] change-port ]
[ port>> remap-port >>port ]
bi
] change-url drop ;

View File

@ -91,11 +91,13 @@ set_downloader() {
test_program_installed wget
if [[ $? -ne 0 ]] ; then
DOWNLOADER=wget
DOWNLOADER_NAME=wget
return
fi
test_program_installed curl
if [[ $? -ne 0 ]] ; then
DOWNLOADER="curl -f -O"
DOWNLOADER_NAME=curl
return
fi
$ECHO "error: wget or curl required"
@ -437,7 +439,7 @@ find_build_info() {
find_num_cores
set_cc
find_word_size
find_branch
set_current_branch
set_factor_binary
set_factor_library
set_factor_image
@ -559,7 +561,38 @@ current_git_branch() {
git rev-parse --abbrev-ref HEAD
}
find_branch() {
check_url() {
if [[ $DOWNLOADER_NAME == 'wget' ]]; then
if [[ `wget -S --spider $1 2>&1 | grep 'HTTP/1.1 200 OK'` ]]; then
return 0
else
return 1
fi
elif [[ $DOWNLOADER_NAME == 'curl' ]]; then
code=`curl -sL -w "%{http_code}\\n" "$1" -o /dev/null`
if [[ $code -eq 200 ]]; then return 0; else return 1; fi
else
$ECHO "error: wget or curl required in check_url"
exit_script 12
fi
}
# If we are on a branch, first try to get a boot image for that branch.
# Otherwise, just use `master`
set_boot_image_vars() {
set_current_branch
url="http://downloads.factorcode.org/images/${CURRENT_BRANCH}/checksums.txt"
check_url $url
if [[ $? -eq 0 ]]; then
CHECKSUM_URL="http://downloads.factorcode.org/images/${CURRENT_BRANCH}/checksums.txt"
BOOT_IMAGE_URL="http://downloads.factorcode.org/images/${CURRENT_BRANCH}/${BOOT_IMAGE}"
else
CHECKSUM_URL="http://downloads.factorcode.org/images/master/checksums.txt"
BOOT_IMAGE_URL="http://downloads.factorcode.org/images/master/${BOOT_IMAGE}"
fi
}
set_current_branch() {
if [ -z ${TRAVIS_BRANCH} ]; then
CURRENT_BRANCH=$(current_git_branch)
else
@ -567,20 +600,15 @@ find_branch() {
fi
}
checksum_url() {
find_branch
echo "http://downloads.factorcode.org/images/$CURRENT_BRANCH/checksums.txt"
}
update_boot_images() {
find_branch
update_boot_image() {
set_boot_image_vars
$ECHO "Deleting old images..."
$DELETE checksums.txt* > /dev/null 2>&1
# delete boot images with one or two characters after the dot
$DELETE $BOOT_IMAGE.{?,??} > /dev/null 2>&1
$DELETE temp/staging.*.image > /dev/null 2>&1
if [[ -f $BOOT_IMAGE ]] ; then
get_url $(checksum_url)
get_url $CHECKSUM_URL
factorcode_md5=`cat checksums.txt|grep $BOOT_IMAGE|cut -f2 -d' '`
set_md5sum
disk_md5=`$MD5SUM $BOOT_IMAGE|cut -f1 -d' '`
@ -590,21 +618,16 @@ update_boot_images() {
$ECHO "Your disk boot image matches the one on factorcode.org."
else
$DELETE $BOOT_IMAGE > /dev/null 2>&1
get_boot_image;
get_boot_image
fi
else
get_boot_image
fi
}
boot_image_url() {
find_branch
echo "http://downloads.factorcode.org/images/$CURRENT_BRANCH/$BOOT_IMAGE"
}
get_boot_image() {
$ECHO "Downloading boot image $BOOT_IMAGE."
get_url $(boot_image_url)
get_url "${BOOT_IMAGE_URL}"
}
get_url() {
@ -638,6 +661,7 @@ install() {
git_clone
cd_factor
make_factor
set_boot_image_vars
get_boot_image
bootstrap
}
@ -650,7 +674,7 @@ update() {
}
download_and_bootstrap() {
update_boot_images
update_boot_image
bootstrap
}
@ -713,6 +737,7 @@ usage() {
$ECHO " net-bootstrap - recompile, download a boot image, bootstrap"
$ECHO " make-target - find and print the os-arch-cpu string"
$ECHO " report - print the build variables"
$ECHO " update-boot-image - get the boot image for the current branch of for master"
$ECHO ""
$ECHO "If you are behind a firewall, invoke as:"
$ECHO "env GIT_PROTOCOL=http $0 <command>"
@ -746,6 +771,7 @@ case "$1" in
make-target) FIND_MAKE_TARGET=true; ECHO=false; find_build_info; exit_script ;;
report) find_build_info ;;
full-report) find_build_info; check_installed_programs; check_libraries ;;
update-boot-image) find_build_info; check_installed_programs; update_boot_image;;
*) usage ;;
esac

View File

@ -16,8 +16,7 @@ CUDA-FUNCTION: helloWorld ( char* string-ptr )
[
context-device number>string
"CUDA device " ": " surround write
"Hello World!" [ - ] B{ } map-index-as host>device &cuda-free
"Hello World!" utf8 encode [ - ] B{ } map-index-as host>device &cuda-free
[ { 2 1 } { 6 1 1 } <grid> helloWorld ]
[ 12 device>host >string print ] bi
] with-destructors

View File

@ -32,3 +32,8 @@ cpu ppc? [
] with-mapped-macho
] unit-test
] unless
! Throw an exception if the struct is not defined/handled
os macosx? [
{ } [ vm-path dylib-exports drop ] unit-test
] when

View File

@ -128,6 +128,15 @@ CONSTANT: LC_LAZY_LOAD_DYLIB 0x20
CONSTANT: LC_ENCRYPTION_INFO 0x21
CONSTANT: LC_DYLD_INFO 0x22
CONSTANT: LC_DYLD_INFO_ONLY 0x80000022
CONSTANT: LC_LOAD_UPWARD_DYLIB 0x80000023
CONSTANT: LC_VERSION_MIN_MACOSX 0x24
CONSTANT: LC_VERSION_MIN_IPHONEOS 0x25
CONSTANT: LC_FUNCTION_STARTS 0x26
CONSTANT: LC_DYLD_ENVIRONMENT 0x27
CONSTANT: LC_MAIN 0x80000028
CONSTANT: LC_DATA_IN_CODE 0x29
CONSTANT: LC_SOURCE_VERSION 0x2A
CONSTANT: LC_DYLIB_CODE_SIGN_DRS 0x2B
UNION-STRUCT: lc_str
{ offset uint }
@ -448,6 +457,12 @@ STRUCT: dyld_info_command
{ export_off uint }
{ export_size uint } ;
STRUCT: version_min_command
{ cmd uint32_t }
{ cmdsize uint32_t }
{ version uint32_t }
{ sdk uint32_t } ;
CONSTANT: REBASE_TYPE_POINTER 1
CONSTANT: REBASE_TYPE_TEXT_ABSOLUTE32 2
CONSTANT: REBASE_TYPE_TEXT_PCREL32 3
@ -514,6 +529,22 @@ STRUCT: fvmfile_command
{ name lc_str }
{ header_addr uint } ;
STRUCT: entry_point_command
{ cmd uint32_t }
{ cmdsize uint32_t }
{ entryoff uint64_t }
{ stacksize uint64_t } ;
STRUCT: source_version_command
{ cmd uint32_t }
{ cmdsize uint32_t }
{ version uint64_t } ;
STRUCT: data_in_code_entry
{ offset uint32_t }
{ length uint16_t }
{ kind uint16_t } ;
! machine.h
CONSTANT: CPU_STATE_MAX 4
CONSTANT: CPU_STATE_USER 0
@ -881,6 +912,15 @@ TYPED: 64-bit? ( macho: mach_header_32/64 -- ? )
{ LC_SUB_CLIENT [ sub_client_command ] }
{ LC_DYLD_INFO [ dyld_info_command ] }
{ LC_DYLD_INFO_ONLY [ dyld_info_command ] }
{ LC_LOAD_UPWARD_DYLIB [ dylib_command ] }
{ LC_VERSION_MIN_MACOSX [ version_min_command ] }
{ LC_VERSION_MIN_IPHONEOS [ version_min_command ] }
{ LC_FUNCTION_STARTS [ linkedit_data_command ] }
{ LC_DYLD_ENVIRONMENT [ dylinker_command ] }
{ LC_MAIN [ entry_point_command ] }
{ LC_DATA_IN_CODE [ data_in_code_entry ] }
{ LC_SOURCE_VERSION [ source_version_command ] }
{ LC_DYLIB_CODE_SIGN_DRS [ linkedit_data_command ] }
} case ;
: read-command ( cmd -- next-cmd )

View File

@ -1,25 +1,10 @@
! Copyright (C) 2007, 2010 Slava Pestov
! See http://factorcode.org/license.txt for BSD license.
USING: namespaces assocs sorting sequences kernel accessors
hashtables db.types db.tuples db combinators
calendar calendar.format math.parser math.order syndication urls
xml.writer xmode.catalog validators
html.forms
html.components
html.templates.chloe
http.server
http.server.dispatchers
http.server.redirection
http.server.responses
furnace
furnace.actions
furnace.redirection
furnace.auth
furnace.auth.login
furnace.boilerplate
furnace.recaptcha
furnace.syndication
furnace.conversations ;
USING: accessors calendar db db.tuples db.types furnace.actions
furnace.auth furnace.boilerplate furnace.recaptcha
furnace.redirection furnace.syndication html.forms
http.server.dispatchers http.server.responses kernel math.parser
sequences sorting urls validators xmode.catalog ;
IN: webapps.pastebin
TUPLE: pastebin < dispatcher ;