Skip to content

Commit

Permalink
bazel-genfiles --> bazel-bin
Browse files Browse the repository at this point in the history
The bazel-genfiles symlink has been removed since Bazel 1.0.
See bazelbuild/bazel#8651
  • Loading branch information
aherrmann committed Nov 7, 2019
1 parent 1068f2a commit 65e35dc
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 21 deletions.
2 changes: 1 addition & 1 deletion BAZEL.md
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ Attributes:

The output of `da_doc_package` with name `"foo"` is a bundle
`sources.tar.gzip` in the path
`//bazel-genfiles/daml-foundations/daml-tools/docs/foo`. The bundle for `"foo"` would be produced with the command:
`//bazel-bin/daml-foundations/daml-tools/docs/foo`. The bundle for `"foo"` would be produced with the command:
```
bazel build //daml-foundations/daml-tools/docs/foo:foo
```
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ On Windows:

```
bazel build //release:sdk-release-tarball
tar -vxf .\bazel-genfiles\release\sdk-release-tarball.tar.gz
tar -vxf .\bazel-bin\release\sdk-release-tarball.tar.gz
cd sdk-*
daml\daml.exe install . --activate
```
Expand Down
2 changes: 1 addition & 1 deletion ci/build-unix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ steps:
- bash: |
set -euo pipefail
ARTIFACT=daml-sdk-$(release_tag)-${{ parameters.name }}.tar.gz
cp bazel-genfiles/release/sdk-release-tarball.tar.gz $(Build.StagingDirectory)/$ARTIFACT
cp bazel-bin/release/sdk-release-tarball.tar.gz $(Build.StagingDirectory)/$ARTIFACT
echo "##vso[task.setvariable variable=artifact;isOutput=true]$ARTIFACT"
name: publish
condition: eq(variables['release.has_released'], 'true')
Expand Down
4 changes: 2 additions & 2 deletions ci/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ steps:
- bash: |
set -euo pipefail
ARTIFACT=daml-sdk-$(release_tag)-windows.tar.gz
cp bazel-genfiles/release/sdk-release-tarball.tar.gz '$(Build.StagingDirectory)'/$ARTIFACT
cp bazel-bin/release/sdk-release-tarball.tar.gz '$(Build.StagingDirectory)'/$ARTIFACT
echo "##vso[task.setvariable variable=artifact;isOutput=true]$ARTIFACT"
WINDOWS_INSTALLER=daml-sdk-$(release_tag)-windows-unsigned.exe
cp bazel-genfiles/release/windows-installer/daml-sdk-installer.exe "$(Build.StagingDirectory)/$WINDOWS_INSTALLER"
cp bazel-bin/release/windows-installer/daml-sdk-installer.exe "$(Build.StagingDirectory)/$WINDOWS_INSTALLER"
echo "##vso[task.setvariable variable=artifact-unsigned-windows-installer;isOutput=true]$WINDOWS_INSTALLER"
name: publish
condition: eq(variables['release.has_released'], 'true')
Expand Down
6 changes: 3 additions & 3 deletions ci/cron/src/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ build_docs_folder path versions = do
shell_ $ "git checkout v" <> latest
robustly_download_nix_packages
shell_ "bazel build //docs:docs"
shell_ $ "tar xzf bazel-genfiles/docs/html.tar.gz --strip-components=1 -C " <> path
shell_ $ "tar xzf bazel-bin/docs/html.tar.gz --strip-components=1 -C " <> path
-- Not going through Aeson because it represents JSON objects as unordered
-- maps, and here order matters.
let versions_json = versions
Expand All @@ -139,14 +139,14 @@ build_docs_folder path versions = do
& \s -> "{" <> s <> "}"
writeFile (path <> "/versions.json") versions_json
shell_ $ "mkdir -p " <> path <> "/" <> latest
shell_ $ "tar xzf bazel-genfiles/docs/html.tar.gz --strip-components=1 -C " <> path <> "/" <> latest
shell_ $ "tar xzf bazel-bin/docs/html.tar.gz --strip-components=1 -C " <> path <> "/" <> latest
Foldable.for_ (tail versions) $ \version -> do
putStrLn $ "Building older docs: " <> version
shell_ $ "git checkout v" <> version
robustly_download_nix_packages
shell_ "bazel build //docs:docs"
shell_ $ "mkdir -p " <> path <> "/" <> version
shell_ $ "tar xzf bazel-genfiles/docs/html.tar.gz --strip-components=1 -C" <> path <> "/" <> version
shell_ $ "tar xzf bazel-bin/docs/html.tar.gz --strip-components=1 -C" <> path <> "/" <> version
shell_ $ "git checkout " <> cur_sha

check_s3_versions :: Set.Set String -> IO Bool
Expand Down
2 changes: 1 addition & 1 deletion dev-env/bin/daml-sdk-head
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ trap cleanup EXIT
# Building here separately so the user can see the build process which could take a while
bazel build $BAZEL_MODE_FLAG //release:sdk-head-tarball.tar.gz

