@@ -342,27 +342,9 @@ clean:
342
342
make -C $(EF_TESTS ) clean
343
343
make -C $(STATE_TRANSITION_VECTORS ) clean
344
344
345
- .PHONY : install-cargo-deb deb-cargo deb-cargo-x86_64 deb-cargo-aarch64 deb-cargo-all test-deb-reproducible install-deb-local remove-deb-local clean-deb help-deb
346
- # # Install cargo-deb if not present
347
- install-cargo-deb :
348
- @if ! command -v cargo-deb & > /dev/null; then \
349
- echo " Installing cargo-deb..." ; \
350
- cargo install cargo-deb; \
351
- else \
352
- echo " cargo-deb already installed" ; \
353
- fi
354
-
355
- # # Build .deb package using cargo-deb with reproducible settings
356
- deb-cargo : install-cargo-deb build-reproducible
345
+ .PHONY : deb-cargo
346
+ deb-cargo : build-reproducible # # Build .deb package using cargo-deb with reproducible settings
357
347
@echo " Building .deb package with cargo-deb..."
358
- @if [ ! -f " lighthouse/lighthouse.service" ]; then \
359
- echo " ❌ lighthouse.service not found in lighthouse/ directory" ; \
360
- exit 1; \
361
- fi
362
- @if [ ! -f " README.md" ]; then \
363
- echo " ❌ README.md not found in current directory" ; \
364
- exit 1; \
365
- fi
366
348
367
349
cd lighthouse && \
368
350
SOURCE_DATE_EPOCH=$(SOURCE_DATE ) \
@@ -374,65 +356,26 @@ deb-cargo: install-cargo-deb build-reproducible
374
356
@echo " ✅ Package built successfully!"
375
357
@find target/$(RUST_TARGET ) /debian -name " *.deb" -exec ls -la {} \;
376
358
377
- # # Build .deb for specific architectures
378
- deb-cargo-x86_64 :
359
+
360
+ .PHONY : deb-cargo-x86_64
361
+ deb-cargo-x86_64 : # # Build .deb for specific architectures
379
362
$(MAKE ) deb-cargo RUST_TARGET=x86_64-unknown-linux-gnu
380
363
364
+ .PHONY : deb-cargo-aarch64
381
365
deb-cargo-aarch64 :
382
366
$(MAKE ) deb-cargo RUST_TARGET=aarch64-unknown-linux-gnu
383
367
368
+ .PHONY : deb-cargo-all
384
369
deb-cargo-all : deb-cargo-x86_64 deb-cargo-aarch64
385
370
386
- # # Test reproducibility of cargo-deb packages
387
- test-deb-reproducible :
388
- @echo " Testing cargo-deb package reproducibility..."
389
- @if ! command -v diffoscope & > /dev/null; then \
390
- echo " Installing diffoscope..." ; \
391
- sudo apt-get update; \
392
- sudo apt-get install -y diffoscope binutils-multiarch; \
393
- fi
394
-
395
- @echo " Building first package..."
396
- @rm -f lighthouse_* .deb lighthouse-deb-* .deb
397
- @$(MAKE ) clean || true
398
- @$(MAKE ) deb-cargo
399
- @FIRST_PACKAGE=$$(find target/$(RUST_TARGET ) /debian -name "*.deb" | head -1 ) ; \
400
- if [ -n " $$ FIRST_PACKAGE" ]; then \
401
- cp " $$ FIRST_PACKAGE" ./lighthouse-deb-build-1.deb; \
402
- else \
403
- echo " ❌ First package not found" ; exit 1; \
404
- fi
405
-
406
- @echo " Building second package..."
407
- @$(MAKE ) clean || true
408
- @$(MAKE ) deb-cargo
409
- @SECOND_PACKAGE=$$(find target/$(RUST_TARGET ) /debian -name "*.deb" | head -1 ) ; \
410
- if [ -n " $$ SECOND_PACKAGE" ]; then \
411
- cp " $$ SECOND_PACKAGE" ./lighthouse-deb-build-2.deb; \
412
- else \
413
- echo " ❌ Second package not found" ; exit 1; \
414
- fi
415
-
416
- @echo " Comparing packages..."
417
- @echo " === Package sizes ==="
418
- @ls -la lighthouse-deb-build-* .deb
419
- @echo " === SHA256 checksums ==="
420
- @sha256sum lighthouse-deb-build-* .deb
421
-
422
- @if cmp -s lighthouse-deb-build-1.deb lighthouse-deb-build-2.deb; then \
423
- echo " ✅ SUCCESS: cargo-deb packages are identical!" ; \
424
- echo " ✅ Reproducible build PASSED" ; \
425
- else \
426
- echo " ❌ FAILED: cargo-deb packages differ" ; \
427
- echo " Running detailed analysis with diffoscope..." ; \
428
- diffoscope --text lighthouse-deb-build-1.deb lighthouse-deb-build-2.deb > cargo-deb-diff.txt || true ; \
429
- echo " Differences saved to cargo-deb-diff.txt" ; \
430
- echo " ❌ Reproducible build FAILED" ; \
431
- exit 1; \
432
- fi
433
371
434
- # # Install .deb package locally for testing
435
- install-deb-local :
372
+ .PHONY : test-deb-reproducible
373
+ test-deb-reproducible : # # Test reproducibility of cargo-deb packages
374
+ @./scripts/test-deb-reproducible.sh $(RUST_TARGET )
375
+
376
+
377
+ .PHONY : install-deb-local
378
+ install-deb-local : # # Install .deb package locally for testing
436
379
@PACKAGE=$$(find target/$(RUST_TARGET ) /debian -name "*.deb" | head -1 ) ; \
437
380
if [ -n " $$ PACKAGE" ]; then \
438
381
echo " Installing lighthouse package: $$ PACKAGE" ; \
@@ -449,22 +392,23 @@ install-deb-local:
449
392
echo " ❌ No .deb package found. Run 'make deb-cargo' first." ; \
450
393
fi
451
394
452
- # # Remove installed lighthouse package
453
- remove-deb-local :
395
+
396
+ .PHONY : remove-deb-local
397
+ remove-deb-local : # # Remove installed lighthouse package
454
398
@echo " Removing lighthouse package..."
455
399
sudo dpkg -r lighthouse || true
456
400
sudo systemctl daemon-reload || true
457
401
458
- # # Clean up debian packaging artifacts
459
- clean-deb :
402
+ .PHONY : clean-deb
403
+ clean-deb : # # Clean up debian packaging artifacts
460
404
@echo " Cleaning up debian packaging artifacts..."
461
405
rm -f lighthouse_* .deb lighthouse-deb-* .deb * -diff.txt
462
406
rm -rf target/* /debian/
463
407
464
- # # Show help for debian packaging
465
- help-deb :
408
+
409
+ .PHONY : help-deb
410
+ help-deb : # # Show help for debian packaging
466
411
@echo " Clean Debian Packaging Targets:"
467
- @echo " install-cargo-deb - Install cargo-deb tool"
468
412
@echo " deb-cargo - Build .deb package with cargo-deb"
469
413
@echo " deb-cargo-x86_64 - Build x86_64 .deb package"
470
414
@echo " deb-cargo-aarch64 - Build aarch64 .deb package"
0 commit comments