[Git][ghc/ghc][wip/T22322] configure: Always create the VERSION file

Ben Gamari (@bgamari) gitlab at gitlab.haskell.org
Thu Jan 26 15:08:27 UTC 2023



Ben Gamari pushed to branch wip/T22322 at Glasgow Haskell Compiler / GHC


Commits:
656e1560 by Ben Gamari at 2023-01-26T10:08:18-05:00
configure: Always create the VERSION file

Teach the `configure` script to create the `VERSION` file.
This will serve as the stable interface to allow the user to determine
the version number of a working tree.

Fixes #22322.

- - - - -


3 changed files:

- .gitlab-ci.yml
- configure.ac
- hadrian/src/Rules/SourceDist.hs


Changes:

=====================================
.gitlab-ci.yml
=====================================
@@ -950,9 +950,6 @@ pages:
 #############################################################
 
 
-# TODO: MP: This way of determining the project version is sadly very slow.
-# It seems overkill to have to setup a complete environment, and build hadrian to get
-# it to generate a single file containing the version information.
 project-version:
   stage: packaging
   image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV"
@@ -965,7 +962,6 @@ project-version:
     - sudo chown ghc:ghc -R .
     - .gitlab/ci.sh setup
     - .gitlab/ci.sh configure
-    - .gitlab/ci.sh run_hadrian VERSION
     - echo "ProjectVersion=$(cat VERSION)" > version.sh
 
   needs: []


=====================================
configure.ac
=====================================
@@ -1214,6 +1214,9 @@ AC_CONFIG_FILES(
   distrib/configure.ac
 ])
 
+dnl Create the VERSION file, satisfying #22322.
+printf "$ProjectVersion" > VERSION
+
 AC_OUTPUT
 [
 if test "$print_make_warning" = "true"; then


=====================================
hadrian/src/Rules/SourceDist.hs
=====================================
@@ -29,8 +29,6 @@ sourceDistRules = alternatives $ do
       archiveSourceTree prepareTree
     "GIT_COMMIT_ID" %> \fname ->
         writeFileChanged fname =<< setting ProjectGitCommitId
-    "VERSION" %> \fname ->
-        writeFileChanged fname =<< setting ProjectVersion
 
     -- Rules to download mingw tarballs
     let mingw_tarballs_stamp = "ghc-tarballs/mingw-w64/.mingw-w64.download.stamp"
@@ -120,7 +118,7 @@ prepareTree dest = do
     out <- askWithResources [] (target (vanillaContext Stage1 compiler) (Git ListFiles) [] [])
     top <- topDirectory
     let files = ["GIT_COMMIT_ID", "VERSION"] ++ getFiles out
-    need ["GIT_COMMIT_ID", "VERSION"]
+    need ["GIT_COMMIT_ID"]
     forM_ files $ \source -> do
       let target = dest -/- source
       copyFileSourceDist (top -/- source) target



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/656e15609425058d0966d4dcdcbe5841effc54dc

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/656e15609425058d0966d4dcdcbe5841effc54dc
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230126/4080e85c/attachment-0001.html>


More information about the ghc-commits mailing list