diff --git a/BAZEL.md b/BAZEL.md index 6bda98512e94..320135f5c5b8 100644 --- a/BAZEL.md +++ b/BAZEL.md @@ -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 ``` diff --git a/README.md b/README.md index 99de52cb6f25..c87e53d9fec4 100644 --- a/README.md +++ b/README.md @@ -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 ``` diff --git a/ci/build-unix.yml b/ci/build-unix.yml index dc38f12f6c14..409d990016b1 100644 --- a/ci/build-unix.yml +++ b/ci/build-unix.yml @@ -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') diff --git a/ci/build-windows.yml b/ci/build-windows.yml index 81d0ee668e76..a4b6cb146341 100644 --- a/ci/build-windows.yml +++ b/ci/build-windows.yml @@ -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') diff --git a/ci/cron/src/Main.hs b/ci/cron/src/Main.hs index 7d051fea535f..b184191293ea 100644 --- a/ci/cron/src/Main.hs +++ b/ci/cron/src/Main.hs @@ -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 @@ -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 diff --git a/dev-env/bin/daml-sdk-head b/dev-env/bin/daml-sdk-head index d7e3af881b6f..152f44bafac2 100755 --- a/dev-env/bin/daml-sdk-head +++ b/dev-env/bin/daml-sdk-head @@ -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 diff --git a/docs/scripts/live-preview.sh b/docs/scripts/live-preview.sh index 0302710c886f..b31734652560 100755 --- a/docs/scripts/live-preview.sh +++ b/docs/scripts/live-preview.sh @@ -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 @@ -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 diff --git a/docs/scripts/preview.sh b/docs/scripts/preview.sh index a3e176376557..58e550ec8ed1 100755 --- a/docs/scripts/preview.sh +++ b/docs/scripts/preview.sh @@ -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 diff --git a/release/src/Util.hs b/release/src/Util.hs index 9a7094055497..5ef3c771e5ce 100644 --- a/release/src/Util.hs +++ b/release/src/Util.hs @@ -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) @@ -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)