Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Continuous deployment and difference in hashes between fetcher functions #172

Open
pikajude opened this issue Aug 3, 2014 · 5 comments
Open
Labels

Comments

@pikajude
Copy link

pikajude commented Aug 3, 2014

I have a darcs repo for my personal website. I have a continuous build running for it in Hydra. Unfortunately, since I use src = ./. instead of using a tarball and SHA (see: http://hub.darcs.net/joelteon/joelt.io/browse/default.nix), I can't use a cached Hydra build. On my machine, the store import of the source tree is (for example) /nix/store/1mcp51riccrkfrhb5jlbx3nzcrw16l5w-joelt.io. An identical copy of the source tree in Hydra would be something like /nix/store/kg69sya7fny2m5bp6r9i40q3xb6slp75-export, because even if the directory contents are identical, the directory name is taken into account.

Even if I patch Hydra to clone into a temporary directory with the correct repository name, Hydra imports the existing import into the store again for the build, so the actual source tree during build is /nix/store/g05db63rfxy3n0z9nwhjijfdvficakq4-1mcp51riccrkfrhb5jlbx3nzcrw16l5w-joelt.io.

I know that one workaround would be to use a source tarball, but that's an extra step and requires that I have the source somewhere and keep it updated, which really isn't ideal for a continuous deployment situation.

Is this a problem that can be solved?

@domenkozar
Copy link
Member

I duplicated this in NixOS/nix#904

@domenkozar domenkozar changed the title Continuous deployment Continuous deployment and difference in hashes between fetcher functions May 23, 2016
@domenkozar domenkozar added the bug label May 23, 2016
@expipiplus1
Copy link
Contributor

Is the directory name the only other changes to the hash that hydra is making?

I have foo/bar/default.nix in my repo, where default.nix has the line src = ./.. Hydra and my local machine seem to put the source in /nix/store/1mcp51riccrkfrhb5jlbx3nzcrw16l51-bar and /nix/store/kg69sya7fny2m5bp6r9i40q3xb6slp71-bar respectively. These paths were found by examining the value for "src" in the derivations being built.

@expipiplus1
Copy link
Contributor

Ah, I cant seem to find the issue number, but the source coming from a subdirectory does indeed work. The problem was that hydra was stripping .gitignore away from the subdirectory.

@Ericson2314
Copy link
Member

Ericson2314 commented Aug 13, 2016

Can't the name of the current directory also not affect the hash of ./.? I see no purpose for that. (Granted, this is a nix not hydra question.)

@domenkozar
Copy link
Member

domenkozar commented Feb 21, 2017

That would be ideal, but then it's possible to have:

/nix/store/kg69sya7fny2m5bp6r9i40q3xb6slp71-bar
/nix/store/kg69sya7fny2m5bp6r9i40q3xb6slp71-foo

Which in practice wouldn't happen often, but would that be an issue? This would be a backwards incompatible change for Nix that Eelco wouldn't be willing to do IMO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants