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

Throw better error when conf files are missing #1030

Merged
merged 14 commits into from
Feb 7, 2021

Conversation

infinisil
Copy link
Contributor

Previously, if some directories were missing .conf files, an error like
this would be thrown:

cp: missing destination file operand after '/nix/store/pnmrz06g0sa4s3yx53hgmr9k8jrh6ww0-ouroboros-network-framework-lib-ouroboros-network-framework-0.1.0.0-haddock-config/lib/ghc-8.6.5/package.conf.d'

While normally this shouldn't occur, I've seen it happen in CI anyways,
with the problem disappearing if the store path that's missing the files
was rebuilt a couple times.

With this commit, it becomes much easier to figure out which store path
is missing the files, which would be very hard to figure out from the
previous message.

Hopefully this helps with debugging future such random failures.

infinisil and others added 2 commits February 4, 2021 15:41
Previously, if some directories were missing .conf files, an error like
this would be thrown:

  cp: missing destination file operand after '/nix/store/pnmrz06g0sa4s3yx53hgmr9k8jrh6ww0-ouroboros-network-framework-lib-ouroboros-network-framework-0.1.0.0-haddock-config/lib/ghc-8.6.5/package.conf.d'

While normally this shouldn't occur, I've seen it happen in CI anyways,
with the problem disappearing if the store path that's missing the files
was rebuilt a couple times.

With this commit, it becomes much easier to figure out which store path
is missing the files, which would be very hard to figure out from the
previous message.
@hamishmack hamishmack added the hydra-do-build Enables PR jobset in Hydra label Feb 4, 2021
if (( ''${#files[@]} )); then
cp -f "''${files[@]}" $out/${packageCfgDir}
else
echo "$l/package.conf.d didn't contain any *.conf files!"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why no exit 1 here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah, must've missed that

@hamishmack
Copy link
Collaborator

I was looking into some of the other checks we have put in place to try catch this early and noticed that the ones in comp-builder.nix were using exit 0 instead of exit 1! So they error message might have been logged, but as $out was already created it might not have caused the derivation build to fail. I have checked the other exit 0 uses and there were some others. Unfortunately the change to comp-builder.nix means the hydra build is back to square one.

This is mostly so that it will be cached at ifdLevel 1
as it is needed for eval of ifdLevel 2
This is mostly so that it will be cached at ifdLevel 1
as it is needed for eval of ifdLevel 2
@hamishmack hamishmack mentioned this pull request Feb 6, 2021
This is mostly so that it will be cached at ifdLevel 1
as it is needed for eval of ifdLevel 2
@hamishmack hamishmack merged commit feea345 into master Feb 7, 2021
@iohk-bors iohk-bors bot deleted the missing-conf-files-test branch February 7, 2021 14:13
@infinisil
Copy link
Contributor Author

Thanks a lot!

booniepepper pushed a commit to booniepepper/haskell.nix that referenced this pull request Feb 4, 2022
* Throw better error when conf files are missing

Previously, if some directories were missing .conf files, an error like
this would be thrown:

  cp: missing destination file operand after '/nix/store/pnmrz06g0sa4s3yx53hgmr9k8jrh6ww0-ouroboros-network-framework-lib-ouroboros-network-framework-0.1.0.0-haddock-config/lib/ghc-8.6.5/package.conf.d'

While normally this shouldn't occur, I've seen it happen in CI anyways,
with the problem disappearing if the store path that's missing the files
was rebuilt a couple times.

With this commit, it becomes much easier to figure out which store path
is missing the files, which would be very hard to figure out from the
previous message.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hydra-do-build Enables PR jobset in Hydra
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants