Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
0.4.5 release candidate
  • Loading branch information
krame505 committed Oct 8, 2022
2 parents 4695479 + e81a69a commit 8200c87
Show file tree
Hide file tree
Showing 1,100 changed files with 65,141 additions and 43,337 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use nix
10 changes: 10 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Changes

# Documentation
Please briefly describe the documentation you have written in the following categories, or why you didn't write documentation for a category:
* what general comments you have added
* what doc comments you have added
* what documentation you have added to the website for users of Silver
* what documentation you have added to the website for developers of Silver

*Please remove all the prefilled text after the "Documentation" heading before submitting your pull request.*
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ runtime/imp/main/src/ide
runtime/imp/main/src/silver
runtime/imp/main/target
runtime/java/bin/
test/**/*.test.output
*.test.output
test/**/test.jar
test/silver.testing.bin.jar
test/silver_features/test_out.txt
tutorials/**/output.c

# direnv
.direnv/

# Useful spot to stash your experiments
sandbox
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"silver.jvmArgs": "-Xmx10G -Xss40M"
}
43 changes: 34 additions & 9 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ melt.setProperties(overrideJars: true)
melt.trynode('silver') {
def WS = pwd()
def SILVER_GEN = "${WS}/generated"
def newenv = silver.getSilverEnv(WS)

stage("Build") {

melt.clearGenerated()

checkout scm

// Bootstrap logic to obtain jars
Expand Down Expand Up @@ -69,21 +72,36 @@ melt.trynode('silver') {
sh "./deep-rebuild"
// Clean (but leave generated files)
sh "./deep-clean -delete"
// Generate docs
sh "./make-docs"
// Package
sh "rm -rf silver-latest* || true" // Robustness to past failures
sh "./make-dist latest"
// Upon succeeding at initial build, archive for future builds
archiveArtifacts(artifacts: "jars/*.jar", fingerprint: true)
melt.archiveCommitArtifacts("jars/*.jar")
}

stage("Modular Analyses") {
sh "./self-compile --clean --mwda --dont-translate"
}

stage("Test") {
def tests = ["silver_features", "copper_features", "patt", "stdlib", "performance", "csterrors"]
def tuts = ["simple/with_all", "simple/with_do_while", "simple/with_repeat_until", "simple/with_implication", "simple/host", "dc", "lambda", "turing", "hello"]
// These test cases and tutorials are run as seperate tasks to allow for parallelism
def tests = ["silver_features", "copper_features", "patt", "flow", "stdlib", "performance", "csterrors", "silver_construction", "origintracking", "implicit_monads"]
def tuts = ["simple/with_all", "simple/with_do_while", "simple/with_repeat_until", "simple/with_implication", "simple/host", "simple/arb_host", "simple/arb_with_all", "dc", "lambda", "turing", "hello", "stlc"]

def tasks = [:]
tasks << tests.collectEntries { t -> [(t): task_test(t, WS)] }
tasks << tuts.collectEntries { t -> [(t): task_tutorial(t, WS)] }

// Build test driver
withEnv (newenv) {
dir ("${WS}/test") {
sh "silver --clean silver:testing:bin"
}
}

// Unpack tarball (into ./silver-latest/) (for tutorial testing)
sh "tar zxf silver-latest.tar.gz"
// Run tests
Expand All @@ -96,7 +114,7 @@ melt.trynode('silver') {
// Projects with 'develop' as main branch, we'll try to build specific branch names if they exist
def github_projects = ["/melt-umn/ableC", "/melt-umn/Oberon0", "/melt-umn/ableJ14", "/melt-umn/meta-ocaml-lite",
"/melt-umn/lambda-calculus", "/melt-umn/rewriting-regex-matching", "/melt-umn/rewriting-optimization-demo",
"/internal/ring"]
"/internal/ring", "/melt-umn/caml-light"]
// Specific other jobs to build
def specific_jobs = ["/internal/matlab/master", "/internal/metaII/master", "/internal/simple/master"]
// AbleP is now downstream from Silver-AbleC, so we don't need to build it here: "/melt-umn/ableP/master"
Expand All @@ -122,8 +140,12 @@ melt.trynode('silver') {
// NOTE: we exclude generated, which means there's no generated dir in the custom
// location, which means if you don't set it, things should blow up.

sh "rsync -a --delete generated/doc/ ${silver.SILVER_WORKSPACE}/../custom-silver-doc/"

sh "cp silver-latest.tar.gz ${melt.ARTIFACTS}/"
sh "cp jars/*.jar ${melt.ARTIFACTS}/"

build "/melt-umn/melt-website/master"
}
}

Expand All @@ -142,16 +164,19 @@ def getMergedBranch() {

// Test in local workspace
def task_test(String testname, String WS) {
def newenv = silver.getSilverEnv(WS)
return {
node {
sh "touch ensure_workspace" // convince jenkins to create our workspace
def GEN = pwd() // This node's workspace
// Go back to our "parent" workspace, into the test
dir(WS + '/test/' + testname) {
sh "./silver-compile --clean -G ${GEN}"
if (fileExists("test.jar")) {
sh "java -Xss2M -jar test.jar"
sh "rm test.jar"
// Go back to our "parent" workspace, into the tests directory
dir(WS + '/test/') {
// HACK: edit the test specs to specify the generated directory
sh "./set-generated-dir ${GEN} ${testname}"
// Run the tests
withEnv (newenv) {
echo "Running test ${testname}"
sh "java -jar silver.testing.bin.jar ${testname}"
}
}
// Blow away these generated files in our private workspace
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ extensions, with language features and analyses to support this.

## Using silver

Silver requires Java 8, Ant, Bash, and wget. It can run on Linux, MacOS, and Windows Subsystem for Linux (WSL) in Windows 10.
Silver requires Java 8, Ant 1.10.0, Bash, and wget. It can run on Linux, MacOS, and Windows Subsystem for Linux (WSL) in Windows 10.

See [The Silver Install Guide](http://melt.cs.umn.edu/silver/install-guide)
for detailed information on how to get Silver set up.
Expand Down Expand Up @@ -67,3 +67,4 @@ Silver and Copper are distributed under the GNU Lesser General Public
License. See the files COPYING and COPYING.LESSER for details of
these licenses. More information can be found at
http://www.gnu.org/licenses/.

7 changes: 0 additions & 7 deletions build-everything

This file was deleted.

12 changes: 6 additions & 6 deletions deep-clean
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# ./deep-clean to test the waters (dry run)
# ./deep-clean -delete to blow it away
Expand All @@ -10,7 +10,7 @@ if [ ! -d grammars ] || [ ! -d tutorials ]; then
exit 1
fi

# Note: use ./* rather than . This avoids looking in .hg
# Note: use ./* rather than . This avoids looking in .git
find ./build/ $1
find ./grammars/ -name "build.xml" $1
find ./* -name "*~" $1
Expand All @@ -29,10 +29,10 @@ find ./tutorials/ -name "build.xml" $1
find ./tutorials/ -name "output.c" $1
find "build.xml" $1
find "silver.testing.bin.jar" $1
find ./runtime/imp/main/src/core $1
find ./runtime/imp/main/src/ide $1
find ./runtime/imp/main/target $1
find ./runtime/lsp4j/target $1
find ./language-server/langserver/target $1
find ./language-server/launcher/target $1

if [ "$2" == "all" ]; then
rm -rf generated/src/* generated/bin/* runtime/java/bin/* generated/ide/*
rm -rf generated/src/* generated/bin/* runtime/java/bin/* generated/doc/*
fi
49 changes: 36 additions & 13 deletions deep-rebuild
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
#!/bin/bash
#!/usr/bin/env bash

set -eu

export SILVER_HOME=$(pwd)
JVM_ARGS="-Xss8M -Xmx2000M -jar ../jars/silver.composed.Default.jar"
JVM_ARGS="-Xss16M -Xmx5G -jar ../jars/silver.compiler.composed.Default.jar"
export ANT_OPTS=-Xss10M

# just run this script, no parameters or options.
# One new option: --newcore, for when the core FFI stuff has to change in tandem with the runtime
# Only I should ever have to use this, as once it's done ONCE, fetch-jars will eliminate anyone else's need to do it.

trap 'echo -e "\a"' EXIT

mkdir -p build
cd build

Expand All @@ -20,9 +23,15 @@ fi
# Modifications may have been made to how the translation is done

echo "One full cycle ..."
time java $JVM_ARGS --relative-jar --clean silver:composed:Default
echo ""
echo " > Silver Build"
echo " Silver Build"
echo " Runtime Build"
echo " Silver Build"
echo ""
time java $JVM_ARGS --relative-jar --clean silver:compiler:composed:Default
ant
mv silver.composed.Default.jar ../jars/
mv silver.compiler.composed.Default.jar ../jars/

# Modifications may need to be made to how core translates, to accomodate translation/runtime changes
if [ $# -gt 0 ] && [ "$1" == "--newcore" ]; then
Expand All @@ -33,34 +42,48 @@ fi

# Should backup old jars here

echo "Before we start, let's get this thing built ..."
java $JVM_ARGS --clean silver:support:monto
java $JVM_ARGS --clean lib:xml:ast
echo ""
echo " Silver Build"
echo " > Silver Build"
echo " Runtime Build"
echo " Silver Build"
echo ""
echo "Start ..."
time java $JVM_ARGS --relative-jar --clean silver:composed:Default
# Also building silver:xml:ast here since the runtime depends on that
time java $JVM_ARGS --relative-jar --clean silver:compiler:composed:Default silver:xml:ast

# Modifications may have been made to the runtime

echo "No ant yet! Let's go build the runtime! ..."
echo ""
echo " Silver Build"
echo " Silver Build"
echo " > Runtime Build"
echo " Silver Build"
echo ""
cd ../runtime/java
ant
mv SilverRuntime.jar ../../jars/
cd ../../build
echo "Now finish ..."
ant
mv silver.composed.Default.jar ../jars/
mv silver.compiler.composed.Default.jar ../jars/

# Finally, we should have a fully working binary on all the new code. Run it again to reach a fixed point:

echo "One more full cycle ..."
time java -ea $JVM_ARGS --relative-jar --clean silver:composed:Default
echo ""
echo " Silver Build"
echo " Silver Build"
echo " Runtime Build"
echo " > Silver Build"
echo ""
time java -ea $JVM_ARGS --relative-jar --clean silver:compiler:composed:Default
ant
mv silver.composed.Default.jar ../jars/
mv silver.compiler.composed.Default.jar ../jars/

# If the last build failed, should restore backup jars

echo -e "\a"

echo "Cleaning out stale runtime class files..."
rm -rf ../generated/bin/common

Expand Down
31 changes: 22 additions & 9 deletions fetch-jars
Original file line number Diff line number Diff line change
@@ -1,20 +1,33 @@
#!/bin/bash
#!/usr/bin/env bash

set -eu

LOCAL_STORE=/web/research/melt.cs.umn.edu/downloads/silver-dev/jars
REMOTE_STORE="http://melt.cs.umn.edu/downloads/silver-dev/jars"
# Usage: ./fetch-jars [rev-name] [--copper]


if [[ $* != *--copper* && $# -gt 0 || $# -gt 1 ]]; then
rev=$(git rev-parse $1)
echo "Warning: Fetching unstable jars! (commit $rev)"

LOCAL_STORE=
REMOTE_STORE="https://foundry.remexre.xyz/commit-artifacts/$rev"
JARS_BAK="JARS-BAK/$rev"
else
LOCAL_STORE=/web/research/melt.cs.umn.edu/downloads/silver-dev/jars
REMOTE_STORE="https://melt.cs.umn.edu/downloads/silver-dev/jars"
JARS_BAK=JARS-BAK
fi

if [[ $* == *--copper* ]]; then
# Only fetch the Copper jars, if requested
FILES="CopperCompiler.jar CopperRuntime.jar"
FILES="CopperCompiler.jar"
else
FILES="CopperCompiler.jar CopperRuntime.jar silver.composed.Default.jar SilverRuntime.jar IDEPluginRuntime.jar jeromq-0.3.4.jar gson-2.8.0.jar"
FILES="CopperCompiler.jar commonmark-0.17.1.jar silver.compiler.composed.Default.jar SilverRuntime.jar"
fi

mkdir -p jars

if [ -d $LOCAL_STORE ]; then
if [[ -n "$LOCAL_STORE" && -d $LOCAL_STORE ]]; then
for file in $FILES; do
cp $LOCAL_STORE/$file jars/
done
Expand All @@ -29,16 +42,16 @@ else
done

# We're going to download them to here
mkdir -p JARS-BAK
mkdir -p $JARS_BAK

# -N Pay attention to timestamps, to avoid needless redownloads.
# -P jars/ Put the files in jars/
# -nv Don't be so verbose!
wget -N -P JARS-BAK/ -nv $URLS
wget -N -P $JARS_BAK/ -nv $URLS

# Always overwrite all the files in jars.
for file in $FILES; do
cp JARS-BAK/$file jars/
cp $JARS_BAK/$file jars/
done
fi

2 changes: 1 addition & 1 deletion generated/link-to-export-scratch.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -eu

Expand Down
Empty file removed generated/tests.skip
Empty file.
8 changes: 0 additions & 8 deletions grammars/core/DocConfig.sv

This file was deleted.

Loading

0 comments on commit 8200c87

Please sign in to comment.