Coder Social home page Coder Social logo

bootstrap.hs doesn't work with stack 2.3.1 (Cannot complete repo information for a non SHA1 commit due to non-reproducibility) about proto-lens HOT 5 OPEN

blackgnezdo avatar blackgnezdo commented on July 20, 2024
bootstrap.hs doesn't work with stack 2.3.1 (Cannot complete repo information for a non SHA1 commit due to non-reproducibility)

from proto-lens.

Comments (5)

jinwoo avatar jinwoo commented on July 20, 2024

The error message is related to this: commercialhaskell/stack#4882

from proto-lens.

jinwoo avatar jinwoo commented on July 20, 2024

After #392, we go one step further and get this error:

$ stack runghc -- bootstrap.hs 
Cloning 0bef8c2f3da645f068b8a26ac168c1da41608182 from https://github.com/google/proto-lens
Unsupported tarball from /tmp/with-repo-archive212759/foo.tar: Symbolic link dest not found from proto-lens/proto-lens-imports/google to ../../google/protobuf/src/google, looking for proto-lens/../google/protobuf/src/google.
This may indicate that the source is a git archive which uses git-annex.
See https://github.com/commercialhaskell/stack/issues/4579 for further information.
bootstrap.hs: readCreateProcess: stack "--stack-yaml=stack-bootstrap.yaml" "path" "--local-install-root" (exit 1): failed

Apparently related to commercialhaskell/stack#4579.

from proto-lens.

jinwoo avatar jinwoo commented on July 20, 2024

I tried various things but couldn't figure out how to fix this symbolic link error. The new stack doesn't seem to give an escape hatch for ignoring it. @judah any idea?

from proto-lens.

judah avatar judah commented on July 20, 2024

Oof, sorry, I forgot about this problem. I encountered it a while ago here:
commercialhaskell/stack#5004 (comment)

Previously I just used stack-1.* when bootstrapping, but that won't work anymore due to the changes to proto-lens-runtime's reexport-modules. I suppose one fairly manual approach would be:

  • Delete package.yaml (so proto-lens-runtime.cabal is the source of truth)
  • Run the bootstrapping script with stack-1.*
  • Add back that package.yaml

That might be worth trying to unblock the release. I'll see if I can think of something better.

from proto-lens.

judah avatar judah commented on July 20, 2024

Actually, currently we're in a good place because we're not making any backwards-incompatible changes to the API. So I was able to regenerate it by removing the git-related logic altogether and using the in-tree packages for bootstrapping. It's not a great long-term solution, but it should work for the upcoming release:

diff --git a/bootstrap.hs b/bootstrap.hs
index 1d55ed4..9a00f37 100755
--- a/bootstrap.hs
+++ b/bootstrap.hs
@@ -47,9 +47,6 @@ main = do
     --    overwriting the previous versions.
     callProcess "git" ["checkout", bootstrapCommit, "--",
                        bootstrapModuleRoot </> "Proto"]
-    [sha] <- lines <$> readProcess "git" ["rev-parse", bootstrapCommit] ""
-    -- Append the bootstrapping commit hash to the yaml file.
-    appendFile bootstrappingYaml ("  commit: " ++ sha ++ "\n")
     [installRoot] <- lines <$> readProcess stack
                     [useBootstrappingYaml, "path", "--local-install-root"] ""
     let protocGenHaskell = installRoot </> "bin/proto-lens-protoc"
diff --git a/stack-bootstrap.yaml b/stack-bootstrap.yaml
index a30c62c..6edfe97 100644
--- a/stack-bootstrap.yaml
+++ b/stack-bootstrap.yaml
@@ -1,15 +1,11 @@
-resolver: lts-12.7
+resolver: lts-15.15
 
 packages:
+- proto-lens
 - proto-lens-protoc
+- proto-lens-runtime
 
 # Build the current HEAD proto-lens-protoc against older revisions of proto-lens
 # and proto-lens-descriptors that are consistent with each other.
 extra-deps:
 - ghc-source-gen-0.4.0.0
-- git: https://github.com/google/proto-lens
-  subdirs:
-  - proto-lens
-  - proto-lens-runtime
-  # A line like below will be appended by bootstrap.hs.
-  # commit: 0bef8c2f3da645f068b8a26ac168c1da41608182

from proto-lens.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.