readonly TARBALL=$(bazel info bazel-genfiles $BAZEL_MODE_FLAG)/release/sdk-head-tarball.tar.gz
readonly TARBALL=$(bazel info bazel-bin $BAZEL_MODE_FLAG)/release/sdk-head-tarball.tar.gz
readonly TMPDIR=$(mktemp -d)
mkdir -p $TMPDIR/sdk-head

Expand Down
12 changes: 6 additions & 6 deletions docs/scripts/live-preview.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ln -s ../source $BUILD_DIR
ln -s ../configs $BUILD_DIR
mkdir $BUILD_DIR/theme
bazel build //docs:theme
tar -zxf ../../bazel-genfiles/docs/da_theme.tar.gz -C $BUILD_DIR/theme
tar -zxf ../../bazel-bin/docs/da_theme.tar.gz -C $BUILD_DIR/theme

# License and Notices
cp ../../LICENSE ../source
Expand All @@ -41,26 +41,26 @@ do
if [ "$arg" = "--pdf" ]; then
bazel build //docs:pdf-docs
mkdir -p $BUILD_DIR/gen/_downloads
cp -L ../../bazel-genfiles/docs/DigitalAssetSDK.pdf $BUILD_DIR/gen/_downloads
cp -L ../../bazel-bin/docs/DigitalAssetSDK.pdf $BUILD_DIR/gen/_downloads
fi
if [ "$arg" = "--gen" ]; then
# Hoogle
bazel build //compiler/damlc:daml-base-hoogle-docs
mkdir -p $BUILD_DIR/gen/hoogle_db
cp -L ../../bazel-genfiles/compiler/damlc/daml-base-hoogle.txt $BUILD_DIR/gen/hoogle_db/base.txt
cp -L ../../bazel-bin/compiler/damlc/daml-base-hoogle.txt $BUILD_DIR/gen/hoogle_db/base.txt

# Javadoc
bazel build //language-support/java:javadocs
mkdir -p $BUILD_DIR/gen/app-dev/bindings-java
tar -zxf ../../bazel-genfiles/language-support/java/javadocs.tar.gz -C $BUILD_DIR/gen/app-dev/bindings-java
tar -zxf ../../bazel-bin/language-support/java/javadocs.tar.gz -C $BUILD_DIR/gen/app-dev/bindings-java

# Proto-docs
bazel build //ledger-api/grpc-definitions:docs
cp -L ../../bazel-genfiles/ledger-api/grpc-definitions/proto-docs.rst ../source/app-dev/grpc/
cp -L ../../bazel-bin/ledger-api/grpc-definitions/proto-docs.rst ../source/app-dev/grpc/

#StdLib
bazel build //compiler/damlc:daml-base-rst-docs
cp -L ../../bazel-genfiles/compiler/damlc/daml-base.rst ../source/daml/reference/base.rst
cp -L ../../bazel-bin/compiler/damlc/daml-base.rst ../source/daml/reference/base.rst
fi
done

Expand Down
2 changes: 1 addition & 1 deletion docs/scripts/preview.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ rm -rf $BUILD_DIR
mkdir $BUILD_DIR

bazel build //docs:docs
tar -zxf ../../bazel-genfiles/docs/html.tar.gz -C $BUILD_DIR
tar -zxf ../../bazel-bin/docs/html.tar.gz -C $BUILD_DIR
cd $BUILD_DIR/html
python -m http.server 8000
6 changes: 1 addition & 5 deletions release/src/Util.hs
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,11 @@ resolvePomData BazelLocations{..} sdkVersion sdkComponentVersion art =

data BazelLocations = BazelLocations
{ bazelBin :: !(Path Abs Dir)
, bazelGenfiles :: !(Path Abs Dir)
} deriving Show

getBazelLocations :: IO BazelLocations
getBazelLocations = do
bazelBin <- parseAbsDir . T.unpack . T.strip . T.pack =<< System.Process.readProcess "bazel" ["info", "bazel-bin"] ""
bazelGenfiles <- parseAbsDir . T.unpack . T.strip . T.pack =<< System.Process.readProcess "bazel" ["info", "bazel-genfiles"] ""
pure BazelLocations{..}

splitBazelTarget :: BazelTarget -> (Text, Text)
Expand Down Expand Up @@ -337,9 +335,7 @@ shouldRelease (AllArtifacts allArtifacts) (PlatformDependent platformDependent)

copyToReleaseDir :: (MonadLogger m, MonadIO m) => BazelLocations -> Path Abs Dir -> Path Rel File -> Path Rel File -> m ()
copyToReleaseDir BazelLocations{..} releaseDir inp out = do
binExists <- doesFileExist (bazelBin </> inp)
let absIn | binExists = bazelBin </> inp
| otherwise = bazelGenfiles </> inp
let absIn = bazelBin </> inp
let absOut = releaseDir </> out
$logInfo ("Copying " <> pathToText absIn <> " to " <> pathToText absOut)
createDirIfMissing True (parent absOut)
Expand Down

0 comments on commit 65e35dc

Please sign in to comment.