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

Disable dir_index ext2/3/4 option #469

Closed
wants to merge 1 commit into from

Conversation

bmwiedemann
Copy link
Member

This reduces indeterminism from filesystem readdir order,
e.g. this snippet suddenly delivers the same output every time:

mkdir -p in; for i in $(seq 10) ; do touch in/$i ; done
find in/ -type f > unreproducible

Since we usually do not have large directories, it should not slow
down the build processes.

Quick testing with

osc co openSUSE:Factory/python-service_identity && cd $_
time osc build --no-service --clean --vm-type=kvm \
    --offline --build-opt=--vm-disk-filesystem=ext4

showed that the difference is 0 +-0.2%

Alternative approach is to use a constant hash_seed via
tytso/e2fsprogs@e1f7100
but that is not yet in Leap 15.0

Helps to limit the effect of problems like
http://bugzilla.opensuse.org/show_bug.cgi?id=1110339

@mlschroe
Copy link
Member

mlschroe commented Oct 5, 2018

Hmm, but is that a good thing? We want to find and fix cases where the build depends on the filesystem ordering, don't we?

@bmwiedemann
Copy link
Member Author

bmwiedemann commented Oct 5, 2018

We can still find and fix those outside of OBS by having a local revert of this.
I thought, in OBS we want to have reduced rebuilds and re-publishs from indeterminism.

btw: does OBS use ext4 to build?
Otherwise, I might have to add this flag to ext3 as well.

@bmwiedemann
Copy link
Member Author

found it: /usr/lib/build/queryconfig reads .osc/_buildconfig-standard-x86_64 to see

# Use ext4 as FS in builder workers (instead of default ext3)
BuildFlags: vmfstype:ext4

@bmwiedemann bmwiedemann changed the title Disable dir_index ext4 option Disable dir_index ext2/3/4 option Oct 6, 2018
@bmwiedemann
Copy link
Member Author

Maybe I should make it an option, so I can enable/disable it easily for testing if it makes a difference...

@bmwiedemann bmwiedemann force-pushed the dirindex branch 2 times, most recently from 1d3421c to 40134c5 Compare October 15, 2018 04:08
This reduces indeterminism from filesystem readdir order,
e.g. this snippet suddenly delivers the same output every time:
mkdir -p in; for i in $(seq 10) ; do touch in/$i ; done
find in/ -type f > unreproducible

Since we usually do not have large directories, it should not slow
down the build processes.

Quick testing with openSUSE:Factory/python-service_identity
time osc build --no-service --clean --vm-type=kvm --offline
showed that the difference is 0 +-0.2%

Alternative approach is to use a constant hash_seed via
tytso/e2fsprogs@e1f7100
but that is not yet in Leap 15.0
bmwiedemann added a commit to bmwiedemann/reproducibleopensuse that referenced this pull request Oct 15, 2018
affects xine-ui and some others
that were otherwise not building reproducibly

Requires build package with
openSUSE/obs-build#469
bmwiedemann added a commit to bmwiedemann/reproducibleopensuse that referenced this pull request Oct 24, 2018
affects xine-ui and some others
that were otherwise not building reproducibly

Requires build package with
openSUSE/obs-build#469
@bmwiedemann
Copy link
Member Author

dir_index is now an option and default-off here.

bmwiedemann added a commit to bmwiedemann/reproducibleopensuse that referenced this pull request Nov 2, 2018
affects xine-ui and some others
that were otherwise not building reproducibly

Requires build package with
openSUSE/obs-build#469
@mlschroe
Copy link
Member

mlschroe commented Nov 7, 2018

Why is the default off?

@bmwiedemann
Copy link
Member Author

default off, to make builds more reproducible by default.
The only reason to switch it on would be performance, if there were cases with 10000+ files in a single dir happening during build.

@mlschroe
Copy link
Member

mlschroe commented Nov 9, 2018

I'm not in favor of changing the current default. Lets see what the others have to say.

bmwiedemann added a commit to bmwiedemann/reproducibleopensuse that referenced this pull request Nov 20, 2018
affects xine-ui and some others
that were otherwise not building reproducibly

Requires build package with
openSUSE/obs-build#469
@adrianschroeter
Copy link
Member

default change is indeed not a good idea. factory project might decide for it and change it there

bmwiedemann added a commit to bmwiedemann/reproducibleopensuse that referenced this pull request Dec 23, 2018
affects xine-ui and some others
that were otherwise not building reproducibly

Requires build package with
openSUSE/obs-build#469
bmwiedemann added a commit to bmwiedemann/reproducibleopensuse that referenced this pull request Jan 2, 2019
affects xine-ui and some others
that were otherwise not building reproducibly

Requires build package with
openSUSE/obs-build#469
bmwiedemann added a commit to bmwiedemann/reproducibleopensuse that referenced this pull request Jan 2, 2019
affects xine-ui and some others
that were otherwise not building reproducibly

Requires build package with
openSUSE/obs-build#469
bmwiedemann added a commit to bmwiedemann/reproducibleopensuse that referenced this pull request Feb 6, 2019
affects xine-ui and some others
that were otherwise not building reproducibly

Requires build package with
openSUSE/obs-build#469
bmwiedemann added a commit to bmwiedemann/reproducibleopensuse that referenced this pull request Feb 8, 2019
affects xine-ui and some others
that were otherwise not building reproducibly

Requires build package with
openSUSE/obs-build#469
bmwiedemann added a commit to bmwiedemann/reproducibleopensuse that referenced this pull request Feb 27, 2019
affects xine-ui and some others
that were otherwise not building reproducibly

Requires build package with
openSUSE/obs-build#469
bmwiedemann added a commit to bmwiedemann/reproducibleopensuse that referenced this pull request Feb 27, 2019
affects xine-ui and some others
that were otherwise not building reproducibly

Requires build package with
openSUSE/obs-build#469
@adrianschroeter
Copy link
Member

@bmwiedemann shall I adapt the code to make it an opt-in?

@bmwiedemann
Copy link
Member Author

dir_index is already an opt-in option. Or you want it unreproducible by default with a --vm-disk-no-dirindex option?

@adrianschroeter
Copy link
Member

I have submitted a reworked version now:

#634

it is really making this an opt-in without changing the default. It can also be configured via prjconf for OBS setups now.
So closing this one.

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

Successfully merging this pull request may close these issues.

None yet

3 participants