From 14313b1c68a1c068ec841b4ac8aa074f0784267a Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Fri, 18 Jul 2014 16:10:16 +0100 Subject: Use run_morph in yarns This is required to ensure the right version of morph is used. I have a .bashrc that causes `morph` to be "$HOME/morph/morph", so it fails to find morph, because HOME is set to a directory inside DATADIR. --- yarns/implementations.yarn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'yarns/implementations.yarn') diff --git a/yarns/implementations.yarn b/yarns/implementations.yarn index d32bfd61..f0b5c80a 100644 --- a/yarns/implementations.yarn +++ b/yarns/implementations.yarn @@ -441,7 +441,7 @@ architecture as the machine doing the testing. This uses `morph print-architecture` to get a value appropriate for morph. IMPLEMENTS WHEN the user creates an uncommitted system morphology called (\S+) for our architecture in system branch (\S+) - arch=$(morph print-architecture) + arch=$(run_morph print-architecture) name="$(basename "${MATCH_1%.*}")" install -m644 -D /dev/stdin << EOF "$DATADIR/workspace/$MATCH_2/test/morphs/$MATCH_1" arch: $arch -- cgit v1.2.1 From a464a9e4f1e20ce98308470ac8adf87fec415407 Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Fri, 18 Jul 2014 16:10:18 +0100 Subject: Remove use of "morph" field in chunk specs in yarns We don't use this in definitions.git, and we're going to change its semantics, so the test suite would break until we introduced the new semantics, unless we remove its use of the old semantics first. --- yarns/implementations.yarn | 3 --- 1 file changed, 3 deletions(-) (limited to 'yarns/implementations.yarn') diff --git a/yarns/implementations.yarn b/yarns/implementations.yarn index f0b5c80a..2c325985 100644 --- a/yarns/implementations.yarn +++ b/yarns/implementations.yarn @@ -88,7 +88,6 @@ another to hold a chunk. - name: test-chunk repo: test:test-chunk ref: master - morph: test-chunk build-mode: test build-depends: [] EOF @@ -281,7 +280,6 @@ have a morphology using the test architecture. - name: stage1-chunk repo: test:test-chunk ref: master - morph: stage1-chunk build-mode: bootstrap build-depends: [] EOF @@ -295,7 +293,6 @@ have a morphology using the test architecture. - name: test-chunk repo: test:test-chunk ref: master - morph: test-chunk build-mode: test build-depends: [] EOF -- cgit v1.2.1 From e86eae318a83a429a0f27954866217ebf2efa6a5 Mon Sep 17 00:00:00 2001 From: Adam Coldrick Date: Fri, 18 Jul 2014 16:10:24 +0100 Subject: yarns: Test building and deployment of a system with a chunk in definitions --- yarns/implementations.yarn | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'yarns/implementations.yarn') diff --git a/yarns/implementations.yarn b/yarns/implementations.yarn index 2c325985..ce229d6c 100644 --- a/yarns/implementations.yarn +++ b/yarns/implementations.yarn @@ -87,16 +87,12 @@ another to hold a chunk. chunks: - name: test-chunk repo: test:test-chunk + morph: test-chunk.morph ref: master build-mode: test build-depends: [] EOF - run_in "$DATADIR/gits/morphs" git init . - run_in "$DATADIR/gits/morphs" git add . - run_in "$DATADIR/gits/morphs" git commit -m Initial. - run_in "$DATADIR/gits/morphs" git tag -a "test-tag" -m "Tagging test-tag" - # Create the chunk repository. mkdir "$DATADIR/gits/test-chunk" @@ -105,7 +101,7 @@ another to hold a chunk. # dummy files in all the places that different kinds of files are # usually installed. e.g. executables in `/bin` and `/usr/bin` - install -m644 -D /dev/stdin << 'EOF' "$DATADIR/gits/test-chunk/test-chunk.morph" + install -m644 -D /dev/stdin << 'EOF' "$DATADIR/gits/morphs/test-chunk.morph" name: test-chunk kind: chunk build-system: manual @@ -239,9 +235,14 @@ another to hold a chunk. done EOF + run_in "$DATADIR/gits/morphs" git init . + run_in "$DATADIR/gits/morphs" git add . + run_in "$DATADIR/gits/morphs" git commit -m Initial. + run_in "$DATADIR/gits/morphs" git tag -a "test-tag" -m "Tagging test-tag" + run_in "$DATADIR/gits/test-chunk" git init . run_in "$DATADIR/gits/test-chunk" git add . - run_in "$DATADIR/gits/test-chunk" git commit -m Initial. + run_in "$DATADIR/gits/test-chunk" git commit --allow-empty -m Initial. # Create the Morph configuration file so we can access the repos # using test:foo URL aliases. @@ -262,15 +263,14 @@ have a morphology using the test architecture. IMPLEMENTS GIVEN a system called (\S+) for the test architecture in the git server - cat << EOF > "$DATADIR/gits/test-chunk/stage1-chunk.morph" + cat << EOF > "$DATADIR/gits/morphs/stage1-chunk.morph" name: stage1-chunk kind: chunk build-system: dummy EOF - run_in "$DATADIR/gits/test-chunk" git init . - run_in "$DATADIR/gits/test-chunk" git add . - run_in "$DATADIR/gits/test-chunk" git commit -m Initial. + run_in "$DATADIR/gits/morphs" git add . + run_in "$DATADIR/gits/morphs" git commit -m "Add chunk for $MATCH_1" install -m644 -D /dev/stdin << EOF "$DATADIR/gits/morphs/strata/build-essential.morph" @@ -278,6 +278,7 @@ have a morphology using the test architecture. kind: stratum chunks: - name: stage1-chunk + morph: stage1-chunk.morph repo: test:test-chunk ref: master build-mode: bootstrap @@ -291,6 +292,7 @@ have a morphology using the test architecture. - morph: strata/build-essential.morph chunks: - name: test-chunk + morph: test-chunk.morph repo: test:test-chunk ref: master build-mode: test -- cgit v1.2.1 From fc5bb595b123db557d2b10a8d570d25e14119686 Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Fri, 18 Jul 2014 16:10:25 +0100 Subject: yarns: Make test-chunk use files from its source repo It is entirely possible that we could accidentally give chunks that use morphologies from the definitions repository, the definitions repository to build from, rather than the source repository. --- yarns/implementations.yarn | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'yarns/implementations.yarn') diff --git a/yarns/implementations.yarn b/yarns/implementations.yarn index ce229d6c..5b5b1724 100644 --- a/yarns/implementations.yarn +++ b/yarns/implementations.yarn @@ -156,7 +156,7 @@ another to hold a chunk. # autotools configuration, they go into /libexec. - | - install -D /dev/null "$DESTDIR/$PREFIX/libexec/test-bin" + install -D test-bin "$DESTDIR/$PREFIX/libexec/test-bin" # As well as run-time libraries, there's development files. For C # this is headers, which describe the API of the libraries, which @@ -169,7 +169,7 @@ another to hold a chunk. # `-m` option. - | - install -D -m 644 /dev/null "$DESTDIR/$PREFIX/include/test.h" + install -D -m 644 test.h "$DESTDIR/$PREFIX/include/test.h" # `pkg-config` is a standard way to locate libraries and get the # compiler flags needed to build with the library. It's also used @@ -179,7 +179,7 @@ another to hold a chunk. - | for pkgdir in lib lib32 lib64 share; do - install -D -m 644 /dev/null \ + install -D -m 644 test.pc \ "$DESTDIR/$PREFIX/$pkgdir/pkgconfig/test.pc" done @@ -241,6 +241,19 @@ another to hold a chunk. run_in "$DATADIR/gits/morphs" git tag -a "test-tag" -m "Tagging test-tag" run_in "$DATADIR/gits/test-chunk" git init . + cat > "$DATADIR/gits/test-chunk/test-bin" <<'EOF' + #!/bin/sh + echo Hello World + EOF + cat > "$DATADIR/gits/test-chunk/test.h" <<'EOF' + int foo(void); + EOF + cat > "$DATADIR/gits/test-chunk/test.pc" <<'EOF' + prefix=/usr + includedir=${prefix}/include + Name: test + Cflags: -I{includedir} + EOF run_in "$DATADIR/gits/test-chunk" git add . run_in "$DATADIR/gits/test-chunk" git commit --allow-empty -m Initial. -- cgit v1.2.1