Skip to content

Commit

Permalink
Merge pull request #805 from melt-umn/develop
Browse files Browse the repository at this point in the history
Silver 0.5.0 release candidate
  • Loading branch information
krame505 authored Sep 26, 2023
2 parents 8200c87 + 248671f commit 7a38df9
Show file tree
Hide file tree
Showing 363 changed files with 12,125 additions and 4,588 deletions.
5 changes: 4 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ Please briefly describe the documentation you have written in the following cate
* 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.*
# Testing
Please briefly describe the tests you have written for the changes included in this pull request, or why it is not possible to test the changes.

*Please remove all the prefilled text other than the headings before submitting your pull request.*
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"silver.jvmArgs": "-Xmx10G -Xss40M"
"silver.jvmArgs": "-Xmx10G -Xss40M",
"java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx2G -Xms100m -Xlog:disable",
"silver.compilerJar": "jars/silver.compiler.composed.Default.jar"
}
46 changes: 36 additions & 10 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,17 @@ melt.trynode('silver') {
if (source == 'develop') {
source = "${silver.SILVER_WORKSPACE}/jars"
}
// Obtain jars from specified location
sh "mkdir -p jars"
sh "cp ${source}/* jars/"
melt.annotate("Jars overridden.")
String branchJob = "/melt-umn/silver/${hudson.Util.rawEncode(source)}"
if(melt.doesJobExist(branchJob)) {
// Obtain jars from specified branch
melt.annotate("Jars overidden from branch.")
copyArtifacts(projectName: branchJob, selector: lastCompleted())
} else {
// Obtain jars from specified location
melt.annotate("Jars overridden from path.")
sh "mkdir -p jars"
sh "cp ${source}/* jars/"
}
} else {
// We start by obtaining normal jars, but we potentially overwrite them:
// (This is the least annoying way to go about this...)
Expand Down Expand Up @@ -74,18 +81,30 @@ melt.trynode('silver') {
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("Language server") {
sh "./make-vscode-extension"
archiveArtifacts(artifacts: "support/vs-code/silverlsp/*.vsix", fingerprint: true)
melt.archiveCommitArtifacts("support/vs-code/silverlsp/*.vsix")
}

stage("Package") {
sh "rm -rf silver-latest* || true" // Robustness to past failures
sh "./make-dist latest"
}

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

// Avoid deadlock condition from all executor slots being filled with builds
// that are waiting for downstream builds to finish.
waitUntil { melt.isExecutorAvailable() }

stage("Test") {
// 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"]
Expand All @@ -110,14 +129,20 @@ melt.trynode('silver') {
sh "rm -rf silver-latest"
}

// Avoid deadlock condition from all executor slots being filled with builds
// that are waiting for downstream builds to finish.
waitUntil { melt.isExecutorAvailable() }

stage("Integration") {
// 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",
def github_projects = ["/melt-umn/ableC", "/melt-umn/Oberon0", "/melt-umn/meta-ocaml-lite",
"/melt-umn/lambda-calculus", "/melt-umn/rewriting-regex-matching", "/melt-umn/rewriting-optimization-demo",
"/internal/ring", "/melt-umn/caml-light"]
"/melt-umn/caml-light"]
// These are not currently maintened: "/internal/ring"
// Specific other jobs to build
def specific_jobs = ["/internal/matlab/master", "/internal/metaII/master", "/internal/simple/master"]
def specific_jobs = ["/internal/matlab/master"]
// AbleP is now downstream from Silver-AbleC, so we don't need to build it here: "/melt-umn/ableP/master"
// These are not currently maintened: "/internal/simple/master"

def tasks = [:]
tasks << github_projects.collectEntries { t ->
Expand All @@ -144,6 +169,7 @@ melt.trynode('silver') {

sh "cp silver-latest.tar.gz ${melt.ARTIFACTS}/"
sh "cp jars/*.jar ${melt.ARTIFACTS}/"
sh "cp support/vs-code/silverlsp/silverlsp-latest.vsix ${melt.ARTIFACTS}/"

build "/melt-umn/melt-website/master"
}
Expand Down
1 change: 1 addition & 0 deletions deep-clean
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ find "silver.testing.bin.jar" $1
find ./runtime/lsp4j/target $1
find ./language-server/langserver/target $1
find ./language-server/launcher/target $1
find ./support/vs-code/silverlsp/out $1

if [ "$2" == "all" ]; then
rm -rf generated/src/* generated/bin/* runtime/java/bin/* generated/doc/*
Expand Down
2 changes: 1 addition & 1 deletion deep-rebuild
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -eu

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

# just run this script, no parameters or options.
Expand Down
89 changes: 71 additions & 18 deletions fetch-jars
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,90 @@

set -eu

# Usage: ./fetch-jars [rev-name] [--copper]
# Usage: ./fetch-jars [rev-name] [--unstable] [--copper]
# If a revision is not specified, the script fetches the latest jars from the current branch,
# falling back to develop.
# If --unstable is specified, always fetch from commit artifacts on foundry.
# If --copper is specified, only fetch the Copper jars.

# Parse command line argumants.
# Hacky, but getopts seems like overkill for this...
rev_name=""
for arg in "$@"; do
if [[ $arg != -* ]]; then
rev_name=$arg
break
fi
done

if [[ $* != *--copper* && $# -gt 0 || $# -gt 1 ]]; then
rev=$(git rev-parse $1)
echo "Warning: Fetching unstable jars! (commit $rev)"
COMMIT_ARTIFACTS="https://foundry.remexre.xyz/commit-artifacts/"

LOCAL_STORE=
REMOTE_STORE="https://foundry.remexre.xyz/commit-artifacts/$rev"
JARS_BAK="JARS-BAK/$rev"
function has_jars {
wget --spider -q "$COMMIT_ARTIFACTS/$1"
}

rev=""

# Look for jars in the specified revision
if [[ -n $rev_name ]]; then
rev=$(git rev-parse "$rev_name")
fi

# Get the hash of the latest commit on develop.
# This always gives the latest commit regardless of if the repo is up to date,
# and works in a Jenkins checkout.
DEVELOP=$(git ls-remote https://github.com/melt-umn/silver develop | cut -f1)

# Look for jars in the current commit and its parents.
# First, check that we are inside a git repo.
if [[ -z $rev ]] && git rev-parse --is-inside-work-tree 1> /dev/null 2> /dev/null; then
# Walk the history in topological order, fully exploring each chain of commits
# before newer commits from other merged chain.
for commit in $(git rev-list --topo-order HEAD "^$DEVELOP"); do
echo "Looking for jars from past commit $commit"
if has_jars "$commit"; then
echo "Found jars from past commit"
rev=$commit
break
fi
done
fi

# Figure out how to obtain the jars from the revision we chose.
if [[ $* != *--unstable* && (-z $rev || $rev == "$DEVELOP") ]]; then
echo "Fetching latest stable jars..."
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
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
git --no-pager show --quiet "$rev"
if ! has_jars "$rev"; then
echo "Cound not find jars for commit"
exit 1
fi
echo "Warning: Fetching unstable jars!"
LOCAL_STORE=
REMOTE_STORE="$COMMIT_ARTIFACTS/$rev"
JARS_BAK="JARS-BAK/$rev"
fi

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


mkdir -p jars

if [[ -n "$LOCAL_STORE" && -d $LOCAL_STORE ]]; then
# We have downloaded the jars before, just go copy them.
for file in $FILES; do
cp $LOCAL_STORE/$file jars/
cp "$LOCAL_STORE/$file" jars/
done
else
# Download the jars.
# There's probably a better way to do this!
# Using -r causes lots of pointless downloads of variations of the index.html
# even if -A.jar is used they still get downloaded...
Expand All @@ -42,16 +96,15 @@ 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

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
grammar silver:compiler:analysis:typechecking:core;

attribute upSubst, downSubst, finalSubst occurs on AspectProductionSignature, AspectProductionLHS, AspectRHS, AspectRHSElem, AspectFunctionSignature, AspectFunctionLHS;
propagate finalSubst on AspectProductionSignature, AspectProductionLHS, AspectRHS, AspectRHSElem, AspectFunctionSignature, AspectFunctionLHS;

aspect production aspectProductionDcl
top::AGDcl ::= 'aspect' 'production' id::QName ns::AspectProductionSignature body::ProductionBody
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ top::AGDcl ::= 'synthesized' 'attribute' a::Name tl::BracketedOptTypeExprs '::'
top.errors <- te.errorsKindStar;
}

aspect production attributeDclTrans
top::AGDcl ::= 'translation' 'attribute' a::Name tl::BracketedOptTypeExprs '::' te::TypeExpr ';'
{
top.errors <- te.errorsKindStar;
}

Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ top::TypeCheck ::= l::Type r::Type
}

abstract production checkNonterminal
top::TypeCheck ::= e::Decorated Env allowDecorableSkolems::Boolean l::Type
top::TypeCheck ::= e::Env allowDecorableSkolems::Boolean l::Type
{
local refined :: Type =
performSubstitution(l, top.downSubst);
Expand Down Expand Up @@ -57,7 +57,7 @@ top::TypeCheck ::= l::Type
top.rightpp = "a decorated nonterminal";
}
abstract production checkDecorable
top::TypeCheck ::= e::Decorated Env l::Type
top::TypeCheck ::= e::Env l::Type
{
local refined :: Type =
performSubstitution(l, top.downSubst);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
grammar silver:compiler:analysis:typechecking:core;

import silver:compiler:definition:flow:env only getFlowTypeSpecFor, flowEnv;
import silver:compiler:analysis:warnings:flow only inhDepsForSynOnType;
import silver:util:treeset as set;

Expand Down
Loading

0 comments on commit 7a38df9

Please sign in to comment.